Пример #1
0
def event_edit(request, id=None):
    id = request.POST.get('id') or id
    event, created = get_or_create_instance(Event, id=id)
    form = EventForm(request.POST or None, instance=event)

    if request.method == 'POST':
        return save_ajax_form(form)

    return render(request, 'event_modal.html', {'event': event, 'form': form})
Пример #2
0
def area_edit(request, id=None):
    id = request.POST.get('id') or id
    area, created = get_or_create_instance(FunctionalArea, id=id)
    form = FunctionalAreaForm(request.POST or None, instance=area)

    if request.method == 'POST':
        return save_ajax_form(form)

    return render(request, 'area_modal.html', {'area': area, 'form': form})
Пример #3
0
def event_edit(request, id=None):
  id = request.POST.get('id') or id
  event, created = get_or_create_instance(Event, id=id)
  form = EventForm(request.POST or None, instance=event)

  if request.method == 'POST':
    return save_ajax_form(form)

  return render(request, 'event_modal.html', { 'event': event, 'form': form })
Пример #4
0
def area_edit(request, id=None):
  id = request.POST.get('id') or id
  area, created = get_or_create_instance(FunctionalArea, id=id)
  form = FunctionalAreaForm(request.POST or None, instance=area)

  if request.method == 'POST':
    return save_ajax_form(form)

  return render(request, 'area_modal.html', { 'area': area, 'form': form })
Пример #5
0
def space_edit(request, id=None):
  id = request.POST.get('id') or id
  space, created = get_or_create_instance(Space, id=id)
  form = SpaceForm(request.POST or None, request.FILES or None, instance=space)

  if request.method == 'POST':
    return save_ajax_form(form)

  return render(request, 'space_modal.html', { 'space': space, 'form': form })
Пример #6
0
def space_edit(request, id=None):
    id = request.POST.get('id') or id
    space, created = get_or_create_instance(Space, id=id)
    form = SpaceForm(request.POST or None,
                     request.FILES or None,
                     instance=space)

    if request.method == 'POST':
        return save_ajax_form(form)

    return render(request, 'space_modal.html', {'space': space, 'form': form})