-
Notifications
You must be signed in to change notification settings - Fork 46
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
One to Many, Many to Many #16
Comments
Those features would be quite nice, and I would love to see them implemented! I'm having a hard time finding time to dedicate to this project at the moment though. PRs are welcome! |
ok. So sounds like conceptually this is doable within the current framework of django-dynamic-models. Is the right way to do this by adding a new DATA_TYPE in FieldFactory and the associated implementation? |
Yea, it should be doable. There are other considerations that need to be taken into account for these fields though compared to the simpler data types. |
@virtualbrown any progress on implementing Foreign Key? Is adding a new DATA_TYPE right way to do this? |
@macieyn
|
Hi @rvinzent I want to work on this feature. Would you please tell me what are the considerations that need to be taken into account for these fields? |
HI @adavoudi thanks for your interest! I have been struggling to find the time to implement some of these features. There are a few things that might make this a bit challenging given the current architecture. The kwargs for generated I think there is a more proper refactoring we can do that should allow any field class (including custom fields) to be used. Instead of storing the The new class FieldSchema(models.Model):
name = models.CharField(max_length=63)
model_schema = models.ForeignKey(ModelSchema, on_delete=models.CASCADE, related_name="fields")
class_name = models.TextField()
kwargs = models.JSONField(default=dict) The new factory implementation should first import the field class by passing Let me know if you have any questions, and if you're not up for the task I will do my best to prioritize this :) |
@rvinzent Great tips. I will work on this and ask for your guides if needed. |
Can you please explain how can i use new field schema, because documentation is not updated yet |
Thoughts on supporting Foreign Key field and many to many fields?
The text was updated successfully, but these errors were encountered: