Home > other >  After joining through=djangoManyToManyField, background display field
After joining through=djangoManyToManyField, background display field

Time:09-24

Add custom after the middle table, in the background management page, no task_depart this form, can you solve?

The class Notice (models. Model) :
"" "announcements "" "
Title=models. CharField (' title ', max_length=256)
User=models. ForeignKey (user, related_name='NOTICE_USER', verbose_name='release people' on_delete=models. The CASCADE)
The content=UEditorField (verbose_name='content',
Width='700',
Height='400',
='full' toolbars,
ImagePath='ueditor/images/',
FilePath='ueditor/files/',
Upload_settings={' imageMaxSizing: 1024000},
The default='
)
Task_depart=models. ManyToManyField (to=Department, verbose_name='remind', through='NoticeDepartTask', through_fields=(' notice ', 'depart))
Created=models. DateTimeField (' creation time, auto_now=True)

The class Meta:
Db_table='oa_notice'
"" "in descending order of time "" "
Ordering=[' - created]
Verbose_name='announcements'


The class NoticeDepartTask (models. Model) :
Notice=models. ForeignKey (notice, on_delete=models. The CASCADE)
Depart=models. ForeignKey (Department, on_delete=models. The CASCADE)
Taskstatus=models. CharField (' whether complete, max_length=4, choices=(
(' 0 ', 'unfinished'),
(' 1 ', 'completed')
), the default='0')
Modified=models. DateTimeField (' modification time, auto_now=True)
User=models. ForeignKey (user, on_delete=models. SET_NULL, null=True, blank=True)
  • Related