On Sun, 2008-10-12 at 08:55 -0700, mrsource wrote:
> I have defined an abstract Model with some fields:
> 
> class Componente(models.Model):
>     name = models.CharField(max_length=80,unique=True)
>     description = models.TextField(blank=True)
>     class Meta:
>         abstract = True
> 
> and then in the derived class I would to define verbose_name property
> for some field of the super Model:
> 
> class Pagina(Componente):
>     # Stuff to set verbose_name of fileds "name" and "description "
>     class Meta:
>         verbose_name = 'Pagina statica'
>         verbose_name_plural = 'Pagine statiche'
> 
> I have tried to put some stuff in __init__ function with no success...

You can't really do this without diving deep into the internals of the
model creation stuff. Which means you should probably be questioning the
approach. If the name and description aren't the same every time, then
it's not a common piece of data and doesn't really belong in the
abstract base class. Abstract base classes are for data that is the same
in every subclass.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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