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

manage.py inspectdb with jsonb #5

Closed
carlcarl opened this issue Jul 29, 2015 · 7 comments
Closed

manage.py inspectdb with jsonb #5

carlcarl opened this issue Jul 29, 2015 · 7 comments

Comments

@carlcarl
Copy link

Hi,

In my postgresql DB, I have a jsonb field in table:

article_json | jsonb  | not null

And I use ./manage.py inspectdb, the result is:

article_json = models.TextField()  # This field type is a guess.

I think it should be something like JSONField ?

@yjmade
Copy link
Owner

yjmade commented Jul 29, 2015

upgrade to 0.0.16, it has been addressed

@yjmade yjmade closed this as completed Jul 29, 2015
@carlcarl
Copy link
Author

Hi, I already used 0.0.16

I find out the problem is that I forgot to add 'django_pgjsonb' in INSTALLED_APPS. I think maybe it's need to add this step in README (?)

@yjmade
Copy link
Owner

yjmade commented Jul 29, 2015

应该是不需要加到INSTALLED_APPS里面的.
你加了以后就正常了吗?
我这没有加也是工作的

@carlcarl
Copy link
Author

是的

以下是我的環境:

Python 3.4.3(virtualenv), (PostgreSQL) 9.4.4

pip freeze:
Django==1.8.3
django-debug-toolbar==1.3.2
django-pgjsonb==0.0.16
psycopg2==2.6.1
sqlparse==0.1.16

@yjmade
Copy link
Owner

yjmade commented Jul 29, 2015

我还没有在python3下面测试过,可能会有问题吧,等我试试看

@yjmade
Copy link
Owner

yjmade commented Jul 29, 2015

我知道了,我的django项目里面已经引用了django_pgjsonb, 所以jsonb字段的映射就被注入了,但是你的项目可能没有在任何地方引用过django_pgjsonb, 所以就没有找到jsonb的映射.
插入到INSTALLED_APP是个办法,其他随便找个地方 import django_pgjsonb也是可以的

@carlcarl
Copy link
Author

喔喔,了解,感謝你的回覆。

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