I am trying to customize StockRecordForm
in django-oscar administration. What I have:
- Forked
dashboard
app, alsocatalogue_dashboard
- Included new
StockRecord
attribute inmodels.py
- Updated
forms.py
like this:
JavaScript
x
13
13
1
from oscar.apps.dashboard.catalogue import forms as base_forms
2
3
class StockRecordForm(base_forms.StockRecordForm):
4
5
6
class Meta(base_forms.StockRecordForm.Meta):
7
fields = [
8
'partner', 'partner_sku',
9
'price_currency', 'price',
10
'num_in_stock', 'low_stock_threshold', 'new_attribute',
11
]
12
13
Part of my INSTALLED_APPS
looks like this:
JavaScript
1
5
1
#'oscar.apps.dashboard.apps.DashboardConfig',
2
#'oscar.apps.dashboard.catalogue.apps.CatalogueDashboardConfig',
3
'mikeapps.dashboard.apps.DashboardConfig',
4
'mikeapps.dashboard.catalogue.apps.CatalogueDashboardConfig',
5
But modification is not showing up. Is there anything else I should modify?
Advertisement
Answer
Allright, I am surprised that in this case I have to actually modify template to show the new fields (unlike ProductForm
etc.), I presumpted that all chosen attributes will be shown in forms automatically, but I was wrong.