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)