Beispiel #1
0
def get_formfield(request, obj, field):
    e = EventChangeFieldGenerator(request)
    content_type, obj = unparse_value(obj)

    # Get current value (don't process if an event will change before u or after)
    value = getattr(obj, field)
    fields = e.get_field(obj, field)
    t = fields_for_model(content_type.model_class())
    return HttpResponse(t[fields.name].widget.render(fields, value=value))
Beispiel #2
0
def get_list_object(request, obj):
    e = EventChangeFieldGenerator(request)
    content_type, obj = unparse_value(obj)
    return e.get_fields_with_obj(obj)
Beispiel #3
0
def get_list_content_type(request, content_type_id):
    e = EventChangeFieldGenerator(request)
    content_type = ContentType.objects.get(id=content_type_id)
    return e.get_objects_tree(content_type)