My favorites | Sign in
Project Home Downloads Issues Source
Search
for
relatedlookups  
Updated Nov 23, 2009 by hainea...@gmail.com

Related Lookups

When entering a value (ID) for a ForeignKey, the related object is instantly displayed right beside the input-field (after the search-icon).

This also works for a M2M-field.

Usage

model.py

class GrappelliFields(models.Model):
    gr_test = models.ForeignKey(User, verbose_name=u"Related lookup on users", null=True, blank=True)
    # ...

admin.py

class GrappelliFieldsAdmin(GrappelliModelAdmin):
    list_display  = ('__unicode__',)
    raw_id_fields = ('gr_test',)    
    # ...
Powered by Google Project Hosting