Another option is to solve this server side since you should be checking it's valid there too.
When the "concept" event is dragged onto the day, send the Ajax request to the server to update the "concept" event's date, if it's not valid, call revertFunc()
to put the event back.
eventDrop: function(event, dayDelta, minuteDelta, allDay,
revertFunc, jsEvent, ui, view) {
$.post("/concep_update/", { id: event.id, delta: dayDelta },
function(data) {
if(data!="true") {
revertFunc();
}
}, "text"});
}
On the server, check that there is a "meeting" event on the same day, and if so, update the "concept" event and return "true", otherwise, return "false".
@require_POST @login_required
def concept_update(request):
concept = get_object_or_404(Concept.objects.all(),
id=int(request.POST.get("id","0")))
concept.date = concept.date + timedelta(days=int(request.POST.get("delta","0")))
meetings = Meeting.objects.filter(date=concept.date)
if meetings.count() > 0:
concept.save()
return HttpResponse("true", status=200, content_type="text/plain")
else:
return HttpResponse("false", status=200, content_type="text/plain")