We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
model_schema = ModelSchema.objects.create(name="SimpleModel") related_model_schema = ModelSchema.objects.create(name="RelatedModel") FieldSchema.objects.create( name="related", model_schema=model_schema, class_name="django.db.models.ForeignKey", kwargs={ "to": another_model_schema.model_name, "on_delete": models.CASCADE, "related_name": "parent_objects", }, ) model = model_schema.as_model() related_model = related_model_schema.as_model() related_instance = related_model.objects.create() model_instance = model.objects.create(related=related_instance) related_instance.parent_objects
AttributeError: "parent_objects" does not exist
Call related_model_schema.as_model() before `model_schema.as_model(). This works for some reason
related_model_schema.as_model()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Steps to Reproduce
AttributeError: "parent_objects" does not exist
Workaround
Call
related_model_schema.as_model()
before `model_schema.as_model(). This works for some reasonThe text was updated successfully, but these errors were encountered: