def coursemember_create(request, course_id): course = get_object_or_404(Course, pk=course_id) form_class = CourseMemberCreateForm#PreProcessForm(CourseMemberCreateForm, lambda form:form.limit_to_course(course)) return create_object(request, model=CourseMember, form_class=form_class, template_name='courses/coursemember_create.html', extra_context={'course':course}, initial={'course':course.pk}, preprocess_form=lambda form:form.limit_to_course(course))
def expensegroup_create(request, course_id): course = get_object_or_404(Course, pk=course_id) return create_object(request, model=ExpenseGroup, form_class=ExpenseGroupForm, template_name='courses/expensegroup_create.html', extra_context={'course':course}, initial={'course':course.pk})
def course_create(*args, **kwargs): return create_object(*args, **kwargs)
def building_create(*args, **kwargs): return create_object(*args, **kwargs)
def lector_create(*args, **kwargs): return create_object(*args, **kwargs)
def lector_contract_create(request, lector_id): lector = get_object_or_404(Lector, pk=lector_id) return create_object(request, model=Contract, form_class=ContractForm, initial={'lector':lector.pk}, inlines=LECTOR_INLINES, extra_context={'lector':lector})
def student_create(*args, **kwargs): return create_object(*args, **kwargs)
def company_create(*args, **kwargs): return create_object(*args, **kwargs)