-
Notifications
You must be signed in to change notification settings - Fork 53
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
Empty Identifiers for nullable ForeignKeyFields #44
Comments
This is missing from the current implementation, but it would definitely make sense to add it. The "Ignore this Column" option works by letting the user set the identifier value to if ident and ident.value:
if ident.value == "__null__":
record[field_name] = None
else:
record[field_name] = ident.value |
Maybe I am missing something obvious here, but there does not seem to be a way to import data which contains "empty" foreign key references to a nullable foreign key field?
Here is a screenshot of what I am talking about:
Here the foreign key is to a "part category". An "empty" value in the identifier cannot be mapped to a "null" or "ignore" value. It appears that I am forced to select from an existing "category" - even though the model field in question is nullable.
The text was updated successfully, but these errors were encountered: