예제 #1
0
파일: commands.py 프로젝트: allieus/askbot3
def save_object_description(request):
    """if object description does not exist,
    creates a new record, otherwise edits an existing
    one"""
    obj = get_db_object_or_404(request.POST)
    text = request.POST['text']
    if obj.description:
        request.user.edit_post(obj.description, body_text=text)
    else:
        request.user.post_object_description(obj, body_text=text)
    return {'html': obj.description.html}
예제 #2
0
파일: commands.py 프로젝트: allieus/askbot3
def save_object_description(request):
    """if object description does not exist,
    creates a new record, otherwise edits an existing
    one"""
    obj = get_db_object_or_404(request.POST)
    text = request.POST['text']
    if obj.description:
        request.user.edit_post(obj.description, body_text=text)
    else:
        request.user.post_object_description(obj, body_text=text)
    return {'html': obj.description.html}
예제 #3
0
파일: commands.py 프로젝트: allieus/askbot3
def load_object_description(request):
    """returns text of the object description in text"""
    obj = get_db_object_or_404(request.GET)  # askbot forms utility
    text = getattr(obj.description, 'text', '').strip()
    return HttpResponse(text, content_type='text/plain')
예제 #4
0
파일: commands.py 프로젝트: allieus/askbot3
def load_object_description(request):
    """returns text of the object description in text"""
    obj = get_db_object_or_404(request.GET)  # askbot forms utility
    text = getattr(obj.description, 'text', '').strip()
    return HttpResponse(text, content_type='text/plain')