From 402a14d69a922ca21588ec8b2df599b99aff0718 Mon Sep 17 00:00:00 2001 From: guillaume-renaud Date: Wed, 26 Oct 2016 17:20:42 +0200 Subject: [PATCH] Stock application creation --- stock/__init__.py | 0 stock/admin.py | 3 +++ stock/migrations/__init__.py | 0 stock/models.py | 10 ++++++++++ stock/tests.py | 3 +++ stock/views.py | 3 +++ 6 files changed, 19 insertions(+) create mode 100644 stock/__init__.py create mode 100644 stock/admin.py create mode 100644 stock/migrations/__init__.py create mode 100644 stock/models.py create mode 100644 stock/tests.py create mode 100644 stock/views.py diff --git a/stock/__init__.py b/stock/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/stock/admin.py b/stock/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/stock/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/stock/migrations/__init__.py b/stock/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/stock/models.py b/stock/models.py new file mode 100644 index 00000000..1fdbf62a --- /dev/null +++ b/stock/models.py @@ -0,0 +1,10 @@ +from django.db import models +from django.counter import Counter + +class Stock(models.Model): + """ The Stock class, this one is used to know how many products are left for a specific counter """ + name = models.CharField(_('name'), max_length=64) + counter = models.OneToOneField(Counter, verbose_name=_('counter'), related_name='stock') + + def __str__(self): + return self.name \ No newline at end of file diff --git a/stock/tests.py b/stock/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/stock/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/stock/views.py b/stock/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/stock/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here.