Re: [MR] -- adding functions to a model from another model

2006-04-20 Thread Ian Holsman
Hi Limodou. Thanks for the reply. what I was trying to do was slightly different. def all_models_setup_post_init(): for ct in Comments.get_content_types(): ... add the query objects to the ct's model so i have two problems.. the first is: - is there some dispatch thing I can co

Re: [MR] -- adding functions to a model from another model

2006-04-20 Thread limodou
On 4/21/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > > ok.. the subject sounds a bit confusing, but here's what i want to do. > > the comments table in contrib has a model with the following two fields > > content_type > and object_id > > I would like to create 'helper' functions on the refering m

[MR] -- adding functions to a model from another model

2006-04-20 Thread Ian Holsman
ok.. the subject sounds a bit confusing, but here's what i want to do. the comments table in contrib has a model with the following two fields content_type and object_id I would like to create 'helper' functions on the refering model. (ie.. have a comment_set query object on a blog-post model f

Re: using 'in_bulk' vs 'all' on a model

2006-04-20 Thread Ian Holsman
Thanks. it makes sense now. On 4/21/06, Max Battcher <[EMAIL PROTECTED]> wrote: > > Ian Holsman wrote: > > personally i'd prefer to have all() just return a dict mapping so I > > don't need to have 2 different ways of getting to the same > > information, but your in feature freeze mode, so I'm n

Re: using 'in_bulk' vs 'all' on a model

2006-04-20 Thread Max Battcher
Ian Holsman wrote: > personally i'd prefer to have all() just return a dict mapping so I > don't need to have 2 different ways of getting to the same > information, but your in feature freeze mode, so I'm not going whine > about it. Python makes it very easy to dict-ify your all() result if you w

Re: using 'in_bulk' vs 'all' on a model

2006-04-20 Thread Adrian Holovaty
On 4/20/06, Ian Holsman <[EMAIL PROTECTED]> wrote: > personally i'd prefer to have all() just return a dict mapping so I > don't need to have 2 different ways of getting to the same > information, but your in feature freeze mode, so I'm not going whine > about it. Dictionaries's keys and values a

Re: using 'in_bulk' vs 'all' on a model

2006-04-20 Thread Ian Holsman
On 4/21/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > > On Apr 20, 2006, at 7:57 PM, Ian Holsman wrote: > > > wouldn't it make more sense (from a consistency standpoint) for them > > to return the same thing? > > Well, all() returns all objects, so you know it'll be a list. in_bulk > > Make

Re: using 'in_bulk' vs 'all' on a model

2006-04-20 Thread Jacob Kaplan-Moss
On Apr 20, 2006, at 7:57 PM, Ian Holsman wrote: > I'm just wondering why the 'in_bulk' operation doesn't return a array > when 'all' does? [snip example] > wouldn't it make more sense (from a consistency standpoint) for them > to return the same thing? Well, all() returns all objects, so you kn

Re: magic-removal call for testing

2006-04-20 Thread limodou
On 4/21/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > Hi all, > > At this point, Django's magic-removal branch is stable enough that > we're ready to begin the merging process. I've been running the branch > on chicagocrime.org for a couple of weeks with no problems. As of > right now, Jacob

using 'in_bulk' vs 'all' on a model

