class Disposition (models.Model):
        id = models.AutoField (primary_key=True)
        name = models.CharField (max_length=50, blank=False,
db_index=True)
        active = models.IntegerField(blank=False,
choices=active_choices)
        order = models.IntegerField(blank=True, default=0)
class DispositionAdmin(admin.ModelAdmin):
        list_display = ('name','active','order',)
        search_fields = ['name']
admin.site.register(Disposition,DispositionAdmin)

class Record (models.Model):
        id = models.AutoField (primary_key=True)
        FirstName = models.CharField (max_length=25,blank=False,
db_index=True)
        LastName = models.CharField (max_length=45,blank=False,
db_index=True)
        Status = models.CharField
(choices=inout_choices,max_length=3,blank=False, db_index=True)
        Photo= models.ImageField(upload_to="demo/evacuees/",
blank=True)
        Disposition = models.ForeignKey('Disposition',
verbose_name=_('Disposition Value'),db_index=True, blank=False)
        Notes = models.TextField(blank=True)
        LastTouchedBy = models.ForeignKey(User, unique=False,
db_index=True, blank=False)
        LastUpdated = models.DateTimeField
(auto_now_add=True,blank=False, db_index=True,help_text='Auto Filled')

        def disposition_name(self):
                return self.Disposition.name

        def Last_Updated_By(self):
                return self.LastTouchedBy.get_full_name()



Can you see any reason that the Disposition select box in the Record
Model would be populated witth "Disposition object 1,2,3,4" rather
than Disposition.name?

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to