Skip to content

can the instance_of Q-object be made to accept a string? #505

Description

@johncronan

I have found that, in my base model class, I want to add a UniqueTogether to the constraints in the Meta, with a condition of the form:

~Q(instance_of=DerivedModel)

where DerivedModel is inheriting from this base class. Because of the inheritance, I have to define DerivedModel after this one, but that also means it's not yet defined for me to reference in the Meta class.

Can this Q-object be made to accept a string, as well? That's how other components, such as ForeignKey, deal with the same type of problem with circular dependency.

Or is there a solution here that I'm not thinking of?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions