django in javascript

2009-03-10 Thread dudus
I just read an article at, http://www.b-list.org/weblog/2006/jul/04/javascript-orm-and-hding-sql/ . First I'll introduce myself, I'm a not so experienced web developer concluding graduation doing my final thesis about django and Gears. I completely understand the point about not having an AJAX a

Re: Google Summer of Code 2009

2009-03-10 Thread Raj
Hello all, On Mar 6, 9:13 pm, Jacob Kaplan-Moss wrote: > On Fri, Mar 6, 2009 at 4:07 AM, Petar Marić wrote: > > Will Django be participating in the Google SoC event this year? > > We'll be applying, yes. Did Django apply for GSoC 2009(seems like Google is already accepting Org Applications til

Re: django.db.backends refactored; hacks and third-party backends might break

2009-03-10 Thread Malcolm Tredinnick
On Tue, 2009-03-10 at 22:54 -0500, Adrian Holovaty wrote: [...] > The full changeset is here: http://code.djangoproject.com/changeset/10026 > > It's a pretty straightforward refactoring, but if you have any > technical questions on how to upgrade third-party backends or your own > hacks, please j

django.db.backends refactored; hacks and third-party backends might break

2009-03-10 Thread Adrian Holovaty
To the maintainers of third-party Django database backends (like DB2, etc.) and whoever else is hacking/patching/corrupting the code in django.db.backends for fun or profit -- With the help of Alex Gaynor, I've just checked in a light refactoring of the database backends such that Django database

Re: Changing DatabaseWrapper._cursor() to take a dict instead of settings

2009-03-10 Thread Adrian Holovaty
On Tue, Mar 10, 2009 at 9:15 PM, Alex Gaynor wrote: > I've posted a patch, but I'd like to here from one of the external DB > backend maintainers, I know we technically don't have any backwards > compatibility requirement here, but I don't think we want to jerk them > around too much.  Another th

Re: ModelForm field ordering

2009-03-10 Thread Alex Gaynor
Aren't I smart: Currently the order of fields in a ModelForm is always the same as their order on the Model with any many to many fields coming last. This is obviously disadvantageous since often a developer/designer wants them to be in a different order. This is ticket #8164 and #6953 . The su

ModelForm field ordering

2009-03-10 Thread Alex Gaynor
Currently the order of fields in a ModelForm is always the same as their order on the Model with any many to many fields coming last. -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-

Re: Changing DatabaseWrapper._cursor() to take a dict instead of settings

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 8:56 PM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Tue, 2009-03-10 at 12:21 -0500, Adrian Holovaty wrote: > [...] > > One ugliness about this is that it has to monkeypatch the settings > > file in order to change the DATABASE_NAME, before passing it to >

Re: Thread-safety bug in WSGIHandler

2009-03-10 Thread Malcolm Tredinnick
On Tue, 2009-03-10 at 10:30 -0400, Travis Terry wrote: [...] > So, my proposed fix is to add a flag in WSGIHandler and then test for > that flag in __call__(). Preferable to construct the list as a local variable and then assign it to the attribute in a single instruction. Assignment is atomic,

Re: Changing DatabaseWrapper._cursor() to take a dict instead of settings

2009-03-10 Thread Malcolm Tredinnick
On Tue, 2009-03-10 at 12:21 -0500, Adrian Holovaty wrote: [...] > One ugliness about this is that it has to monkeypatch the settings > file in order to change the DATABASE_NAME, before passing it to > DatabaseWrapper._cursor(). So my proposal is to change > DatabaseWrapper._cursor() to accept a se

Re: Changing DatabaseWrapper._cursor() to take a dict instead of settings

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 4:03 PM, Alex Gaynor wrote: > > > On Tue, Mar 10, 2009 at 3:46 PM, Adrian Holovaty wrote: > >> >> On Tue, Mar 10, 2009 at 12:55 PM, Alex Gaynor >> wrote: >> > I've been looking at adding multiple database support to Django for a >> little >> > while now and as a part of m

Re: Changing DatabaseWrapper._cursor() to take a dict instead of settings

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 3:46 PM, Adrian Holovaty wrote: > > On Tue, Mar 10, 2009 at 12:55 PM, Alex Gaynor > wrote: > > I've been looking at adding multiple database support to Django for a > little > > while now and as a part of my plan of action the first step is to remove > all > > references t

