#7750: TextField in unique_together
------------------------------+---------------------------------------------
 Reporter:  benjaoming        |       Owner:  nobody    
   Status:  new               |   Milestone:            
Component:  Database wrapper  |     Version:  SVN       
 Keywords:  unique_together   |       Stage:  Unreviewed
Has_patch:  0                 |  
------------------------------+---------------------------------------------
 I get this exception:

 {{{
 _mysql_exceptions.OperationalError: (1170, "BLOB/TEXT column 'text' used
 in key specification without a key length")
 }}}

 I'm not quite sure about what's the right thing to do. Apparently a text
 field can't be used in key combinations in MySQL and probably neither in
 other SQL flavors. So maybe Django should raise an exception and/or the
 documentation should include which kinds of fields that are valid for the
 unique_together meta attribute.

 An example could be:

 {{{
 class Messages(models.model)
     subject = models.CharField(max_length=20)
     msg = models.TextField

     class Meta:
          unique_together = ("subject", "msg")
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7750>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to