The related_name of ForeignKey cannot be Unicode name after Django 1.8

129 views
Skip to first unread message

Cheng-Hung Hsueh

unread,
Jun 22, 2015, 11:28:50 AM6/22/15
to django...@googlegroups.com
This code can run before django 1.7
But "related_name" got an error after django 1.8

使用者表.來源: (fields.E306) The name '使用者' is invalid related_name for field 使用者表.來源


class 來源表(models.Model):
    名 = models.CharField(max_length=100)

class 使用者表(models.Model):
    來源 = models.OneToOneField(來源表, related_name='使用者', primary_key=True, null=False)


Is it a bug? I know adding many checks in Django 1.8

Tim Graham

unread,
Jun 22, 2015, 12:30:48 PM6/22/15
to django...@googlegroups.com
It looks like the check added in ticket #22064 may be too strict (only allowing alphanumeric characters in related_name). Would you like to open a ticket?

Cheng-Hung Hsueh

unread,
Jun 22, 2015, 10:20:00 PM6/22/15
to django...@googlegroups.com
I have posted in https://code.djangoproject.com/ticket/25016#ticket .

Tim Graham於 2015年6月23日星期二 UTC+8上午12時30分48秒寫道:
Reply all
Reply to author
Forward
0 new messages