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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message