Skip to content

get related object for all_objects  #75

@malinich

Description

@malinich

I have model

class Incident(PermanentModel):  
   petition = models.ForeignKey('Petition', related_name='incidents')  

class Petition(PermanentModel):
    .....

Now I need relate all objects

i = Incident.all_objects.get(pk=..)
i.petition  # <-- here in DB i have in WHERE clause ("petition"."removed" IS NULL)

I don't know how to solve this. In docs I no find the examples

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions