Creation of the Stock list, edit, create views and creation StockItem create view

This commit is contained in:
guillaume-renaud
2016-11-09 17:49:19 +01:00
parent ccb339b9bd
commit 887893fb2d
9 changed files with 2972 additions and 14 deletions

View File

@ -1,5 +1,7 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from counter.models import Counter
@ -11,6 +13,9 @@ class Stock(models.Model):
def __str__(self):
return "%s (%s)" % (self.name, self.counter)
def get_absolute_url(self):
return reverse('stock:list')
class StockItem(models.Model):
""" The StockItem class, element of the stock """
name = models.CharField(_('name'), max_length=64)