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',
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 =
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
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
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
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
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
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
8 matches
Mail list logo