Created
December 8, 2012 07:28
-
-
Save jjangdm/4239130 to your computer and use it in GitHub Desktop.
model concept
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class Member(models.Model): | |
name = models.CharField(max_length=30, verbose_name='name') | |
email = models.EmailField(verbose_name='email', blank=True) | |
birth = models.DateField(verbose_name='birthday', blank=True) | |
rdate = models.DateField(verbose_name='reg.date') | |
def __unicode__(self): | |
return self.name | |
class Meta: | |
ordering = ['name'] | |
verbose_name = 'members' | |
class Asset(models.Model): | |
name = models.ForeignKey(Member, verbose_name='name') | |
money = models.IntegerField(verbose_name='money',blank=True) | |
date = models.DateField(verbose_name='date') | |
def __unicode__(self): | |
return self.name.name | |
class Meta: | |
ordering = ['-date'] | |
verbose_name = 'asset' | |
class Salary(models.Model): | |
name = models.ForeignKey(Member, verbose_name='name') | |
money = models.IntegerField(verbose_name='money',blank=True) | |
date = models.DateField(verbose_name='date') | |
def __unicode__(self): | |
return self.name.name | |
class Meta: | |
ordering = ['-date'] | |
verbose_name = 'salary' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment