Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #83680

Re: Broken IF statement

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!backfill.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <maximesteisel@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'django.': 0.05; 'assigning': 0.09; 'assuming': 0.09; 'line:': 0.09; 'logic': 0.09; 'statements': 0.09; 'developer': 0.10; 'cc:addr:python-list': 0.11; 'suggest': 0.14; 'times,': 0.14; 'changes': 0.15; "(it's": 0.16; 'obj,': 0.16; 'subject:Broken': 0.16; 'sender:addr:gmail.com': 0.17; 'fix': 0.17; 'code.': 0.18; 'trying': 0.19; 'cc:addr:python.org': 0.22; 'exists': 0.24; 'non': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '&gt;': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'code': 0.31; 'supposed': 0.32; 'url:python': 0.33; 'created': 0.35; 'anybody': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'url:listinfo': 0.36; 'url:org': 0.36; 'changing': 0.37; 'url:mail': 0.40; 'even': 0.60; 'new': 0.61; 'to:addr:gmail.com': 0.65
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=ipNbGbvwnHvaN004WsbNdO3CBlpqx9C3szHpMm+lxVQ=; b=oLl1UUH3DxCtY6smSKpW364lSDEl5Gg0ZdtcFhaepybCx6e9hOwX6GqkGICmxxIJE8 pWoNAhG+OM0XagyKQ114NV8uMrdi5etwuefXKRkCn0B+bpA7tmg5y1YMXV7bfIMWRVsr PC/qxGO+TyeTrarp4ysH+ssm8SjjASdsYPItnbTw1DIbu4Nyp1BWlUnTdc3lI81LhKln aveHvwsJmWL9CF0eH9IINTN3otGtx5ZSAYOlemtXrTjhmyDCJDohBi0btb9QVgtOTHfn +9eDAyI2ybbnn5rFnwLjrOSzee8QlIRonnpTN+aZDVGn7t7OUILItY13pu0geWAeeyGf 9tMg==
X-Received by 10.52.33.242 with SMTP id u18mr17212731vdi.78.1421141483957; Tue, 13 Jan 2015 01:31:23 -0800 (PST)
MIME-Version 1.0
Sender maximesteisel@gmail.com
In-Reply-To <dd384c6d-17c0-4850-ad5b-6b073c80bdb8@googlegroups.com>
References <dd384c6d-17c0-4850-ad5b-6b073c80bdb8@googlegroups.com>
From Maxime S <maxischmeii@gmail.com>
Date Tue, 13 Jan 2015 10:31:03 +0100
X-Google-Sender-Auth BLx-3_m20due8yVsawgMroJsb48
Subject Re: Broken IF statement
To joboppsgpp@gmail.com
Content-Type multipart/alternative; boundary=20cf30780b4c53b3e9050c8549a3
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.17668.1421143058.18130.python-list@python.org> (permalink)
Lines 52
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1421143058 news.xs4all.nl 2926 [2001:888:2000:d::a6]:55294
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:83680

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

2015-01-12 22:19 GMT+01:00 <joboppsgpp@gmail.com>:
>
> https://bpaste.net/show/93be9e15634b <--- Line 19 through 22
>
> At all times, my program is assigning the object priority of 0, even if
one already exists in the database with a priority of 0 (it's supposed to
be assigning it a priority of 1 in those cases).
>
> I'm a non developer trying to fix a freelancer's code. Would anybody be
able to suggest changes to the IF logic that might be able to fix it,
assuming the statements in the code provided look flawed?
>
> Thanks...
> --
> https://mail.python.org/mailman/listinfo/python-list


This line:

obj, created = SocialAccount.objects.get_or_create(...)

suggest you are using Django. If it is the case you have to add obj.save()
after changing the priority to send the new value to the DB.

Best,

Maxime

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Broken IF statement joboppsgpp@gmail.com - 2015-01-12 13:19 -0800
  Re: Broken IF statement Chris Angelico <rosuav@gmail.com> - 2015-01-13 08:40 +1100
    Re: Broken IF statement joboppsgpp@gmail.com - 2015-01-12 13:55 -0800
      Re: Broken IF statement joboppsgpp@gmail.com - 2015-01-13 06:28 -0800
  Re: Broken IF statement Maxime S <maxischmeii@gmail.com> - 2015-01-13 10:31 +0100
    Re: Broken IF statement joboppsgpp@gmail.com - 2015-01-13 06:29 -0800

csiph-web