Files
WYGIWYH/app/apps/currencies/admin.py
Herculino Trotta 50b0c6ce01 initial commit
2024-09-26 11:00:40 -03:00

12 lines
388 B
Python

from django.contrib import admin
from apps.currencies.models import Currency
@admin.register(Currency)
class CurrencyAdmin(admin.ModelAdmin):
def formfield_for_dbfield(self, db_field, request, **kwargs):
if db_field.name == "suffix" or db_field.name == "prefix":
kwargs["strip"] = False
return super().formfield_for_dbfield(db_field, request, **kwargs)