*Is there a thousand separator (like 1,000) for list_editable in django?
#model.py
class Product(models.Model):
deal_price = models.IntegerField(db_index=True, b
In case anybody also wants to display more big numbers:
Add to the default settings in the your settings file (e.g. settings.py):
USE_THOUSAND_SEPARATOR = True
Source
I haven't tested this, but I think you should be able to do:
class PersonAdmin(admin.ModelAdmin):
list_editable = ('foo_thousand',)
list_display = ('foo_thousand',)
def foo_thousand(self, instance):
return '{0:,}'.format(self.foo)
But then you will probably need to strip out the chars that are not digits before you save. You could do that in the save_model()
method.