Stock application creation

This commit is contained in:
guillaume-renaud 2016-10-26 17:20:42 +02:00
parent a90a553939
commit 402a14d69a
6 changed files with 19 additions and 0 deletions

0
stock/__init__.py Normal file
View File

3
stock/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

View File

10
stock/models.py Normal file
View File

@ -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

3
stock/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
stock/views.py Normal file
View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.