Skip to content

add on_delete variable to ForeignKey function and change unicode function to str in web/models.py#97

Open
M0RT3Z4K wants to merge 1 commit into
jadijadi:masterfrom
M0RT3Z4K:fix_for_python3
Open

add on_delete variable to ForeignKey function and change unicode function to str in web/models.py#97
M0RT3Z4K wants to merge 1 commit into
jadijadi:masterfrom
M0RT3Z4K:fix_for_python3

Conversation

@M0RT3Z4K
Copy link
Copy Markdown

سلام آقای جادی. من تو برنامه نویسی دیدم که توی پایتون 3 (و یا بقیه) یه متغیر on_delete توی تابع ForeignKey بیشتر لازم داره و اینکه تابع unicode توی نسخه های جدیدتر اسم رو روی اون خرج و یا اطلاعاتی که وارد مدل میکنیم، نمی ذاره و من اون رو به str تغییر دادم.

Comment thread web/models.py
date = models.DateTimeField()
amount = models.BigIntegerField()
user = models.ForeignKey(User)
user = models.ForeignKey(User,on_delete=models.CASCADE)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

مثلا در اینجا توی نسخه پایتون من ارور میداد و این متغیر رو میخواست

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant