- django/Model . . . . 3 matches
다대다 관계는 좀더 복잡해질 수 있다. 두 모델 사이에 관계에 해당하는 테이블이 또다른 속성이 필요한 경우이다. 이 때는 중간 역할을 하는 모델을 직접 생성하고 양쪽 모델을 참조하도록 만든다. 다음은 RiskReport와 ControlReport사이 다 대 다 관계에서 보고된 위험에 대해서 대처 방안이 적절했는지 평가하는 is_vaild속성을 가지는 RiskControl모델을 보여주고 있다.
class ControlReport(models.Model):
control_report= models.ForeignKey(ControlReport)
- django/RetrievingObject . . . . 2 matches
c = ControlReport.objects.get(id=1)
c = ControlReport.objects.select_related().get(id=1)
select report_controlreport.content
from report_controlreport, report_department_employees
and report_department_employees.employee_id = report_controlreport.reporter_id
Found 2 matching pages out of 7555 total pages (5000 pages are searched)
You can also click here to search title.