The way I'd solve this example is to create a unique constraint/index in
the DB. The session check gives a quick pre-check, but in the event of a
race the DB enforces absolute consistency.
If the constraint isn't possible or is too complex, then your "SELECT...
FOR UPDATE" belongs on the check for
Maybe I'm misunderstanding, but tablespace has to do with physical storage
of the schema, not how tables are named. What you really want is a
db_schema_name or something. I think this long, old ticket is related
https://code.djangoproject.com/ticket/6148
On Tue, Sep 17, 2019 at 10:27 AM Christian
I usually just use dumpdata/loaddata to do these kinds of things.
On Fri, Jun 10, 2016 at 12:47 PM, Bruno Ribeiro da Silva <
bruno.dev...@gmail.com> wrote:
> Hey guys, I'm not sure if I should be asking this here, but it's related
> to django internals.
>
> I have this idea to create a command th
Do you expect your background threads to be equivalent to or greater than
the number of requests you're normally servicing? Usually background tasks
are much less frequent than the web requests, so a little overhead w/r/t
database connections isn't even going to be noticed.
Looking at what Django
I'm still a bit confused. What is the advantage of having connections
closed automatically when the thread exits? It seems to me that you can
quickly solve your problem by modifying your thread start routines:
from django.db import connection
from contextlib import closing
def my_thread_start():
Is there a good reason to do this with your own custom thread pool
management inside Django and (I'm assuming) WSGI? Celery is a well
understood solution to the problem of background tasks and has a really
nice API.
On Wed, Jun 1, 2016 at 5:34 PM, Cristiano Coelho
wrote:
> Let me start saying so
I guess you could! I'm not as familiar with the Transforms API, but it
looks like it would work too.
On Wed, Mar 30, 2016 at 6:17 PM, Shai Berger wrote:
> On Tuesday 29 March 2016 05:07:14 Stephen J. Butler wrote:
> > Why not do this in the database? Create a view with an extra co
Why not do this in the database? Create a view with an extra column that is
called "field_dttxt" that is to_char(field, 'Mon DD, '). Then add this
as a field to Django and let it use the normal Q lookups.
On Mon, Mar 28, 2016 at 5:13 PM, Michael E wrote:
> I don't know if this is possible, b
On Sun, May 24, 2015 at 6:28 AM, anentropic wrote:
> Currently there is a problem (correct me if wrong) when you need to override
> the content of an inner nested block.
>
> {% block parent %}
> some stuff
> {% block child %}
> child stuff
> {% endblock %}
> some other stuff
> {% endb
This is part of the database collation, and as I understand the Django
docs it's not something Django handles internally. It's something you
set/tweak inside your database.
What database are you using? On MySQL the docs say to set a column
collation. On Oracle I believe you can change the NLS_SORT
On Tue, Feb 3, 2015 at 1:39 PM, Aymeric Augustin
wrote:
> Le 3 févr. 2015 à 16:54, Jon Dufresne a écrit :
>> Assuming this MITM already has the correct CSRF value, what is
>> stopping this MITM from adding a REFERER to the HTTPS request?
>
> While MITM of HTTP is trivial, MITM of HTTPS isn't poss
On Fri, Jul 4, 2014 at 4:42 PM, Jon Dufresne wrote:
> Suppose I have the following models:
>
> ---
> class Container(models.Model):
> pass
>
> class Item(models.Model):
> container = models.ForeignKey(Container)
> previous = models.ForeignKey('self', null=True)
> current = models.
12 matches
Mail list logo