Saturday, August 21, 2010

Re: searching stackedinline fields via search_fields in admin

Here is what i'm trying to do: I've looked at my code and I don't
have a foreign key out reference from my model thus cannot find the
inline fields. reverse reference doens't seem to work either

class CarRadio(modesl.Model):
name = models.ForeignKey('Car');
id = models.CharField(max_length='10', blank=True)


class Car(models.Model):
owner = CharField(max_length='10')
name = CharField(max_length='10')
model = CharField(max_length='10')
typeofwheels = CharField(max_length='10')
...


class CarAdmin(admin.Model):
list_filter = {'model', 'name', 'typeofwheels'} < -- I want to
add list_filter from CarRadioInline here
search_fileds = {'model', 'name',} < -- I wanted to add search
fields from CarRadioInline here
inlines = [ CarRadioInline, ]


class CarRadioInline(admin.StackedInline):
model = CarRadio
extra = 1
fieldset = ((None, {'fields': (('name', 'id'))})

thanx

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate