看看我的模型类
from django.db import models
from meeting.models import Meeting
# Create your models here.
class Agenda(models.Model):
name = models.CharField(max_length=255)
meeting = models.ForeignKey(Meeting, on_delete=models.PROTECT)
priority = models.IntegerField()
此处议程,课程需要外键会议班。如果导入Meeting类失败,是否可以执行Agenda类可以执行的操作。如果未找到会议类,则会创建默认会议对象。
答案 0 :(得分:0)
您可以有条件地执行此操作,但需要注意的是它可能会破坏并可能在服务器重新启动之间中断。
@media (max-width: 767px) { /*-- Change max-width from 768 to 767 --*/
.navbar-header {
float: none;
}
.navbar-toggle {
display: block;
}
.navbar-collapse {
border-top: 1px solid transparent;
box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}
/*.navbar-collapse.collapse {
display: none!important;
}*/ /*-- Disable this, suggest remove - this cause the menu disappear as soon as it toogle in --*/
.navbar-nav {
float: none!important;
margin: 7.5px -15px;
position:relative; /*-- New attribute --*/
z-index:9999; /*-- New attribute --*/
background-color:#393939; /*-- New attribute --*/
}
.navbar-nav>li {
float: none;
}
.navbar-nav>li>a {
padding-top: 10px;
padding-bottom: 10px;
}