def new_comment(request, key): target = db.get(key) try: isAjax = request.REQUEST['isAjax'] returnurl = None except: try: returnurl = request.REQUEST['returnurl'] except: returnurl = None return create_object(request, form_class=CommentForm, extra_fields = {'author': User.get_current_user(), 'target': target}, extra_context = locals(), post_save_redirect = returnurl )
def new_article(request): return create_object(request, form_class=ArticleForm, extra_fields = {'author': User.get_current_user()})