from django.contrib import admin
from markdownx.admin import MarkdownxModelAdmin
from .models import Purchase
from dostawemo.products.models import Product
from dostawemo.products.admin import ProductImageInline
from nested_admin import NestedStackedInline, NestedModelAdmin


class PurchaseProductInline(NestedStackedInline):
    model = Product
    extra = 0
    show_change_link = True
    classes = ('collapse', )
    inlines = [ ProductImageInline, ]


class PurchaseAdmin(NestedModelAdmin, MarkdownxModelAdmin):
    readonly_fields=('collected_amount',)
    inlines = [ PurchaseProductInline, ]


admin.site.register(Purchase, PurchaseAdmin)
491a30b5e84b96cc6f87d711a3eea051af3c9716
<mask token>


class PurchaseProductInline(NestedStackedInline):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>


class PurchaseAdmin(NestedModelAdmin, MarkdownxModelAdmin):
    readonly_fields = 'collected_amount',
    inlines = [PurchaseProductInline]


<mask token>

<mask token>


class PurchaseProductInline(NestedStackedInline):
    model = Product
    extra = 0
    show_change_link = True
    classes = 'collapse',
    inlines = [ProductImageInline]


class PurchaseAdmin(NestedModelAdmin, MarkdownxModelAdmin):
    readonly_fields = 'collected_amount',
    inlines = [PurchaseProductInline]


<mask token>

<mask token>


class PurchaseProductInline(NestedStackedInline):
    model = Product
    extra = 0
    show_change_link = True
    classes = 'collapse',
    inlines = [ProductImageInline]


class PurchaseAdmin(NestedModelAdmin, MarkdownxModelAdmin):
    readonly_fields = 'collected_amount',
    inlines = [PurchaseProductInline]


admin.site.register(Purchase, PurchaseAdmin)

from django.contrib import admin
from markdownx.admin import MarkdownxModelAdmin
from .models import Purchase
from dostawemo.products.models import Product
from dostawemo.products.admin import ProductImageInline
from nested_admin import NestedStackedInline, NestedModelAdmin


class PurchaseProductInline(NestedStackedInline):
    model = Product
    extra = 0
    show_change_link = True
    classes = 'collapse',
    inlines = [ProductImageInline]


class PurchaseAdmin(NestedModelAdmin, MarkdownxModelAdmin):
    readonly_fields = 'collected_amount',
    inlines = [PurchaseProductInline]


admin.site.register(Purchase, PurchaseAdmin)

from django.contrib import admin
from markdownx.admin import MarkdownxModelAdmin
from .models import Purchase
from dostawemo.products.models import Product
from dostawemo.products.admin import ProductImageInline
from nested_admin import NestedStackedInline, NestedModelAdmin


class PurchaseProductInline(NestedStackedInline):
    model = Product
    extra = 0
    show_change_link = True
    classes = ('collapse', )
    inlines = [ ProductImageInline, ]


class PurchaseAdmin(NestedModelAdmin, MarkdownxModelAdmin):
    readonly_fields=('collected_amount',)
    inlines = [ PurchaseProductInline, ]


admin.site.register(Purchase, PurchaseAdmin)