ForeignKey field access appears to be lazy evaluated

2013-07-12 Thread Sebastian Haase
Hello, I've implemented a tree-like structure in my model. My items have foreign key fields to the respective left and right neighbor. If I'm now trying to move an item one position forward it appears that the assigning of neighbors gets messed up. In my example I have an initial item order like

CsrfViewMiddleware removes other cookies

2013-09-13 Thread Sebastian Haase
ft. If I comment out request.META["CSRF_COOKIE_USED"] = True in csrf.py -> get_token(request) it also works for me. Any help or comments appreciated, Thanks, Sebastian Haase -- You received this message because you are subscribed to the Google Groups "Django users" group. To uns

Fix docs for model.save() with update_fields specified and auto_now field in model

2019-03-25 Thread Sebastian Haase
Hi, in section "Specifying which fields to save" (https://docs.djangoproject.com/en/dev/ref/models/instances/#specifying-which-fields-to-save) it reads that `update_fields` can be specified mostly for performance benefits... However, I found that regarding a field with "auto_now=True" there is

Re: Fix docs for model.save() with update_fields specified and auto_now field in model

2019-03-25 Thread Sebastian Haase
There are of course stackoverflow postings -e.g. https://stackoverflow.com/questions/17474057/enforce-auto-now-when-using-saveupdate-fields - is almost 6 years old. On Monday, March 25, 2019 at 4:30:57 PM UTC+1, Sebastian Haase wrote: > > Hi, > in section "Specifying which

Re: Fix docs for model.save() with update_fields specified and auto_now field in model

2019-03-28 Thread Sebastian Haase
if it did not exist, the given value is ignored, and the current time is used instead ... very strange if you ask me... Cheers, Sebastian On Mon, Mar 25, 2019 at 4:34 PM Sebastian Haase wrote: > There are of course stackoverflow postings -e.g. > https://stackoverflow.com/questions/17

Will asgi become a PEP like wsgi is ?

2017-03-11 Thread Sebastian Haase
Hi, wsgi is specified by PEP 333 -- Python Web Server Gateway Interface v1.0 https://www.python.org/dev/peps/pep-0333/ Django channels rely on asgi instead. So far ASGI specs appear only here: http://channels.readthedocs.io/en/stable/asgi.html How do these two concepts compare in regards to thei

Django Channels: long running async function and where to save ORM object

2018-07-15 Thread Sebastian Haase
Hi, I'm still in the process of migration from channels 1 to channels 2... One thing I'm interested in is related to [ http://channels.readthedocs.io/en/latest/one-to-two.html#application-instances ] """ASGI applications are now instantiated once per socket and can use local variables on self t

Re: Django Channels: long running async function and where to save ORM object

2018-07-16 Thread Sebastian Haase
om > doing these as random orphaned tasks launched from web processes - there's > no provision in the server to track that task and clean up after it. > Instead, I'd recommend running those kinds of tasks in a separate process. > > Andrew > > On Sun, Jul 15, 2018 at 2:03

Racing condition with pre_delete

2021-04-25 Thread Sebastian Haase
I often run into a bug when the client triggers multiple http requests resulting each in a delete. My objects have a „sibling index“ field, where I use pre_delete to update all siblings „above“ to lower their index by 1 (using update with an F-expression). Any idea why this would not work reliab