I have an AbsrtractBase class mode with a class Meta and I want it in such
a way that a user when setting up can be able to update or change the
verbose_name in the Meta class is this possible?
what I have so far
class AbstractBase(models.Model):
......
custom_name = models.CharField(blank=True)
def update_verbose_name(self, custom_name):
try:
if self.custom_name is not None:
return self.custom_name
else:
self.custom_name = self.__class__.__name__
return self.custom_name
except Exception as error:
return str(error)
class Meta(object):
abstract = True
verbose_name = self.custom_name
but the issue is that I cannot access the self.custom name variable
is there any other solution that I can achieve what I'm intending to do
--
You received this message because you are subscribed to the Google Groups
"Django developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/1a5161b4-0501-4917-b605-e2d3a2d7dc6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.