On Jul 6, 4:05 pm, AllenDang <[email protected]> wrote:
> I want to create a localized admin site, for example, I created models
> like below shows:
>
> class Inventory(models.Model):
>     price = models.PositiveIntegerField()
>     quantity = models.PositiveIntegerField()
>
> Then in my admin.py, I created a admin model for it like below:
>
> class InventoryAdmin(admin.ModelAdmin):
>     list_display = ("price", "quantity")
>
> And in the end of admin.py, I register the admin model like this:
>
> admin.site.register(Inventory, InventoryAdmin)
>
> OK, now I want to show a localized name of "InventoryAdmin", and it's
> fields "price" and "quantity" in admin site, how to do that? Is it
> possible to do so?

All of this is easily possible. Just use the `verbose_name` argument
in the field definitions, and mark the string for translation -
similarly, you can use translatable `verbose_name` and
`verbose_name_plural` strings in the model's inner Meta class.
--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to