views:

62

answers:

3

Hello,

Is it better to have 3 fields in django model, "first", "initial" and "last" or is it better to have "name" and put first name, last name and initial in the "name" field? If I put all three in one "name" field can I still search for last names?

I am asking because it will be easier to extract the "first, initial, last" from the scraped item.

Thanks

A: 

It's better to store the data in it's original form =D

(or close to the form you got it in as you can)

That being said... why not do both?

Jiaaro
+1  A: 

If you want to query for (or sort by) last names, it's probably better to use three separate fields.

mipadi
+2  A: 

one day you will want to sort people by last name and will have to split merged names manually because with many people there will be numerous "formats"

I had to go through this once with ~300 records - lot's of fun copy-pasting. Sometimes you won't even know which name is first and which is last.

So you'll save yourself a lot of work in the future by keeping names separate.

Evgeny
+1 for not having to reverse it later. Have fun trying to figure out names like Sally Anne E. O'Donnel.
Chase Seibert
Yeah and then you'll need to figure out how sort those - is it O or D? And what to do with names starting with accented characters.
Evgeny
Thanks. I decided to go with "firstName Initial" "last". So if there is an initial it will be together with the first name.
Zeynel