On 19 avr, 12:45, ashwoods <[EMAIL PROTECTED]> wrote:
> ah, i code for english, german, spanish. :)
>
>  but as far as i know, the encoding declaration is only needed if you
> have special chars in _code_ as opposed to strings. your strings can
> be unicode without having to declare an encoding for the python file.
>
> my opinion is that if you can, you should even choose model names,
> function names, etc.. not only without special chars, but also in
> english, even more so in the opensource world. the part that the user
> "sees" can be translated using verbose name, or I18N.
>
> using english and no funky chars ensures that your code works well for
> others too. i always use snippets of code from here or there. just
> imagine how much work  and time i would need just to understand the
> code if everybody writes code in their language, or if i use other
> code as libraries with classes in different encodings...

I agree on the principle.

In my case, how would you implement this ?

class Civilstate(models.Model):
    CIVILITY_CHOICES = (
         ('single', 'Célibataire'),
         ('taken', 'Marié'),
    )
    who = models.ForeignKey(User, unique=True,
verbose_name='Personne')
    street = models.CharField('Adresse 1', maxlength=100)
    street_bis = models.CharField('Adresse 2', maxlength=100)
    zipcode = models.IntegerField('Code postal', maxlength=5)
    city = models.CharField('Ville', maxlength=100)
    phone = models.CharField('Téléhone', maxlength=20)
    mobile = models.CharField('Portable', maxlength=20)
    civility = models.CharField('Statut matrimonial', maxlength=20,
choices=CIVILITY_CHOICES)
    birthdate = models.DateField('Date de naissance',)
    children = models.IntegerField('Nombre d\'enfants',)

I'm really interested in getting good/best practices :-)

Regards,
Nicolas


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