I finally got it working without using formfield callbacks, I used the
"Modifying it Inline" portion of your post, thx for all of the help.
Here is a snipped in case it helps anyone else,
@staff_member_required
def add_edit_customer(request, id=None):
if id is None:
CustomerEntryForm
Yes, I found your post a while back, that is where I am learning most
of this, great post. I tried this and got
'ModPythonRequest' object has no attribute 'customer'
I think i am close though, here is my code:
else:
IssueEntryForm = forms.form_for_model(Issue,
fields=('issue''customer
> Thanks for the reply I tried using the method you described and
> searched the __init__.py, but just couldnt make any sense of it,
>
> def my_callback(field, **kwargs):
> if f.name == 'customer':
>return f.formfield(formfclass=forms.HiddenInput)
Since you're receiving the fi
Thanks for the reply I tried using the method you described and
searched the __init__.py, but just couldnt make any sense of it,
def my_callback(field, **kwargs):
if f.name == 'customer':
return f.formfield(formfclass=forms.HiddenInput)
gives me
global name 'f' is not defined
On Fri, 2007-12-21 at 06:48 -0800, mike wrote:
> Sorry if I was unclean, I just discovered this and I am still learning
> newforms, I am using forms.form_for_model and trying to get two form
> to display in my template, only 1 is a foreign key that I used
> edit_inline with my model, I am trying
The issues model is a foreign key to my customer model.
On Dec 21, 10:40 pm, mike <[EMAIL PROTECTED]> wrote:
> Thank you for your reply, I did as you suggested but when I save the
> form I get the error
>
> (1048, "Column 'customer_id' cannot be null") customer_id, being the
> 'id' field of the
The issues model is a foreign key to my customer model.
On Dec 21, 10:40 pm, mike <[EMAIL PROTECTED]> wrote:
> Thank you for your reply, I did as you suggested but when I save the
> form I get the error
>
> (1048, "Column 'customer_id' cannot be null") customer_id, being the
> 'id' field of the
Thank you for your reply, I did as you suggested but when I save the
form I get the error
(1048, "Column 'customer_id' cannot be null") customer_id, being the
'id' field of the customer model,
if request.method == 'POST':
form1 = IssueEntryForm(request.POST)
if form1.is_valid(
Ahh! That helps. Sorry, I haven't ever used form_for_model() and
didn't recognize that IssueEntryForm in the original post was NOT a
form instance. Corrections embedded below.
On Dec 21, 8:48 am, mike <[EMAIL PROTECTED]> wrote:
> Sorry if I was unclean, I just discovered this and I am still l
Sorry if I was unclean, I just discovered this and I am still learning
newforms, I am using forms.form_for_model and trying to get two form
to display in my template, only 1 is a foreign key that I used
edit_inline with my model, I am trying to get the 'customer' field of
my issue to be hidden and
On Dec 20, 2:58 pm, mike <[EMAIL PROTECTED]> wrote:
> anyone know how to auto assign a variable to my form field?
>
> IssueEntryForm.base_fields['customer'].widget = widgets.HiddenInput()
> IssueEntryForm.base_fields['customer'].widget = HELP
I'm not sure I understand the question; what exactly d
11 matches
Mail list logo