Re: Seeking Example of MultipleChoiceField Example with dynamic Choices

2009-05-17 Thread lokeshmaremalla
Hi, p=Country.objects.all() -> capturing all the records from Country table def country_filler(self):-> function to generate a country list which we are going to fetch from the records incr = 0 for i in p: self[incr] = i.country incr = incr+1 return self.i

check_constraints module error

2009-05-16 Thread lokeshmaremalla
Hi All, I am trying to add check constraints to my table and i was ended with the below error. I got this statement "from check_constraints import check" from django doc site. (http://code.google.com/p/django-check-constraints/wiki/Features) Please guide me if I am missing any thing while import

Re: how to refer a foreign key to a non primary column from other model

2009-05-16 Thread lokeshmaremalla
Hi joshua, Yes, I just want to link username to details table. Regards, Lokesh On May 16, 7:30 pm, Joshua Russo wrote: > Foreign keys only point to primary key values. That's just how > relational DBs work > > It looks like you just want to link details to a user. Is that > correct? > > On May

how to refer a foreign key to a non primary column from other model

2009-05-16 Thread lokeshmaremalla
Hi All, Need help in creating foreign key column in a table. In the below model I would like to create a foreign key for the field 'new_foreign_col' which should refer to 'username' column (non primary column) from auth_user table. class details(models.Model): new_foreign_col = Tha

how to refer a foreign key to a non primary column from other model

2009-05-16 Thread lokeshmaremalla
Hi All, Is it possible to create a foreign key to a model referring to a non primary column from other model. class details(models.Model): username = ?? -> how I can refer this field as a foreign key to username column which is from auth_user table. Thanks in advance. Regards