Re: Changing DatabaseWrapper._cursor() to take a dict instead of settings

2009-03-10 Thread Adrian Holovaty
On Tue, Mar 10, 2009 at 12:55 PM, Alex Gaynor wrote: > I've been looking at adding multiple database support to Django for a little > while now and as a part of my plan of action the first step is to remove all > references to the global settings in django.db.backends.* and replace them > with a

Re: Changing DatabaseWrapper._cursor() to take a dict instead of settings

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 12:21 PM, Adrian Holovaty wrote: > > I'm working on adding multiple-database support to an application and > am building a custom manager that lets me specify which DATABASE_NAME > to use for a particular model. It looks something like this: > > class OtherDatabaseManager(m

Changing DatabaseWrapper._cursor() to take a dict instead of settings

2009-03-10 Thread Adrian Holovaty
I'm working on adding multiple-database support to an application and am building a custom manager that lets me specify which DATABASE_NAME to use for a particular model. It looks something like this: class OtherDatabaseManager(models.Manager): """ This Manager lets you set the DATABASE_N

Re: Cache related values without needing to hit database twice

2009-03-10 Thread Jeremy Dunck
On Tue, Mar 10, 2009 at 11:12 AM, Vinicius Mendes wrote: ... > What do you think in saving the author value in the blog instance if it is > achieved through the author instance? It's something like telling blog who > is his author in the moment you are retrieving it from the author. You're descr

Re: Cache related values without needing to hit database twice

2009-03-10 Thread Collin Grady
I think you should look at select_related() to solve most of those cases. -- Collin Grady --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-devel

Cache related values without needing to hit database twice

2009-03-10 Thread Vinicius Mendes
I think ORM should have some kind of caching. For example, in docs[1], when we do: >>> e = Entry.objects.get(pk=1) >>> e.blog # Hits database >>> e.blog # Don't hit database But let's imagine we have a third model named Author: class Author(models.Model): name = models.CharField(max_length=5

Thread-safety bug in WSGIHandler

2009-03-10 Thread Travis Terry
I have found an incomplete-initialization bug the WSGIHandler when running under Apache mpm_worker with mod_wsgi. On the first request the WSGIHandler.__call__(...), we set up the middleware. There is a lock wrapping the load of the middleware, but the logic still allows incomplete initializa

Re: 'week_day' starting with sunday as first day of a week need to be fixed

2009-03-10 Thread Semmel
On Mar 9, 8:13 pm, Karen Tracey wrote: > I still see no reason to change it. I, personally, haven't noticed any > convergence on a standard starting weekday of Monday in everyday life -- all > my wall calendars (3) start with Sunday, though my desk calendar starts with > Monday.  Granted it's a b

Re: 'week_day' starting with sunday as first day of a week need to be fixed

2009-03-10 Thread Semmel
On Mar 9, 11:48 am, Malcolm Tredinnick wrote: > So what??? Nobody actually does print out those standards and read them > and it takes approximately 3 seconds, if you think very slowly, to be > able to handle Sunday as the first day of the week if you were > previously handling Monday. True, i d

Ticket 10405 and documentation about using 'app.model' notation in FKs to other apps models

2009-03-10 Thread Ramiro Morales
Hi, While trying to get a grip on this [1]ticket about problems experienced when using the 'otherapp.model' notation to the target model of a Foreign Key when that model is located on another application. I went to the relevant [2]docs: """ If you need to create a relationship on a model that ha

Re: Model validation

2009-03-10 Thread Ben Ford
Hi Honza, Would this code be an approach I could take with my work on fixture? (See my message from a couple of days ago). Cheers, Ben 2009/3/10 Honza Král > > Hi, > The code on github works (tests pass) but is not ready for production > use. What you can do to help is test and mostly, write t

Re: Model validation

2009-03-10 Thread Honza Král
Hi, The code on github works (tests pass) but is not ready for production use. What you can do to help is test and mostly, write tests to help us get there. There will be a sprint on model-validation during pycon, which should resolve most of the outstanding issues. Honza Král E-Mail: honza.k..