Hi all,
I am pulling a variety of information sources to build up a profile of a person. Once I do this I want to the flexibility to look at a person in a different ways. I don't have a lot of expierience in django so I would like a critique (be gentle) of my model. Admittedly even as I coded this I'm thinking redundancy (against DRY) but I would like to know what others think. FWIW - this data was pulled not created - so maybe I shouldn't keep it all but dropping data seems bad..
Specifically I want to know if the use of ManyToMany is appropriate or would you just KISS and leave each entry as it's own without any ManyToMany business. Long term I think KISS would make updating it simple (a basic for loop) but is there a tradeoff with being able to query a person (say based on location_description or job_function). Anyway I would appreciate some input.
class Person(models.Model):
"""This simply builds a notes user"""
aliases = models.ManyToManyField(Aliases) #Hmm this is list..
assistant = models.CharField(max_length = 255, blank = True)
cell_phone = models.CharField(max_lenth = 16, blank = True)
city = models.ManyToManyField(City)
country = models.ManyToManyField(County)
department = models.ManyToManyField(Department)
departmeht_number = models.ManyToManyField(Department_Number)
division_code = models.ManyToManyField(Division_Code)
email = models.EmailField(max_length = 50)
functional_area = models.ManyToManyField(Functional_Area)
# jpeg = models.
job_classification = models.ManyToManyField(Job_Classification)
job_classification_code = models.ManyToManyField(Job_Classification_Code)
last_name = models.CharField(max_length = 255)
location_description = models.ManyToManyField(Location_Description)
location_path = models.ManyToManyField(Location_Path)
mail_address = models.CharField(max_length = 255, blank = True)
mail_domain = models.ManyToManyField(Mail_Domain)
mail_file = models.CharField(max_length = 255, blank = True)
mail_server = models.ManyToManyField(Mail_Server)
match_pct = models.CharField(max_lenth = 6)
name = models.CharField(max_length = 255)
name_reverse = models.CharField(max_length = 255)
nickname = models.CharField(max_length = 32)
notes_url = models.URLField()
# object_class = models.
office_phone = models.CharField(max_length = 255, blank = True)
other_phone = models.CharField(max_length = 255, blank = True)
position = models.ManyToManyField(Position)
section = models.ManyToManyField(Section)
section_code = models.ManyToManyField(SectionCode)
shift = models.ManyToManyField(Shift)
state = models.ManyToManyFiedl(State)
supervisor = models.ManyToManyField(Supervisor)
supervisor_reverse = models.ManyToManyField(Supervisor_reverse)
uid = models.CharField(max_length = 128)
def __unicode__(self):
return str(self.name)