Re: Change Local Memory Cache to Use LRU #28977

2018-01-04 Thread Josh Smeaton
To lend some weight to this, I've implemented an LRU loc mem cache and have done some benchmarking. There are some graphs in the readme: https://github.com/kogan/django-lrucache-backend - which I've written a little about

Re: Sealing or locking QuerySets -- a suggestion to prevent surprise N+1 queries.

2018-01-04 Thread Josh Smeaton
I wasn't aware of this new feature Shai, thanks for pointing it out! For this particular case I'd prefer locking to be bound to a particular queryset rather than the database as a whole. I would also expect it to fail loudly when accessing a non-fetched related object (book.author), which can

Re: Sealing or locking QuerySets -- a suggestion to prevent surprise N+1 queries.

2018-01-04 Thread charettes
Shai, `execute_wrapper` can be useful to prevent any queries from happening at all but I believe there's merit in wanting to prevent objects retrieved from a queryset from executing ghost queries during manipulations of the returned `Model` instances while allowing other unrelated queries to be

Change Local Memory Cache to Use LRU #28977

2018-01-04 Thread Grant Jenks
Hi all-- Long time user, first time poster, here. Thank you all for Django! The current local memory cache (locmem) in Django uses a pseudo-random culling strategy. Rather than random, the OrderedDict data type can be used to implement an LRU eviction policy. A prototype implementation is

Re: UnicodeDecodeError at /manager/procesar_csv/ 'utf8' codec can't decode byte 0xd1 in position 0: invalid continuation byte

2018-01-04 Thread Adam Johnson
This mailing list is for the development of Django itself, not for support. Use the django-users mailing list for that, or IRC #django on freenode, or a site like Stack Overflow. On 4 January 2018 at 16:01, Hernán Darío Zapata Villa wrote: > Good morning everybody > > I have

UnicodeDecodeError at /manager/procesar_csv/ 'utf8' codec can't decode byte 0xd1 in position 0: invalid continuation byte

2018-01-04 Thread Hernán Darío Zapata Villa
Good morning everybody I have a mistake about the encondnig with utf8 with a csv file , when select the file and public them, django shows this mistake: UnicodeDecodeError at /manager/procesar_csv/ 'utf8' codec can't decode byte 0xd1 in position 0: invalid continuation byte guys, how can fix

Re: [contrib.staticfiles] Change verbosity level of collectstatic command's outputs

2018-01-04 Thread Aymeric Augustin
Hello, The ticket tracker wasn't _obviously_ the wrong place :-) but the mailing list is a better way to draw the attention of many people to an issue that requires discussion. I agree that the default logging is needlessly verbose and that's annoying. Printing information about every file

[contrib.staticfiles] Change verbosity level of collectstatic command's outputs

2018-01-04 Thread Tanguy Nodet
This is a repost of this ticket , which was obviously in the wrong place. I have a suggestion concerning the logging of the *collectstatic *command. Presently, with the default verbosity level (1), individual information on each copied or linked

Re: Sealing or locking QuerySets -- a suggestion to prevent surprise N+1 queries.

2018-01-04 Thread Adam Johnson
1. I don't think the seal API on the QuerySet is enough, there are other ways implicit queries can be triggered without a QuerySet, e.g. Book(author_id=1).author . Shai's suggestion of using a query execution blocker is probably the best approach. If you were really worried you could even