How to handle inlines
See original GitHub issueHi, I have two inline models and category model as follows
class CategoryAdmin(ExportActionModelAdmin, PageAdmin):
fieldsets = category_fieldsets
formfield_overrides = {ImageField: {"widget": ImageWidget}}
filter_horizontal = ("options", "products",)
class ProductVariationAdmin(admin.TabularInline):
verbose_name_plural = _("Current variations")
model = ProductVariation
fields = variation_fields
max_num = variations_max_num
extra = variations_extra
formfield_overrides = {MoneyField: {"widget": MoneyWidget}}
form = ProductVariationAdminForm
formset = ProductVariationAdminFormset
ordering = ["option%s" % i for i in settings.SHOP_OPTION_ADMIN_ORDER]
class ProductImageAdmin(TabularDynamicInlineAdmin):
model = ProductImage
formfield_overrides = {ImageField: {"widget": ImageWidget}}
class ProductAdmin(ImportExportMixin,DisplayableAdmin):
class Media:
js = (static("cartridge/js/admin/product_variations.js"),)
css = {"all": (static("cartridge/css/admin/product.css"),)}
list_display = product_list_display
list_display_links = ("admin_thumb", "title")
list_editable = product_list_editable
list_filter = ("status", "available", "categories")
filter_horizontal = ("categories",) + tuple(other_product_fields)
search_fields = ("title", "content", "categories__title",
"variations__sku")
inlines = (ProductImageAdmin, ProductVariationAdmin)
form = ProductAdminForm
fieldsets = product_fieldsets
How should i write resource for Product model which includes category and two inline models Productvariation and Productimage.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:12
- Comments:18 (1 by maintainers)
Top Results From Across the Web
How to Control Speed + Stop on Inline Skates - YouTube
In this episode we take a look at the basics of speed control + stopping on inline skates! These skills will help mitigate...
Read more >How to handle the heat as an Inline Skater - YouTube
Do you skate more or less during hot summers, shorter or longer, at a slower or faster pace, earlier or later? And how...
Read more >Inline Skating Down Hill Slowing Tutorial - YouTube
Inline Skating downhill slowing techniques will enhance your city skates and safety. This 'best' slowing tutorial from City Skater Bill ...
Read more >How to Skate Over and Around Obstacles | Inline Skating
With our rollerblading tutorial, we'll show you how to turn and get around obstacles like pavements and potholesLearn more about inline ...
Read more >5 mistakes made by Beginners when learning to inline skate
The 5 most common mistakes made by beginners when learning to inline skate - skating tutorial on Powerslide inline skates.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, any updates regarding this? I have a Survey model and Question model that is related to the survey, when exporting a survey I would like all the related questions to show, is that possible?
This should needed to be added to Django import export.