Hello list,
I have a question regarding general database design.
Ok.. which method would you recommend, if you have a table
with a field 'name' which values should be unique in the whole table?

1) use (implicit) id which is automatically added by django, as primary
key and a 'name' field with "unique=True" set:

class Person(models.Model):
    name = models.CharField(maxlength=255, unique=True)


2) or the name directly as the primary key of the table without an id:

class Person(models.Model):
    name = models.CharField(maxlength, primary_key)

I'm a bit confused on how do it 'right(tm)'. Is there a
rule or how would you do it?

Thanks for ideas
Kai

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to