Re: searching stackedinline fields via search_fields in admin

2010-08-22 Thread ringemup
To add a filter that works with a related field, you have to write a custom filterspec (which isn't really documented anywhere AFAIK). To add the search on the related fields you just need to do what I described above: class CarAdmin(admin.ModelAdmin) search_fields = ['model',

Re: searching stackedinline fields via search_fields in admin

2010-08-21 Thread gondor
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 =

Re: searching stackedinline fields via search_fields in admin

2010-08-21 Thread !!CONDORIOUS!!
Hello Karen, You are right. I'll try that when I get home. I knew that solution and even applied it in another model but because I was blinded by the stackedline. thank you both Condor On Sat, Aug 21, 2010 at 5:34 AM, Karen Tracey wrote: > On Sat, Aug 21, 2010 at 2:01

Re: searching stackedinline fields via search_fields in admin

2010-08-21 Thread Karen Tracey
On Sat, Aug 21, 2010 at 2:01 AM, Condorious wrote: > My goal is to add search to stackedinline in addition to the common > standard search fields. If admin model knows enough to stackinline the > right stackedinline model, we should be able to > Search it as well. I just

Re: searching stackedinline fields via search_fields in admin

2010-08-21 Thread Condorious
My goal is to add search to stackedinline in addition to the common standard search fields. If admin model knows enough to stackinline the right stackedinline model, we should be able to Search it as well. I just need someone to point me in the right direction or some me some sample code that

Re: searching stackedinline fields via search_fields in admin

2010-08-20 Thread Karen Tracey
On Fri, Aug 20, 2010 at 4:54 PM, ringemup wrote: > The admin search isn't searching the ModelAdmin or Inline files, it's > searching the fields from the model. > > You can search a ForeignKey's fields by listing > 'foreignkeyfieldname__relatedmodelfieldname' in your

Re: searching stackedinline fields via search_fields in admin

2010-08-20 Thread ringemup
The admin search isn't searching the ModelAdmin or Inline files, it's searching the fields from the model. You can search a ForeignKey's fields by listing 'foreignkeyfieldname__relatedmodelfieldname' in your search_fields. So for example if you had the following models: class

searching stackedinline fields via search_fields in admin

2010-08-20 Thread gondor
Hello All, I'm wanting to add a field from my stackedinline form to my search_fields in admin. Does anyone know how to do that or point me in a general direction/sample code? Thanx Condor -- You received this message because you are subscribed to the Google Groups "Django users" group. To