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

Exclude field from depths (nested relation) on create_schema function #756

Closed
Abdoulrasheed opened this issue Jul 29, 2023 · 0 comments
Closed

Comments

@Abdoulrasheed
Copy link

Is there a way to exclude a field from a nested relation using the create_schema function? Or is there another way to generate a schema that excludes a field from a nested relation?

Consider the following models:

class Allergy(models.Model):
    name = models.CharField(max_length=100)
    
class Profile(models.Model):
    allergies = models.ManyToManyField(Allergy, blank=True, null=True)

ProfileInput = create_schema(
    Profile,
    depth=1,
    exclude=["allergies__id"] # I want something like this or allergies.id
    )

Is there a way to do this at the moment using create_schema or some other means?

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