Skip to content

Instantly share code, notes, and snippets.

@newbiethetest
Created November 19, 2013 04:37
Show Gist options
  • Save newbiethetest/7540396 to your computer and use it in GitHub Desktop.
Save newbiethetest/7540396 to your computer and use it in GitHub Desktop.
from django.db import models
# Create your models here.
class MY_ROLE(models.Model):
role_name = models.CharField(max_length=20)
def __unicode__(self):
return self.role_name
class MY_USER(models.Model):
user_name = models.CharField(max_length=30,unique=True)
email = models.EmailField()
telphone = models.CharField(max_length=11,blank=True)
role = models.ForeignKey(MY_ROLE,related_name='roles')
class MY_STATUS(models.Model):
status_name = models.CharField(max_length=20)
def __unicode__(self):
return self.status_name
class USER_STATUS(models.Model):
username = models.ForeignKey(MY_USER)
status = models.ForeignKey(MY_STATUS)
def __unicode__(self):
return self.username
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment