Re: cache middleware on multi sites...

2012-06-26 Thread sergey
I create my own slightly changed cache middleware (replace get_full_path to build_absolute_uri) http://macrotoma.blogspot.com/2012/06/custom-multisite-caching-on-django.html четверг, 19 ноября 2009 г., 13:16:52 UTC+2 пользователь jens написал: > > There exist some "intersection" on multi site i

Django Templates and BOM (byte order marks)

2006-12-08 Thread Sergey Kirillov
Greetings, While researching strange IE behaviour at some pages of my Django-powered site I've found that Django does not handle BOM marks correctly. For instance I have following templates (!UTF_8_BOM! = EF BB BF): --- base.html !UTF_8_BOM!http://www.w3.org/TR/html4/loose.dtd";> blah-blah-blah

Re: Django Templates and BOM (byte order marks)

2006-12-09 Thread Sergey Kirillov
James Bennett написав: > On 12/8/06, Sergey Kirillov <[EMAIL PROTECTED]> wrote: > > For instance I have following templates (!UTF_8_BOM! = EF BB BF): > > Sort of off-topic, but why are you using a BOM in UTF-8? ;) Well, I'm not ;) But I had few legacy templates cre

Django ORM

2007-02-04 Thread Sergey Kirillov
Greetings, I'd like to ask, why Django ORM has no concept of Identity Map? It is strange for me that if I call get() five times I will get five object instances, instead of five references to a single instance. Was it a design decision? I'm unable to find any discussions of this. Or I'm the firs

Site object in django.contrib.contenttypes.views.shortcut

2009-05-16 Thread Sergey Belov
, Sergey Belov --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email

Yaml serializer output

2021-12-26 Thread Sergey Fursov
everal different pyyaml versions (from 6.0 down to 5.1.2). Do I miss something or it is a valid issue for opening a ticket? Thanks, Sergey Fursov -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. T

Re: Yaml serializer output

2021-12-27 Thread Sergey Fursov
produces a different output than provided in docs воскресенье, 26 декабря 2021 г. в 22:21:42 UTC+3, Sergey Fursov: > Hi there, > > Before opening a ticket I would like to discuss my problem here. > > Django docs say: > > ``` > YAML¶ <https://docs.djangoproject.com/en/4.0

Re: Yaml serializer output

2021-12-29 Thread Sergey Fursov
/15250 > > On Mon, 27 Dec 2021 at 08:13, Sergey Fursov wrote: > >> Please, disregard the part about failing tests, I had an old version >> locally without this commit applied >> https://github.com/django/django/commit/a57c783dd4e6dc73847081221827a1902eede88b >>

Re: Feature request: get_first_or_404

2017-11-28 Thread Sergey Fedoseev
IMO it shouldn't be added to Django because the same thing can be done in one line: get_object_or_404(qs[:1]), but we could add such using to get_object_or_404() docs. On Wednesday, November 29, 2017 at 3:41:54 AM UTC+5, Piotr Domański wrote: > > Currently we have get_object_or_404 and get_list_

ease patching Django object behavior in another django packages

2018-01-10 Thread Sergey Glazyrin
Hello guys! I faced a situation when auth backend needs access to request object inside of get_user auth backend function https://code.djangoproject.com/ticket/29005 I can patch it following way (function to be patched is django.contrib.auth.get_user) def get_user(request): > .. > code

Re: ease patching Django object behavior in another django packages

2018-01-10 Thread Sergey Glazyrin
Hello Tom Thank you for your reply Let me explain the situation again Openstack auth doesn't use django models at all, it uses keystoneauth authorization logic And this logic requires some data from request to recognize user https://github.com/openstack/horizon/blob/master/openstack_auth/backend

Re: ease patching Django object behavior in another django packages

2018-01-10 Thread Sergey Glazyrin
So, I want just to improve design of django to simplify it in future. But again, I respect django developers opinion and it's up to you :) середа, 10 січня 2018 р. 19:00:56 UTC+1 користувач Sergey Glazyrin написав: > > Hello Tom > Thank you for your reply > Let me explain the si

Re: ease patching Django object behavior in another django packages

2018-01-10 Thread Sergey Glazyrin
derstanding something couldn’t > you call ‘auth_user.create_user_from_token’ yourself and set it on the > request object rather than monkeypatch Django? > > On 10 January 2018 at 12:22:01, Sergey Glazyrin (sergey.gl...@gmail.com > ) wrote: > > Hello guys! > I faced a situat

Re: ease patching Django object behavior in another django packages

2018-01-10 Thread Sergey Glazyrin
signature of the > authentication backend get_user() method, that would remove the need for > monkey patching. We did a similar change for the authenticate() method [1], > I'm not sure if there would be consensus to make the change. > > [1] https://code.djangoproject.com/tic

Re: ease patching Django object behavior in another django packages

2018-01-10 Thread Sergey Glazyrin
hange for the authenticate() method [1], > I'm not sure if there would be consensus to make the change. > > [1] https://code.djangoproject.com/ticket/25187 > > On Wednesday, January 10, 2018 at 1:12:55 PM UTC-5, Sergey Glazyrin wrote: >> >> Btw, I see no way how do I use

Re: ease patching Django object behavior in another django packages

2018-01-10 Thread Sergey Glazyrin
onkey patching. We did a similar change for the authenticate() method [1], >> I'm not sure if there would be consensus to make the change. >> >> [1] https://code.djangoproject.com/ticket/25187 >> >> On Wednesday, January 10, 2018 at 1:12:55 PM UTC-5, Sergey Glazy

Re: ease patching Django object behavior in another django packages

2018-01-10 Thread Sergey Glazyrin
ectly onto the instance could cause some issues, for example > if there is already a user property. I guess this could be detected and a > deprecation warning issued though. > > Anyway, this is all academic unless there is consensus. > > On 10 Jan 2018 19:00, "Sergey Gl

Re: ease patching Django object behavior in another django packages

2018-01-10 Thread Sergey Glazyrin
= request return obj середа, 10 січня 2018 р. 20:13:06 UTC+1 користувач Sergey Glazyrin написав: > > ok, let me know if there would be any consensus and I'll change my > solution according to maintainers consensus. > > середа, 10 січня 2018 р. 20:10:46 UTC+1 користувач Tom Forbe

Re: ease patching Django object behavior in another django packages

2018-01-15 Thread Sergey Glazyrin
hello guys! I added a new changeset to reflect what we discussed here Please check it out. https://github.com/django/django/compare/master...sergeyglazyrindev:master середа, 10 січня 2018 р. 21:02:41 UTC+1 користувач Sergey Glazyrin написав: > > or we can add a simple builder helper

Re: PostgreSQL Partial Indexes package

2018-11-17 Thread Sergey Fursov
Hi everyone, In our company, we also use the ability to define our own indexes, but with the current implementation of base Index class, we basically need to copy several methods entirely from it. What do we want is implement UNIQUE indexes with the UPPER function wrapper around field names [1]. T

proposal: add special subclass of ForeignKey for storing ContentTypes

2017-04-04 Thread Sergey Fedoseev
Hi all, Some time ago I created 'new feature` ticket and Tim Graham asked me to write here to get some feedback on the idea. So here it is. ContentType model is quite specific, so we could add the subclass of ForeignKey with some specific features.

Re: Exceptions in model._meta._property_names with some 3rd-pty libraries

2017-06-02 Thread Sergey Fursov
Hi everyone, I just want to mention here that in django-jsonfield repo proposed solution to solve this problem on third party side: https://github.com/dmkoch/django-jsonfield/issues/189. Maybe this is the better way. Thanks, Sergey 2017-06-03 0:02 GMT+03:00 Zack Voase : > Hi all, >

Signal-based cache invalidation & cached function decorator

2007-11-14 Thread Sergey Kirillov
Hi all In my project I frequently encountered a situation where I need to cache some data, and then invalidate it on signal. So I wrote following decorator: def cached(slot_name, timeout=None): def decorator(function): def invalidate(): cache.delete(slot_name) d

Re: Signal-based cache invalidation & cached function decorator

2007-11-14 Thread Sergey Kirillov
For shared cache backends, like Memcached it works fine. You just need to be sure that signal handlers will be registered in all processes (i.e. put them in models.py) On Nov 14, 4:20 pm, "Honza Král" <[EMAIL PROTECTED]> wrote: > On Nov 14, 2007 2:41 PM, Sergey Kirillov <[E

Re: Signal-based cache invalidation & cached function decorator

2007-11-19 Thread Sergey Kirillov
That's true. So, does it looks interesting for someone? Or I'm the only one who do signal-based cache invalidation? :) On Nov 15, 2:27 am, "Honza Král" <[EMAIL PROTECTED]> wrote: > On Nov 14, 2007 9:13 PM, Sergey Kirillov <[EMAIL PROTECTED]> wrote: > &