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

feat: default value example working #16

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

markdoerr
Copy link
Collaborator

Working example for the default-value pull request: socotecio/django-socio-grpc#255

( Issue: Fix/default value #255 )

@AMontagu
Copy link
Collaborator

AMontagu commented May 6, 2024

Hello @markdoerr

We finally merge the defaults values (we blocked it for important internal release) as 0.22.0. You can now use this stable release on this MR and I can merge it

@markdoerr
Copy link
Collaborator Author

markdoerr commented May 6, 2024

Merci @AMontagu,
this is good news ;) - I already used a pre-release version (0.21.5).
There is one issue, left, which I would like to discuss with you:
When one uses an abstract model, then the ForeignKeys of child classes are not "inheriting" the correct properties:

Example: In
https://gitlab.com/LARAsuite/lara-django-base/-/blob/master/lara_django_base/models.py?ref_type=heads
I defined the ExtraDataAbstr model with two optional fields, data_type and media_type (which are both optional == blank=True and null=True).
When I subclass ExtraDataAbstr, the ForeignKey fields are generated as non-optional in the .proto file. This is not the case with optional ForeignKeys of non-abstract models.

Do you have an idea, why ? I guess it has something to do with the depth of recursion to explore the model structure in the .proto generator, or that it currently does not fully support abstract models.

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

Successfully merging this pull request may close these issues.

2 participants