Dropdowns on Django Admin -
i new django , using allow users edit database tables through admin site. have 2 tables fields in common. want common fields appear dropdowns in 1 of tables. can't figure out how make multiple dropdowns. best gui tool use simple databases?
here code far:
class places(models.model): name = models.charfield(max_length=300) description = models.charfield(max_length=100) def __unicode__(self): return self.name # can add conditional here return 'description'? class more_places(models.model): name = models.foreignkey('places', null=true, blank=true, db_column = 'feature_name', related_name='featurename') # dropdown #1 description = models.foreignkey('places', null=true, blank=true, db_column = 'version', related_name='version') # want dropdown #2 more_data = models.charfield(max_length=10)
i don't see errors in model. , working two dropdowns in django v1.3. don't understand need of specifying related_name
Comments
Post a Comment