You can'n change it via django directly. https://docs.djangoproject.com/en/1.5/ref/databases/#collation-settings this link is django collation-settings notes. and http://dev.mysql.com/doc/refman/5.0/en/charset-column.html this shows how to change the collation in mysql.
2013/5/11 Parin Porecha <[email protected]> > Yes, I forgot to mention > I am running Django 1.5, with database MySQL > > So, how can I change the COLLATE pattern through Django's model fields ? > If not via Django, can you show me how to change it manually ? > > > On Sat, May 11, 2013 at 1:19 PM, Joey Chang <[email protected]> wrote: > >> What's your database engine? >> As i know, if your database engine was mysql, and the database's >> COLLATE pattern name ends with "_ci" which means case-insensitive. you >> should got that result. >> You can change the COLLATE pattern to the name which ends with "_cs" or >> "_bin". >> Wish it's useful to you >> >> >> >> 2013/5/11 Parin Porecha <[email protected]> >> >>> UPDATE: >>> >>> On changing the user, it gets saved successfully. >>> So, the problem is with the object.name >>> >>> I want to save both the objects. How can I do so ? >>> >>> >>> On Sat, May 11, 2013 at 12:48 PM, Parin Porecha >>> <[email protected]>wrote: >>> >>>> Hi, >>>> >>>> This is my model - >>>> >>>> class Tag(models.Model): >>>> user = models.ForeignKey(get_user_model()) >>>> name = models.CharField(max_length = 300) >>>> color = models.CharField(max_length = 10) >>>> icon = models.CharField(max_length = 50) >>>> >>>> class Meta: >>>> unique_together = ("user", "name") >>>> >>>> def __unicode__(self, ): >>>> return self.name >>>> >>>> The problem I am facing is - >>>> I made 2 Tag objects = >>>> 1) Tag(user = jon, name = 'man') >>>> 2) Tag(user = jon, name = 'Man') >>>> >>>> The first gets saved, but while saving the second, I am getting the >>>> error - >>>> IntegrityError: (1062, "Duplicate entry '2-Man' for key 'user_id'") >>>> >>>> I deleted the database, created it again and ran 'syncdb'. Still, I am >>>> getting the same error. Is this because of unique_together ? >>>> How can I bypass this ? >>>> >>>> Thanks, >>>> Parin >>>> >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Django users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at http://groups.google.com/group/django-users?hl=en. >>> For more options, visit https://groups.google.com/groups/opt_out. >>> >>> >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/django-users?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/django-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.

