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

Column Translations in read_frame #86

Open
FalseProtagonist opened this issue Sep 15, 2017 · 0 comments
Open

Column Translations in read_frame #86

FalseProtagonist opened this issue Sep 15, 2017 · 0 comments

Comments

@FalseProtagonist
Copy link

A common use case (I'm guessing, since that's what I'm doing) is to:
Define models => do operations in dfs => save back down as models

This is kind of fiddly because of the column translations when dealing with fk columns.
read_frame(verbose = False) returns an _id suffix for the pk, and not for the fks
but Model(**kwargs) requires an _id suffix for the pk and also for the fks

So there's this translation that's happening that I either circumvent or do some fiddling to undo, the origin is the line:

fieldnames = [f.name for f in fields]

I'm wondering whether a default of:

fieldnames = [f.attname for f in fields]

might make more sense, although it's easy enough to wrap this and pass those fieldnames in. I'm curious whether there's a deeper reason for the current default.

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

1 participant