How to add additional field to django oscar product field in dashboard
Asked Answered
C

1

6

How do I add an additional field to django-oscar dashboard? I've forked catalog app added an extra field, but the form is not showing after forking dashboard.

from django.db import models
from oscar.apps.catalogue.abstract_models import AbstractProduct


class Product(AbstractProduct):
    file = models.FileField(upload_to='files/%Y/%m/%d')


from oscar.apps.catalogue.models import *

dashboard/catalogue/forms.py

from oscar.apps.dashboard.catalogue import forms as base_forms


class ProductForm(base_forms.ProductForm):

    class Meta(base_forms.ProductForm.Meta):

        fields = ('file',)
Commendam answered 28/9, 2019 at 13:28 Comment(0)
C
7

First, create a directory to hold the forked app example forked_app_dir next use oscar_fork_app utility (which is very very poorly documented when you want to fork the dashboard apps) in my case, I wanted to fork the catalogue dashboard app so I did ./manage.py oscar_fork_app dashboard then changed into the dashboard directory and did ./manage.py oscar_fork_app catalogue_dashboard which created another dashboard dir which I removed and everything worked fine after applying changes forms in the dashboard.

Commendam answered 29/9, 2019 at 12:31 Comment(3)
I haven't found the way to fork sub_app anywhere on the doc : oscar_fork_app catalogue_dashboard. Thanks for that !Mancuso
The way you have written is not more beneficial than doc. Can you plz elaborate the steps?Tryptophan
This Works! Been searching for a way to achieve this.Cyclopentane

© 2022 - 2025 — McMap. All rights reserved.