QuerySet.contains() for .values() and .values_list()

2021-01-13 Thread Johan Schiff
), so I have no real preference here. Johan -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubsc

Re: Implement QuerySet.__contains__?

2020-06-05 Thread Johan Schiff
should write: > > if obj in list(queryset): > > Which I understand is already working? Why does the first line (without > list()) should work anyway? > > And if users want performance, why not write: > > if queryset.filter(pk=obj.pk).exists(): > אורי > u...@speedy.net

Re: Implement QuerySet.__contains__?

2020-06-03 Thread Johan Schiff
efetched obj_first in qs: 0.030961711003328674 Prefetched obj_mid in qs: 6.6988333979970776 Prefetched obj_last in qs: 24.18991441695 Database obj_first exists(): 6.468764332996216 Database obj_mid exists(): 6.167532913001196 Database obj_last exists(): 6.0190791100030765 Le mer. 3 juin 2020 à 10:52,

Re: Implement QuerySet.__contains__?

2020-06-03 Thread Johan Schiff
to a topic in the > Google Groups "Django developers (Contributions to Django itself)" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/django-developers/NZaMq9BALrs/unsubscribe > . > To unsubscribe from this group and all its topics, send an ema

Implement QuerySet.__contains__?

2020-06-02 Thread Johan Schiff
use the "obj in queryset" syntax, believing it does "the right thing". //Johan -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop recei

Customizable urlize

2020-01-07 Thread Johan Schiff
autoescape=False, email_formatter: callable = None, url_formatter: callable = None, ): ... Johan Schiff Betahaus (SE) -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To un

RE: Tagging 1.4 django release in Subversion

2012-03-26 Thread Johan
h on svn checkout allows me to track my changes better, and upgrade them between releases. Johan From: django-developers@googlegroups.com [mailto:django-developers@googlegroups.com] On Behalf Of Florian Apolloner Sent: Monday, March 26, 2012 5:48 PM To: django-developers@googlegroups.com Subject

Re: How to create a new command in django-admin.py

2012-02-23 Thread Johan
Well I can think of a whole lot of ways in which this can be done 'better' :) ... But, I don't have the time to change django atm so I will have to live with it :) ... Thanks for the help ... On Feb 23, 4:14 pm, Tom Evans wrote: > On Thu, Feb 23, 2012 at 1:22 PM, Johan wro

Re: How to create a new command in django-admin.py

2012-02-23 Thread Johan
Nope there is not. I just thought it could be done as easily as for manage.py. Thanks On Feb 23, 4:13 pm, Jani Tiainen wrote: > 23.2.2012 15:22, Johan kirjoitti: > > > Hi > > > I know how to create a new command in manage.py, this link explains it > > nicely > >

How to create a new command in django-admin.py

2012-02-23 Thread Johan
application to the INSTALLED_APPS tuple? Regards Johan -- 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 to django-

Re: Trouble joining IRC

2010-02-12 Thread Johan
Got it! Thank you so much! Johan On Feb 12, 11:17 pm, Alex Gaynor wrote: > On Fri, Feb 12, 2010 at 11:14 PM, Johan wrote: > > Hello, > > > I am trying to log into the IRC channel at #django-dev but I kept on > > getting this error: > > >  #django-dev :Cannot j

Trouble joining IRC

2010-02-12 Thread Johan
to do before I can join the channel? I'm not sure what it means by "identified with services" also, I'm quite new to IRC, so perhaps it's something completely obvious that I overlooked? thank you for the trouble, Johan -- You received this message because you are subscr

Re: Bug in django\template\__init__.py ??

2009-10-29 Thread Johan
Thanks. This link is exactly what i need. On Oct 29, 5:07 pm, Waylan Limberg wrote: > On Thu, Oct 29, 2009 at 10:37 AM, Johan wrote: > > >  I am > > wanting to use the template engine outside the context of a django > > project so I would not have a settings file anywh

Re: Bug in django\template\__init__.py ??

2009-10-29 Thread Johan
Thanks for the quick reply. I discovered exactly what you said about 2 seconds after pressing the submit on my query. On Oct 29, 4:50 pm, Russell Keith-Magee wrote: > On Thu, Oct 29, 2009 at 10:37 PM, Johan wrote: > > > Hi. In django\template\__init__.py on line 54 there is a line

