Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文章分类 #10

Open
n37r06u3 opened this issue May 24, 2014 · 3 comments
Open

文章分类 #10

n37r06u3 opened this issue May 24, 2014 · 3 comments

Comments

@n37r06u3
Copy link

如果 class Category 定义在Post的下面

south的时候 会出现
NameError: name 'Category' is not defined

建议加引号
po_type = models.ForeignKey('Category', verbose_name=u'文章分类', blank=True, null=True)

@wwq0327
Copy link
Owner

wwq0327 commented May 24, 2014

这里我不是太明白,我在跑代码的时候,是没这个问题的呀。

@n37r06u3
Copy link
Author

你的 models 文件
https://github.com/wwq0327/djwebapp-blog/blob/master/djblog/blog/models.py

Category 是在Post上面的

我开始的时候定义顺序写反了 所以报错了
最好还是用字符串吧

@wwq0327
Copy link
Owner

wwq0327 commented May 24, 2014

我现在写的,都是我自己的用法,你说那种用法我没用过,所以我也没考虑到。

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

No branches or pull requests

2 participants