On 8 déc, 19:21, germ <mitch.german...@gmail.com> wrote:
> > The point is that utf8 can use up to 3 bytes per character...
>
> i appreciate your reply. interesting distinction between bytes and
> chars.

Been here, done that :-/

> i think i still need some more guidance. still not sure how to
> resolve with your suggestion to consdier the character set.

Well, my suggestion wrt/ charset is to use utf-8 everywhere (os,
shells, source codes, templates and all text files, databases, default
encoding for Apache, etc) - but this won't obviously solve your
problem !-)

> just looking for a simple way to specify a url field in models.py that
> will allow creation with django 1.1.1 syncdb and mysql 5.0.67. want
> this url text/char field to be as large as permitted and unique.

IE won't accept urls longer than 2083 characters IIRC - and a 2083
characters urls is neither very practical nor something you meet
everyday. Also, as Karen said, a unique index on a 2000+ characters
field might not be such a good idea - at least depending on how you're
using it.

Anyway... There's at least one workaround I can think of that imply a
little denormalization: using a text field for the url - without
uniqueness constraint -, and storing the hash() value (or some md5 sum
or like) of the url in another field, this one with a unique
constraint. The hash or md5 would be computed in the model save()
method. This is not totally dry and not as robust as a real unique
constraint on the url field itself, but that's the better solution I
can come with.




> thanks all for your time and assistance!

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to