have a study.
On 8月21日, 下午6时56分, patrickk <[EMAIL PROTECTED]> wrote:
> you could use modelforms,
> seehttp://www.djangoproject.com/documentation/modelforms/
>
> or without modelforms:
>
> class MyForm(forms.Form):
>
> def __init__(self, user, *args, **kwargs):
> self.user = user
>
you could use modelforms, see
http://www.djangoproject.com/documentation/modelforms/
or without modelforms:
class MyForm(forms.Form):
def __init__(self, user, *args, **kwargs):
self.user = user
super(MyForm, self).__init__(*args, **kwargs)
...
define your fields her
Thanks for your reply,
save() got an unexpected keyword argument 'commit' as I didn't define
commit in my save function... where did u get this commit=False from?
Grtz,
G.
On Thu, Aug 21, 2008 at 12:41 PM, patrickk <[EMAIL PROTECTED]> wrote:
>
> try this:
> form.save(commit=False)
> form.auto
try this:
form.save(commit=False)
form.autor = request.user
form.save()
On Aug 21, 12:24 pm, "Genis Pujol Hamelink" <[EMAIL PROTECTED]>
wrote:
> Hello,
>
> I'm trying to pass a the id of the user logged in to a form field, but it
> doesn't seem to work... any ideas / suggestions?
>
> Thanks in ad
Hello,
I'm trying to pass a the id of the user logged in to a form field, but it
doesn't seem to work... any ideas / suggestions?
Thanks in advance :)
Here are the view, model and form objects:
View:
def punts_form3(request):
if request.method == 'POST':
form = form_punt
5 matches
Mail list logo