Saturday, March 31, 2012

Re: integer array in django models

On Sat, 31 Mar 2012 18:27:56 +0530, dummyman dummyman
<> declaimed the following in

> Which model field in django is used to represent an integer array in mysql ?

To my knowledge: NONE

So far as I recall, MySQL does not have an extended data type
"array". Neither do most normal relational database engines (the only
one I know that does have an array type is PostgreSQL, and that probably
goes back to the preSQL PostGres days).

Representation of an array is done by normalizing the data. Instead
of one table (relation)
ID, someDiscrete, {an, array, of, values}
you create two tables by normalization
ID, someDiscrete
ID, foreignID, optionalIndex, value
x, someDiscrete
m, x, 1, an
m+1, x, 2, array
m+3, x, 3, of
m+4, x, 4, values
Wulfraed Dennis Lee Bieber AF6VN HTTP://

You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment