Changes between Initial Version and Version 1 of Ticket #24861
- Timestamp:
- May 26, 2015, 7:19:58 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #24861 – Description
initial v1 26 26 if 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. 27 27 28 29 {{{ 28 30 def formfield_for_foreignkey(self, db_field, request, **kwargs): 29 31 if db_field.name == "value_option": 30 32 kwargs["queryset"] = request._obj_.category.attributes.all() 31 33 return super(AttributeInline, self).formfield_for_foreignkey(db_field, request, **kwargs) 34 }}} 35 32 36 33 37 So, if you have Attribute: Color, Size, ROM, RAM, the ideal would happen to a custom list value_options each.