{{{
class CacheModel(models.Model):
@classmethod
def get_model_related_fields(cls):
return cls._meta.related_objects
}}}
I have noticed that this method returns different values when I run from
the Django `shell` and from the request. For example:
- From the shell
{{{
(<OneToOneRel: ai_api.leadextradata>, <ManyToOneRel: ai_api.leadsubitv>,
<ManyToOneRel: ai_api.attachment>, <ManyToOneRel: ai_api.leadnote>,
<ManyToOneRel: ai_api.sharingcandidate>, <OneToOneRel:
ai_api.employmentdata>, <OneToOneRel: ai_api.leadshortcodekeyword>,
<OneToOneRel: ai_api.leadschedulingsettings>, <OneToOneRel:
ai_api.employeeonboarding>, <ManyToOneRel: ai_api.leadschedulemessage>,
<OneToOneRel: ai_api.itvteam>, <ManyToOneRel:
ai_kb.clienttrainingmessage>, <OneToOneRel:
ai_reminders.convoreminderaudit>, <ManyToOneRel:
ai_campaign.campaigncontact>, <ManyToOneRel:
ai_ratings.ratingconversation>, <ManyToOneRel: ai_ratings.ratingresponse>,
<ManyToOneRel: ai_event.eventcandidate>, <ManyToOneRel:
ai_event.eventcandidatecheckin>, <OneToOneRel: ai_event.eventitvlead>,
<OneToOneRel: ai_event.eventregistration>, <OneToOneRel:
ai_event.eventregistrationschedulingsettings>, <ManyToOneRel:
ai_journeys.leadjourneyprogress>, <ManyToOneRel: ai_jobs.appliedjob>,
<ManyToOneRel: ai_alerts.leadwatcher>, <ManyToOneRel:
ai_conversation_flows.leadconvoflow>, <ManyToOneRel:
ai_conversation_flows.leadconvostage>, <ManyToOneRel: ai_meeting.meeting>,
<ManyToOneRel: ai_interview_prep.itvprepcandidate>, <ManyToOneRel:
ai_recorded_interview.recordeditvcandidate>, <ManyToOneRel:
ai_candidate_attributes.candidateattributes>, <ManyToOneRel:
ai_cms.dynamiccontentcandidate>, <OneToOneRel:
ai_candidate_profile.previousapplication>, <ManyToOneRel:
ai_candidate_profile.previousapplication>, <ManyToOneRel:
ai_conversations.conversationstage>, <ManyToOneRel:
ai_conversations.leadsatisfycondition>, <ManyToOneRel:
ai_conversations.leadvalidanswer>)
}}}
- From the request
{{{
(<OneToOneRel: ai_api.leadextradata>, <ManyToOneRel: ai_api.leadsubitv>,
<ManyToOneRel: ai_api.attachment>, <ManyToOneRel: ai_api.leadnote>,
<ManyToOneRel: ai_api.sharingcandidate>, <OneToOneRel:
ai_api.employmentdata>, <OneToOneRel: ai_api.leadshortcodekeyword>,
<OneToOneRel: ai_api.leadschedulingsettings>, <OneToOneRel:
ai_api.employeeonboarding>, <ManyToOneRel: ai_api.leadschedulemessage>,
<OneToOneRel: ai_api.itvteam>, <ManyToOneRel:
ai_kb.clienttrainingmessage>, <OneToOneRel:
ai_reminders.convoreminderaudit>, <ManyToOneRel:
ai_campaign.campaigncontact>, <ManyToOneRel:
ai_ratings.ratingconversation>, <ManyToOneRel: ai_ratings.ratingresponse>,
<ManyToOneRel: ai_event.eventcandidate>, <ManyToOneRel:
ai_event.eventcandidatecheckin>, <OneToOneRel: ai_event.eventitvlead>,
<OneToOneRel: ai_event.eventregistration>, <OneToOneRel:
ai_event.eventregistrationschedulingsettings>, <ManyToOneRel:
ai_journeys.leadjourneyprogress>, <ManyToOneRel: ai_jobs.appliedjob>,
<ManyToOneRel: ai_alerts.leadwatcher>, <ManyToOneRel:
ai_conversation_flows.leadconvoflow>, <ManyToOneRel:
ai_conversation_flows.leadconvostage>, <ManyToOneRel: ai_meeting.meeting>,
<ManyToOneRel: ai_interview_prep.itvprepcandidate>, <ManyToOneRel:
ai_recorded_interview.recordeditvcandidate>, <ManyToOneRel:
ai_candidate_attributes.candidateattributes>, <ManyToOneRel:
ai_cms.dynamiccontentcandidate>, <OneToOneRel:
ai_candidate_profile.previousapplication>, <ManyToOneRel:
ai_candidate_profile.previousapplication>, <ManyToOneRel:
ai_conversations.conversationstage>, <ManyToOneRel:
ai_conversations.leadsatisfycondition>, <ManyToOneRel:
ai_conversations.leadvalidanswer>, <ManyToOneRel:
ai_cms.intentcmsresponselogs>)
}}}
We have one more model `<ManyToOneRel: ai_cms.intentcmsresponselogs>` in
the request.
--
Ticket URL: <https://code.djangoproject.com/ticket/33259>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Tim Graham):
Hi, you'll have to debug the issue and explain why Django is at fault or
at least provide some minimal code to reproduce the issue.
--
Ticket URL: <https://code.djangoproject.com/ticket/33259#comment:1>
* status: new => closed
* resolution: => needsinfo
Comment:
Also, Django 3.0 is no longer supported so you need to reproduce this
issue with Django's `main` branch.
--
Ticket URL: <https://code.djangoproject.com/ticket/33259#comment:2>