Re: [Django] #17789: when i use a custom FieldListFilter class for a given field.

2012-08-20 Thread Django
#17789: when i use a custom FieldListFilter class for a given field.
-+--
 Reporter:  Kidwind  |Owner:  julien
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  1.4
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  FieldListFilter  | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by KyleMac):

 My issue is that I wanted to use custom filters to change the titles of
 filters to clarify their purpose. However you can't do this with filters
 that span relationships because of the subject of this ticket.

 There is currently no other way to change the title of a filter other than
 using `verbose_name` on the field itself but that has a much wider effect.

 What I was trying to do was something like the following:

 {{{
 class PastSupplierFilter(RelatedFieldListFilter):
 def __init__(self, *args, **kwargs):
 super(PastSupplierFilter, self).__init__(*args, **kwargs)
 self.title = _('past supplier')


 class ReorderAdmin(admin.ModelAdmin):
 list_filter = (
 ('product__suppliers', PastSupplierFilter),
 )
 }}}

 A better solution but a more complex change would be to allow
 `list_filter` to accept a third value as the title of the filter. Django
 currently assumes that the name of a field and the purpose/effect of a
 filter are the same, which is not always the case especially when spanning
 relationships.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #17789: when i use a custom FieldListFilter class for a given field.

2012-08-19 Thread Django
#17789: when i use a custom FieldListFilter class for a given field.
-+--
 Reporter:  Kidwind  |Owner:  julien
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  1.4
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  FieldListFilter  | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by prestontimmons):

 * status:  reopened => closed
 * resolution:   => needsinfo


Comment:

 KyleMac -

 I read through your comment, but I'm not sure the issue you describe is
 the same as the ticket subject--which is about letting fields in custom
 filters span relations.

 If you think you have a use case for this, please post a code sample to
 show how changing the current behavior would help.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #17789: when i use a custom FieldListFilter class for a given field.

2012-07-24 Thread Django
#17789: when i use a custom FieldListFilter class for a given field.
-+--
 Reporter:  Kidwind  |Owner:  julien
 Type:  Bug  |   Status:  reopened
Component:  contrib.admin|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:  FieldListFilter  | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by KyleMac):

 * status:  closed => reopened
 * version:  1.3 => 1.4
 * resolution:  needsinfo =>


Comment:

 I've also run into this problem.

 My situation is that I have the same model appearing in `list_display` and
 `list_filter` but through different relationships. `List_display` is
 showing the current supplier whereas `list_filter` can be used to find all
 items supplied by a specified supplier in the past.

 This creates an issue where I have a column named "supplier" and a filter
 named "supplier" but the filter is not the same as the column. To clarify
 this I wanted to create a `SimpleListFilter` and set the `title` attribute
 to something more descriptive but this raises a `SuspiciousOperation` and
 as far as I can tell there is no other way to change the display title for
 filters.

 If this is to be considered a feature and not a bug then the documentation
 needs to be clarified. Julien says that the documentation states that the
 first element must be a "field name", but two bullet points up the docs
 call `company__name` a "field name".

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #17789: when i use a custom FieldListFilter class for a given field.

2012-03-04 Thread Django
#17789: when i use a custom FieldListFilter class for a given field.
-+--
 Reporter:  Kidwind  |Owner:  julien
 Type:  Bug  |   Status:  closed
Component:  contrib.admin|  Version:  1.3
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:  FieldListFilter  | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by julien):

 * status:  new => closed
 * resolution:   => needsinfo
 * stage:  Accepted => Unreviewed


Comment:

 As stated in the documentation, if an element of `list_filter` is a tuple,
 then the first element of that tuple must be a field name. Your example
 (`'RelationModel__Field'`) isn't just a field name — it spans
 relationships. I'm not saying that there can't be any valid use case for
 this, but right now it seems like a mis-use of the API.

 Please reopen this ticket if you can describe a valid use case for using a
 field name spanning relationships inside that tuple. If you do, then
 providing some sample code would be useful to understand your use case.
 Thank you.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17789: when i use a custom FieldListFilter class for a given field.

2012-03-04 Thread Django
#17789: when i use a custom FieldListFilter class for a given field.
-+
 Reporter:  Kidwind  |Owner:  julien
 Type:  Bug  |   Status:  new
Component:  contrib.admin|  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:  FieldListFilter  | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+

Comment (by aaugustin):

 I've regenerated the patch from the root for clarity.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17789: when i use a custom FieldListFilter class for a given field.

2012-03-04 Thread Django
#17789: when i use a custom FieldListFilter class for a given field.
-+
 Reporter:  Kidwind  |Owner:  julien
 Type:  Bug  |   Status:  new
Component:  contrib.admin|  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:  FieldListFilter  | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+
Changes (by julien):

 * owner:  nobody => julien
 * stage:  Unreviewed => Accepted


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17789: when i use a custom FieldListFilter class for a given field.

2012-03-04 Thread Django
#17789: when i use a custom FieldListFilter class for a given field.
-+--
 Reporter:  Kidwind  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.admin|  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:  FieldListFilter  | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Description changed by aaugustin:

Old description:

> when i use a custom FieldListFilter class for a given field.
>
> {{{
> list_filter = ('Site', ('RelationModel__Field',
> MyCustomFieldListFilter),)
> }}}
>
> i get ``"Filtering by RelationModel__Field__exact not allowed"``

New description:

 when i use a custom FieldListFilter class for a given field.

 {{{
 list_filter = ('Site', ('RelationModel__Field', MyCustomFieldListFilter),)
 }}}

 i get `"Filtering by RelationModel__Field__exact not allowed"`

--

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #17789: when i use a custom FieldListFilter class for a given field.

2012-03-04 Thread Django
#17789: when i use a custom FieldListFilter class for a given field.
-+--
 Reporter:  Kidwind  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  contrib.admin|  Version:  1.3
 Severity:  Normal   |   Resolution:
 Keywords:  FieldListFilter  | Triage Stage:  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by aaugustin):

 * needs_docs:   => 0
 * needs_tests:   => 0
 * needs_better_patch:   => 0


Old description:

> when i use a custom FieldListFilter class for a given field.
>
> list_filter = ('Site', ('RelationModel__Field',
> MyCustomFieldListFilter),)
>
> i get "Filtering by RelationModel__Field__exact not allowed"

New description:

 when i use a custom FieldListFilter class for a given field.

 {{{
 list_filter = ('Site', ('RelationModel__Field', MyCustomFieldListFilter),)
 }}}

 i get ``"Filtering by RelationModel__Field__exact not allowed"``

--

Comment:

 Fixed formatting -- please use preview.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #17789: when i use a custom FieldListFilter class for a given field.

2012-02-27 Thread Django
#17789: when i use a custom FieldListFilter class for a given field.
---+-
 Reporter:  Kidwind|  Owner:  nobody
 Type:  Bug| Status:  new
Component:  contrib.admin  |Version:  1.3
 Severity:  Normal |   Keywords:  FieldListFilter
 Triage Stage:  Unreviewed |  Has patch:  1
Easy pickings:  0  |  UI/UX:  0
---+-
 when i use a custom FieldListFilter class for a given field.

 list_filter = ('Site', ('RelationModel__Field', MyCustomFieldListFilter),)

 i get "Filtering by RelationModel__Field__exact not allowed"

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.