Re: populating a field based on selection of foreign key

2011-04-10 Thread Aref
Hello Ernesto, Thank you for taking the time to respond to my question. I tried your suggestion and unfortunately it did not work. I need to fill in the generation field of the board instance with the same generation as in system. I would like this to happen automatically. Again thanks for the res

Re: populating a field based on selection of foreign key

2011-04-09 Thread Ernesto Guevara
Hello! I think you need something like this in your admin.py: class SystemAdmin(admin.ModelAdmin): list_display = ("generation", "system", "cog_E") ordering = ["-cog_E"] search_fields = ("system") list_filter = ("generation") list_per_page = 10 admin.site.register(System, Syst

populating a field based on selection of foreign key

2011-04-09 Thread Aref
I am working on a database project and I am facing a little challenge. Here it is. I have three tables defined as below: class Generation(models.Model): generation = models.CharField(max_length = 25) def __unicode__(self): return self.generation class CogE(models.Model): fir

populating a field based on selection of foreign key

2011-04-09 Thread Aref
I am working on a database project and I am facing a little challenge. Here it is. I have three tables defined as below: class Generation(models.Model): generation = models.CharField(max_length = 25) def __unicode__(self): return self.generation class CogE(models.Model): fir