ALL

Having a separate first name and last name field is a horrible way of
doing names. Many many names have three parts to it, furthermore last
name should better be refered to as 'surname' or family name.

Then if you look internationally how the names of the chinese and
other cultures work the firstname/lastname assumption is grossly
wrong. I recommend you have one field called 'full_name' in which a
user can type in his full name.

Then when doing a search for 'John' you can, (using full text search
on mysql), throw out all results that contain John.


Furthermore if you create an additional fullname field that is auto-
updated in the django code you will have to duplicate this into all
other programs altering the state of the record. This is a major
enterprise implication especially where multiple languages are used. I
recommend you use stored procedures to do this instead.

A field can only be normalised where the components are well defined
such as a date. A date has elements year, month, day, time zone, day
light savings adjustments. However due to cultural differences and no
standard a full name of someone has variable and unknown elements.

Regards
David

On Jun 11, 6:32 pm, Adam <[EMAIL PROTECTED]> wrote:
> I was actually thinking to myself "There must be some way to auto-
> populate a full_name field when I create the object." but I didn't
> think to override the save method.  Shows you how much I still need to
> learn; thanks for the tip!
>
> -Adam
>
>
>
> > The SimplestThinkThatCouldPossiblyWork (while certainly not the
> > smartest) would be to add a full_name field to the Contact model,
> > hidden in the admin, and autopopulated from the first_name and
> > last_name fields whenever the Contact instance is saved. This last
> > point can be adressed overriding the save() method of the Contact
> > model, ie
>
> >    def save(self):
> >        self.full_name = "%s %s"  % (self.first_name, self.last_name)
> >        super(Contact, self).save()
>
> > HTH- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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