hi All:
I'm getting crazy with this little thing.
1)I override StockRecord by adding a new attribute like
/apps/partner/models.py
class StockRecord(AbstractStockRecord):
num_in_stock_default = models.PositiveIntegerField(
_("Number in stock default value"), blank=True, null=True)
make migration and very sure this has been added to database.
2)I add this new attribute to StockRecordForm
apps/dashboard/catalogue/forms.py
class StockRecordForm(CoreStockRecordForm):
'partner', 'partner_sku',
'price_currency', 'price_excl_tax', 'price_retail', 'cost_price',
'num_in_stock', 'num_in_stock_default', 'low_stock_threshold',
3)change the template to show this attribute.
templates/dashboard/catalogue/product_update.html
<td>{% include "dashboard/partials/form_field.html" with field=stockrecord_form.num_in_stock_default nolabel=True %}</td>
finally, I get failure with nothing render for this attribute. the html generated for this attribute like this:
<div class="form-group ">
<div class="">
</div>
</div>
anything wrong or missed??
and i try to find out in templates/oscar/dashboard/partials/form_field.html and guess it get something wrong within 'render_field'.
but unfortunately, I found little info with this tag. what is 'render_field'?
{%else%} |
| {% render_field field class+="form-control" %} |
| {% endif %} |
BR//Jasper