how can I give this class a label which is shown in the backend instead of "EditedAddress"?
class EditedAddressAdmin(admin.ModelAdmin):
list_display = ('comp_name','fam_name', 'fon')
search_fields = ['fam_name','comp_name']
admin.site.register(EditedAddress,EditedAddressAdmin)
verbose_name is a human-readable name for the field. If the verbose name isn't given, Django will automatically create it using the field's attribute name, converting underscores to spaces. This attribute in general changes the field name in admin interface.
One of the most powerful parts of Django is the automatic admin interface. It reads metadata from your models to provide a quick, model-centric interface where trusted users can manage content on your site. The admin's recommended use is limited to an organization's internal management tool.
The default templates used by the Django admin are located under the /django/contrib/admin/templates/ directory of your Django installation inside your operating system's or virtual env Python environment (e.g. <virtual_env_directory>/lib/python3. 5/site-packages/django/contrib/admin/templates/ ).
The Django admin application can use your models to automatically build a site area that you can use to create, view, update, and delete records. This can save you a lot of time during development, making it very easy to test your models and get a feel for whether you have the right data.
You can adjust the way your model name is displayed by adding a verbose_name and/or verbose_name_plural to your model:
class EditedAddress(models.Model):
class Meta:
verbose_name = 'Edited Address'
verbose_name_plural = 'Edited Addresses'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With