My friend and I had made changes to same branch, he pushed onto it and after sometime I tried to do the same but I got. but I got error saying :
error: failed to push some refs to '<repo_name>'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., …Run Code Online (Sandbox Code Playgroud) 运行rebuild_index时,来自其他应用程序的对象正在被索引,但在一个应用程序上发生SearchFieldError。
这是我的相关应用程序的 models.py :
class Doctor(models.Model):
SPECIALTY_CHOICES = (
('Pediatric Physiotherapist', 'Pediatric Physiotherapist')
)
user = models.OneToOneField(User, null=True, blank=True, on_delete=models.CASCADE)
doctorName = models.CharField(max_length=100)
doctorQual = models.CharField(max_length=500)
doctorSpecial = models.CharField(choices=SPECIALTY_CHOICES, default='', max_length=50)
doctorSummary = models.CharField(max_length=1000)
doctorLocation = models.CharField(max_length=100, default=' ', null=True, blank=True)
slug = models.SlugField(null=True, blank=True)
city = models.CharField(max_length = 100, null=True, blank=True)
def __str__(self):
return self.doctorName
# save method overridden to generate slug for each object
def save(self, *args, **kwargs):
self.slug = slugify(self.doctorName)
super(Doctor, self).save(*args, **kwargs)
def get_absolute_url(self):
return "/doctor/doc_detail_page/%i" …Run Code Online (Sandbox Code Playgroud) 很难使用jquery / ajax删除对象。我已经实现了一个表,该表的行包含约会模型中的对象列表。每行中都有一个删除按钮。
对象表的模板为:
<table class="table table-striped table-bordered table-list">
<thead>
<tr>
<th><em class="fa fa-cog"></em></th>
<th class="hidden-xs">ID</th>
<th>Patient Name</th>
<th>Day</th>
<th>Time</th>
<th>Location</th>
</tr>
</thead>
<tbody>
{% for appointment in appointments %}
<tr>
<td align="center">
<button class="delete_button" id="{{ appointment.id }}">
<em class="fa fa-trash"></em>
</button>
</td>
<td>1</td>
<td class="hidden" id="appointment_id">{{ appointment.id }}</td>
<td>{{ appointment.patient }}</td>
<td>{{ appointment.day }}</td>
<td>{{ appointment.time }}</td>
<td>{% if appointment.clinic %}
{{ appointment.clinic }}
{% endif %}
{% if appointment.hospital %}
{{ appointment.hospital }}
{% endif %}
</td>
</tr> …Run Code Online (Sandbox Code Playgroud)