Changes between Initial Version and Version 1 of Ticket #24861


Ignore:
Timestamp:
May 26, 2015, 7:19:58 PM (9 years ago)
Author:
Felipe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24861 – Description

    initial v1  
    2626if I could just iterate a QuerySet each model choice of the form. The only thing achieved is that a queryset applies to all forms inline, but I need a different one for each inline.
    2727
     28
     29{{{
    2830def formfield_for_foreignkey(self, db_field, request, **kwargs):
    2931    if db_field.name == "value_option":
    3032        kwargs["queryset"] = request._obj_.category.attributes.all()
    3133    return super(AttributeInline, self).formfield_for_foreignkey(db_field, request, **kwargs)
     34}}}
     35
    3236
    3337So, if you have Attribute: Color, Size, ROM, RAM,  the ideal would happen to a custom list value_options each.
Back to Top