Hi,
I think yes, Otherwise database will raise an integrity error, like
Foreign key violates the not null constraint.
*--Laxmikant* *G.*
On Tue, Oct 2, 2012 at 12:51 PM, Keir Lawson wrote:
> Thanks for your reply :-)
>
> So there's no way to use a model form to proccess the quest and manual
Thanks for your reply :-)
So there's no way to use a model form to proccess the quest and manually
set just the FK of it?
Keir
On Tuesday, October 2, 2012 6:18:21 AM UTC+1, Laxmikant Gurnalkar wrote:
>
> Sorry, see again!!
>
> def payments_view(request, contact_id):
> payment = Payment()
>
Sorry, see again!!
def payments_view(request, contact_id):
payment = Payment()
contact = contact.objects.filter(id=contact_id)
if contact:
payment.contact = contact[0]
payment.save()
I dont think you are looking for this kind of thing :
cheers
On Tue, Oct 2, 2012
def payments_view(request, contact_id):
payment = Payment()
payment.contact = contact[0]
rctx = RequestContext(request,{
> 'contact': contact, 'payments': payments, 'form' : PaymentForm()
> })
> return render_to_response('CRMSite/contact_payments.html',rctx)
>
On Tue,
Sorry if this is a dumb question, just picking up Django.
I've set up a payments form, to create payments associated with a contact
(see payments model) however I'm having trouble figuring out how to save
the payment with the relevant contact associated, as the contact isnt
selected as part of
5 matches
Mail list logo