Bug in django\template\__init__.py ??

2009-10-29 Thread Johan
Hi. In django\template\__init__.py on line 54 there is a line of code : from django.conf import settings. Firstly there is no settings.py file in django\conf, ther is however a file called global_settings.py. In my context the is issue is fxed by changing the line to from django.conf import global

Re: Django, initial data and custom SQL

2009-02-12 Thread Johan Bergström
but understand the Way of Django and fully respect that. This patch is the result. Just for reference, this is what I think should be done for an optimal workflow: * create table * create m2m * run custom data * run fixtures * run indexes * emit "database done" signal This way, you can

Re: Django, initial data and custom SQL

2009-02-11 Thread Johan Bergström
On Feb 10, 5:07 pm, Johan Bergström wrote: > Hey, > > On Feb 10, 4:51 pm, "ludvig.ericson" wrote: > > > > > > > On Feb 10, 1:13 pm, Johan Bergström wrote: > > > > Since Django executes my custom SQL before creating indexes, it's >

Re: Django, initial data and custom SQL

2009-02-10 Thread Johan Bergström
Hey, On Feb 10, 4:51 pm, "ludvig.ericson" wrote: > On Feb 10, 1:13 pm, Johan Bergström wrote: > > > Since Django executes my custom SQL before creating indexes, it's > > impossible to achieve something that hooks into initdb/syncdb. I know > > that it i

Django, initial data and custom SQL

2009-02-10 Thread Johan Bergström
n.. So, without further ado, what I would like to know is if there's a reason to why custom SQL is executed before index creation. Kind regards, Johan bergström --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &q

Django, Simplejson and speedups

2008-11-28 Thread Johan Bergström
Simplejson has been getting some version increments lately and Django hasn't been including them (there are tickets), which is - in my opinion - okay. Constantly upgrading the included simplejson library is an never ending rabbit chase where required effort doesn't motivate possible benefits (read

Re: Django & memcache hashing

2008-11-21 Thread Johan Bergström
memcached look a bit old. For reasons raised in this thread (as well as beeing linked to the crash-prone libmemcache library), I don't think that cmemcache belongs as an alternative in Django. Either offer an alternative (pylibmc comes to mind, albeit at very young age) for performance or remove it.

Re: Pluggable filestorage [was Heads-up: doing a bit of triage work]

2007-09-18 Thread Johan Bergström
On Sep 18, 1:21 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On 9/18/07, Johan Bergström <[EMAIL PROTECTED]> wrote: > > > What is wrong with using FTP for intranet file shuffling? I don't > > think frameworks should decide or advocate how you desi

Re: Pluggable filestorage [was Heads-up: doing a bit of triage work]

2007-09-18 Thread Johan Bergström
recommendations towards SFTP is in my opinion the way forward. > The is the same reasoning behind not shipping with a CGI handler -- > Django shouldn't make it easy to do stupid things. I don't think this is the same thing. Why use encryption when you trust the sender? > Now,

Re: Decouple simplejson from Django?

2007-07-13 Thread Johan Bergström
27; can be solved on a similar fashion as above. thanks, Johan Bergström --~--~-~--~~~---~--~~ 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

Re: Decouple simplejson from Django?

2007-07-12 Thread Johan Bergström
> Can you use the ORM without a database adapter? Ok, that might sound a bit stupid since you already kind of answered that in the post above. What i meant was that Django has lot of different imports, and without some of them (say a database adapter) Django is crippled. I personally don't see a

Re: Decouple simplejson from Django?

2007-07-12 Thread Johan Bergström
On Jul 12, 8:55 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > The other modules you mention are optional to a certain extent (don't > technically need flup to do Django-as-WSGI, can use Django without a > database or with your choice of DB adapter), but simplejson is > absolutely required for

Decouple simplejson from Django?

2007-07-11 Thread Johan Bergström
) cheers, Johan Bergström --~--~-~--~~~---~--~~ 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, sen

Re: make db form settings

2007-07-05 Thread Johan Bergström
I recently made a patch that can be used to get a similar result. You can find the patch here: http://code.djangoproject.com/ticket/4528 regards, Johan Bergström On Jul 4, 7:54 pm, Carl Karsten <[EMAIL PROTECTED]> wrote: > I have the begging of something that may eventually get submi