You are not logged in.

Change Language:

Freelancer? Consultant? Check out: WorkTrail - Time Tracking made easy
Profile for MikeKJ

Name MikeKJ
Email Address n/a
Posts1
  • saving in a view
    Board » Django » Views
    I have 2 models Count is purely an incremental counter a model called Sale, the reason for the Count models is to increment a reference for Sale and other models

    In a view I get the latest sale and count then I want to save the incemented count (number) to Count also save number to Sale

    customer = Sale.objects.all().order_by('-id').filter(email_address=email).distinct()0
    this = Count.objects.all().order_by('-id')0
    number = this.number + 1
    a = this.save(force_insert=True)
    ref = number
    reference = number
    name = customer.name
    salutation = customer.salutation
    b = customer.save(force_update=True)

    I know the field names are rubbish but can anyone spot where I am going wrong please


Powered by Sphene Community Tools