2006-04-20 Thread Ian Holsman
hi. I'm just wondering why the 'in_bulk' operation doesn't return a array when 'all' does? eg. In [25]: ids Out[25]: [11L, 13L] In [26]: ContentType.objects.in_bulk( ids) Out[26]: {11L: machine, 13L: RPM} In [30]: ContentType.objects.all() Out[30]: [app, book mark, content type, CPU, Group, ma

Re: magic-removal call for testing

2006-04-20 Thread Russell Keith-Magee
On 4/21/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: Timeline: Let's aim for a merge on next Friday, April 28. That shouldgive us enough time to work on documentation and iron out last-minutebugs.Huzzah! A collective thanks to all involved in getting this beast off the ground, and those in the us

Re: Ideas for /examples/ directory

2006-04-20 Thread Ian Holsman
Kind of half on topic. we could work a bit more on the djangoproject project and use that as a tutorial as well. it has a database behind it, and would allow for more complex examples to be built. --Ian On 4/21/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 4/20/06, Eugene Lazutkin <[EMA

Re: Bug in admins search function (trunk)

2006-04-20 Thread Adrian Holovaty
On 3/30/06, Daniel Bimschas <[EMAIL PROTECTED]> wrote: > just found a bug in the admin interface (trunk version). When you > enable searching and type a simple " " empty space in the search > field, you'll get a TypeError with: > > reduce() of empty sequence with no initial value Hey Daniel, Tha

Re: Slug JS stopped working in M-R?

2006-04-20 Thread Rudolph
It's working again, the fault must have been on my side. Rudolph --~--~-~--~~~---~--~~ 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

Re: Passing dictionary to SQL queries

2006-04-20 Thread Adrian Holovaty
On 4/15/06, Ian Clelland <[EMAIL PROTECTED]> wrote: > It appears that the CursorDebugWrapper class will allow a tuple to be > passed in as parameters to a SQL query, but will not allow a > dictionary. Since dictionaries are alllowable parameters when the > underlying database supports pyformat par

Re: magic-removal call for testing

2006-04-20 Thread Joseph Kocherhans
On 4/20/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > At this point, Django's magic-removal branch is stable enough that > we're ready to begin the merging process. I've been running the branch > on chicagocrime.org for a couple of weeks with no problems. As of > right now, Jacob and I are fr

Re: last insert id

2006-04-20 Thread Adrian Holovaty
On 4/18/06, Mathieu Blondel <[EMAIL PROTECTED]> wrote: > When one saves an object with the save() method, a common need is to > get the id corresponding to the row that has just been inserted. > > p = polls.Poll(...) > p.save() > p.id # is set to None > > So here are two possible solutions, > 1)

magic-removal call for testing

2006-04-20 Thread Adrian Holovaty
Hi all, At this point, Django's magic-removal branch is stable enough that we're ready to begin the merging process. I've been running the branch on chicagocrime.org for a couple of weeks with no problems. As of right now, Jacob and I are freezing feature additions to the branch and concentrating

Re: Ideas for /examples/ directory

2006-04-20 Thread Adrian Holovaty
On 4/20/06, Eugene Lazutkin <[EMAIL PROTECTED]> wrote: > > Sorry to burst your bubble, but there are more operating systems than > > just Linux. > > 1) What are other operation systems that come bundled with Python? > 2) What is their market share? This is getting way off-topic. Let's get back to

Re: Ideas for /examples/ directory

2006-04-20 Thread Eugene Lazutkin
Jeroen Ruigrok van der Werven wrote: > On 4/18/06, Eugene Lazutkin <[EMAIL PROTECTED]> wrote: >> I think it is a little bit too over the top. I would propose to support >> 2.3 for 1 year after major Linux distros come with Python 2.4 (or 2.5) >> by default. > > Sorry to burst your bubble, but the

Re: Ideas for /examples/ directory

2006-04-20 Thread Jeroen Ruigrok van der Werven
On 4/18/06, Eugene Lazutkin <[EMAIL PROTECTED]> wrote: > I think it is a little bit too over the top. I would propose to support > 2.3 for 1 year after major Linux distros come with Python 2.4 (or 2.5) > by default. Sorry to burst your bubble, but there are more operating systems than just Linux.

Re: Ideas for /examples/ directory

2006-04-20 Thread Jeroen Ruigrok van der Werven
On 4/17/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > Does anybody have ideas for examples that would be worthwhile and > helpful to add to the examples directory? How to add tags to your own application(s). -- Jeroen Ruigrok van der Werven --~--~-~--~~~---~--~

Re: Ideas for /examples/ directory

2006-04-20 Thread Carlo C8E Miron
On 4/18/06, Eugene Lazutkin <[EMAIL PROTECTED]> wrote: > Adrian Holovaty wrote: > > The plan is to keep support for 2.3 indefinitely. If you do find any > I think it is a little bit too over the top. I would propose to support > 2.3 for 1 year after major Linux distros come with Python 2.4 (or 2.5)