Initial entry of models

This commit is contained in:
2013-07-24 15:41:59 +10:00
parent c8db182dc7
commit 234e7f2c60
14 changed files with 331 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
from django.db import models
class CommonInfo(models.Model):
name = models.CharField(max_length=100)
active = models.BooleanField(default=True)
def __unicode__(self):
return self.name
class Meta:
abstract = True
class Category(CommonInfo):
parent = models.ForeignKey('self', blank=True, null=True,
on_delete=models.SET_NULL)
class Sample(CommonInfo):
parent = models.ForeignKey(Category, blank=True, null=True,
on_delete=models.SET_NULL)