My DEF is not displaying on the Admin Form??
Hello,
My DEF is not displaying on the Admin Form.
models.py =
class OurProducts(models.Model):
code = models.CharField(max_length=60)
price = models.DecimalField (max_digits=8, decimal_places=2)
def combined_price(self):
from decimal import Decimal
return round(self.price * Decimal(0.65),2)
admin.py =
class OurProductsAdmin(admin.ModelAdmin):
readonly_fields= ('combined_name',)
fieldsets = [
(None, {'fields': ['code', 'price',
'combined_price']}),
]
list_display = ('combined_price' ,'code', 'price')
The 'combined_price' show fine in my list_display, but the
'combined_price' does not show in the admin.form.
Thanks for any help!
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home