question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to handle inlines

See original GitHub issue

Hi, 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:open
  • Created 7 years ago
  • Reactions:12
  • Comments:18 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
LOYACcommented, Nov 3, 2020

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?

3reactions
tochimclarencommented, Mar 17, 2020

This should needed to be added to Django import export.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found