Re: Change class name in Admin interface

2007-02-16 Thread Nebojša Đorđević

* Matias wrote, On 06.02.2007 05:36:
> Hi,
> 
> I've a class named "Category", but this application must be in
> Spanish, so I need it to be displayed on the Admin interface as
> "Categoria". ¿how can I accomplish that?
> 
> Here is the model definition:
> 
> class Category(models.Model):
>   name = models.CharField('Nombre',maxlength=40)
>   description = models.CharField('Descripción',maxlength=250)
>   def __str__(self):
> return self.name
>   class Admin:
> pass

 class Meta:
verbose_name = 'Categoria'
verbose_name_plural = 


-- 
Nebojša Đorđević - nesh, ICQ#43799892
Studio Quattro - Niš - Serbia
http://studioquattro.biz/ | http://trac.studioquattro.biz/djangoutils/
Registered Linux User 282159 [http://counter.li.org]


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Change class name in Admin interface

2007-02-07 Thread Dirk Eschler

On Mittwoch, 7. Februar 2007, Dirk Eschler wrote:
> Do you already use Django's i18n support? In this case you can mark the
> verbose_name and verbose_name_plural strings as translateable. Then
> create-messages.py will find it when executed the next time.

It's "make-messages.py" not "create-messages.py", sorry.

-- 
Dirk Eschler 
http://www.krusader.org

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Change class name in Admin interface

2007-02-07 Thread Dirk Eschler

On Dienstag, 6. Februar 2007, Matias wrote:
> Hi,
>
> I've a class named "Category", but this application must be in
> Spanish, so I need it to be displayed on the Admin interface as
> "Categoria". ¿how can I accomplish that?
>
> Here is the model definition:
>
> class Category(models.Model):
>   name = models.CharField('Nombre',maxlength=40)
>   description = models.CharField('Descripción',maxlength=250)
>   def __str__(self):
> return self.name
>   class Admin:
> pass

Do you already use Django's i18n support? In this case you can mark the 
verbose_name and verbose_name_plural strings as translateable. Then 
create-messages.py will find it when executed the next time.

# -
from django.utils.translation import gettext_lazy as _

class Category(models.Model):
[...]
class Meta:
verbose_name = _('Category')
verbose_name_plural = _('Categories')
# -

See http://www.djangoproject.com/documentation/i18n/ for details about 
Django's i18n support.

Best Regards,
Dirk Eschler

-- 
Dirk Eschler 
http://www.krusader.org

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Change class name in Admin interface

2007-02-07 Thread Ramiro Morales

Matías,

On 2/6/07, Matias <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've a class named "Category", but this application must be in
> Spanish, so I need it to be displayed on the Admin interface as
> "Categoria". ¿how can I accomplish that?
>
> Here is the model definition:
>
> class Category(models.Model):
>   name = models.CharField('Nombre',maxlength=40)
>   description = models.CharField('Descripción',maxlength=250)
>   def __str__(self):
> return self.name
>   class Admin:
> pass
>

See,

http://www.djangoproject.com/documentation/model_api/#verbose-name

Example:

class Pais(models.Model):
nombre = models.CharField(maxlength=50)
[...]
class Meta:
verbose_name = 'país'
verbose_name_plural = 'paises'

Regards,

PS: You could alsa name the model Categoria instead of Category,
but in this special case (as it's also true with Pais)
it woud be missing the accented i.

-- 
 Ramiro Morales

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Change class name in Admin interface

2007-02-07 Thread Matias

Hi,

I've a class named "Category", but this application must be in
Spanish, so I need it to be displayed on the Admin interface as
"Categoria". ¿how can I accomplish that?

Here is the model definition:

class Category(models.Model):
  name = models.CharField('Nombre',maxlength=40)
  description = models.CharField('Descripción',maxlength=250)
  def __str__(self):
return self.name
  class Admin:
pass


Thanks everybody.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---