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

Import models.py does not retain ForeignKey relations #65

Open
rajeshlal opened this issue Mar 23, 2019 · 3 comments
Open

Import models.py does not retain ForeignKey relations #65

rajeshlal opened this issue Mar 23, 2019 · 3 comments

Comments

@rajeshlal
Copy link

Thanks for the great tool!

When I import a models.py from a previously exported project to make updates/additions, the ForeignKey relationships between models are not retained.

@FluxIX
Copy link

FluxIX commented Jun 21, 2019

I have also experienced this.

@FluxIX
Copy link

FluxIX commented Jun 21, 2019

I looked a little into this. In the ModelParserFactory, the field regular expression (^([a-zA-Z0-9_]+)\ \=\ ([a-zA-Z0-9._]+)[\(](.*)[\)]$) does not match the generated relationships because the regular expression expects the entire relationship to be on a single line and the generated relationships cover multiple lines.

@andymc100
Copy link

I tried putting the foreign keys into one line but still not getting recognised.

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

3 participants