django-blocks, django 1.1 and MySQL, for a change

1 view
Skip to first unread message

MJ Ray

unread,
Mar 31, 2010, 1:34:02 PM3/31/10
to django...@googlegroups.com
MySQL does not support unique or indexed character fields longer than
255 characters. Blocks has blocks.apps.aggregator.Feed.feed_url and
blocks.apps.aggregator.FeedItem.guid which are like that.

This causes a model validation error in Django 1.1 if used with MySQL
(as often happens).

As far as I can see, we'd have the same issue with the latest version
of django-blocks. Also, this is a theoretical problem with Django 1.0
but it just doesn't complain.

The fields are Feed.feed_url and FeedItem.guid. I'm wondering whether
it's reasonable to make them max_length=255, remove unique=True, or
what. I think max_length=255 is fine in most situations.

Is there a better fix?

Thanks for any feedback,
--
MJ Ray (slef) Webmaster and LMS developer at | software
www.software.coop http://mjr.towers.org.uk | .... co
IMO only: see http://mjr.towers.org.uk/email.html | .... op

kimus

unread,
Apr 2, 2010, 7:31:24 AM4/2/10
to django-blocks
I think the feed_url could be changed to not be unique and guid could
be changed be a 'compressed' (md5, sha1, etc) version of the url to a
less then 255 limit and fix this problem.

Can you do that and give me a patch?

On 31 Mar, 18:34, MJ Ray <m...@phonecoop.coop> wrote:
> MySQL does not support unique or indexed character fields longer than
> 255 characters.  Blocks has blocks.apps.aggregator.Feed.feed_url and
> blocks.apps.aggregator.FeedItem.guid which are like that.
>
> This causes a model validation error in Django 1.1 if used with MySQL
> (as often happens).
>
> As far as I can see, we'd have the same issue with the latest version
> of django-blocks.  Also, this is a theoretical problem with Django 1.0
> but it just doesn't complain.
>
> The fields are Feed.feed_url and FeedItem.guid.  I'm wondering whether
> it's reasonable to make them max_length=255, remove unique=True, or
> what.  I think max_length=255 is fine in most situations.
>
> Is there a better fix?
>
> Thanks for any feedback,
> --

> MJ Ray (slef)  Webmaster and LMS developer at     | softwarewww.software.coophttp://mjr.towers.org.uk       |  .... co

Reply all
Reply to author
Forward
0 new messages