Re: Admin URLs in magic-removal branch

2005-12-14 Thread Jeroen Ruigrok van der Werven
On 12/15/05, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > Or maybe get rid of the "models" cruft: > > /admin/myproject/blog/entry/add/ +1 for being the most readable and less cumbersome. -- Jeroen Ruigrok van der Werven

Re: Admin URLs in magic-removal branch

2005-12-14 Thread Afternoon
On 15 Dec 2005, at 3:59, Adrian Holovaty wrote: Clearly we would want to avoid that. Before importing, it could check that the module is in INSTALLED_APPS. By going with /admin/project/app/model/add/ stick with more normal looking urls, you can do the checking at quite a fine-grained level

Re: Admin URLs in magic-removal branch

2005-12-14 Thread Adrian Holovaty
On 12/14/05, Ian Holsman <[EMAIL PROTECTED]> wrote: > my other concern with putting the python path into the URL is would it > allow nasty thing > like > admin/init.me.and.i.format.your.hard_disk/ > ? > and other weird easter eggs which a unsuspecting admin doesn't realize > is on his machine? Cl

Re: Admin URLs in magic-removal branch

2005-12-14 Thread Ian Holsman
On 12/15/05, Afternoon <[EMAIL PROTECTED]> wrote: > > > On 15 Dec 2005, at 3:15, Adrian Holovaty wrote: > > > /admin/myproject/blog/entry/add/ > > +1, most readable, most compact, most guessable. > > > The problem with "/admin/myproject.blog.models.entry/", though, is I'm > > not sure it's pos

Re: Admin URLs in magic-removal branch

2005-12-14 Thread Ian Holsman
my 2c's add the model name as a parameter to the view so that the developer can stick the admin screens directly into their application ie /forum/ calls my view /forum/add would call the admin add view with myproject.model.forum as a parmeter and so on. but to answer your specific question I wo

Re: Admin URLs in magic-removal branch

2005-12-14 Thread Afternoon
On 15 Dec 2005, at 3:15, Adrian Holovaty wrote: /admin/myproject/blog/entry/add/ +1, most readable, most compact, most guessable. The problem with "/admin/myproject.blog.models.entry/", though, is I'm not sure it's possible to get the Python path *to* an object. For example, given a mo

Admin URLs in magic-removal branch

2005-12-14 Thread Adrian Holovaty
In the magic-removal branch (see http://code.djangoproject.com/wiki/RemovingTheMagic), we're removing the magic model modules, which means the concept of "module_name" goes away. This creates a bunch of interesting new issues, because some parts in Django use module_name -- namely, the admin URLs.

Re: ORM performance question

2005-12-14 Thread Jacob Kaplan-Moss
On Dec 14, 2005, at 8:47 PM, Tim Keating wrote: I expected to see 1 call to function_get_iterator, or, at worst, 1 call for every GET_ITERATOR_CHUNK_SIZE rows. Instead, I'm seeing *3* calls to function_get_iterator for every row, which I find perplexing. I intend to dig into this further but I

Re: ORM performance question

2005-12-14 Thread Adrian Holovaty
On 12/14/05, Tim Keating <[EMAIL PROTECTED]> wrote: > for foo in foos.get_iterator(): > # Pack some of the data into a binary buffer > > I expected to see 1 call to function_get_iterator, or, at worst, 1 call > for every GET_ITERATOR_CHUNK_SIZE rows. Instead, I'm seeing *3* calls > to function_g

ORM performance question

2005-12-14 Thread Tim Keating
I have been working on a file download link, where the file is generated dynamically in the view code and returned via the mechanisms outlined in the help for generated PDFs or CSVs. This works fine, but the performance is staggeringly bad. When I prototyped the file builder in a vanilla Python sc

Re: Descriptors for fields?

2005-12-14 Thread Robert Wittams
> > Wait, I've got it! > > reporter.get_article_list() > > Wow! So readable, so clear! > > (Sorry) So completely different semantically!

Re: Descriptors for fields?

2005-12-14 Thread Robert Wittams
Dody Suria Wijaya wrote: > > hehehe, > > how about > > reporter.get_many_article() > > testing... > account.get_many_type() > poll.get_many_choice() > city.get_many_address() > > At least read a *bit* of the thread you are replying to.

Re: Removing the magic

2005-12-14 Thread Adrian Holovaty
On 12/14/05, Robert Wittams <[EMAIL PROTECTED]> wrote: > I don't think class META needs to get involved at all. > > This seems much cleaner ( and avoids random things like "manager = "): > > > class Person(models.Model): > first_name = models.CharField(maxlength=30) > last_name = models.Ch

Re: Descriptors for fields?

2005-12-14 Thread Dody Suria Wijaya
hehehe, how about reporter.get_many_article() testing... account.get_many_type() poll.get_many_choice() city.get_many_address() Jacob Kaplan-Moss wrote: On Dec 14, 2005, at 10:03 AM, Jason Davies wrote: _group _batch _bundle _bunch _clump _cluster _crowd _gaggle (!) _lot Wait, I've

Re: Descriptors for fields?

2005-12-14 Thread Jacob Kaplan-Moss
On Dec 14, 2005, at 10:03 AM, Jason Davies wrote: _group _batch _bundle _bunch _clump _cluster _crowd _gaggle (!) _lot Wait, I've got it! reporter.get_article_list() Wow! So readable, so clear! (Sorry) Jacob

Re: Descriptors for fields?

2005-12-14 Thread Jason Davies
Robert Wittams wrote: > > You are right, _list is worse than _set. > > > > Would _data be a better solution? > > I don't think so. As a sometimes C/C++ programmer I expect things called > data to be a void*, and come along with a length ;-) I browsed quickly through thesaurus.com. How about: _

Re: Descriptors for fields?

2005-12-14 Thread Robert Wittams
> You are right, _list is worse than _set. > > Would _data be a better solution? I don't think so. As a sometimes C/C++ programmer I expect things called data to be a void*, and come along with a length ;-)

Re: Descriptors for fields?

2005-12-14 Thread Jeroen Ruigrok van der Werven
Robert, On 12/14/05, Robert Wittams <[EMAIL PROTECTED]> wrote: > The point is, we *won't* have set_ for setting anymore. The > only confusion seems to be if people can't tell the difference between a > verb and a noun. I'm afraid that we will end up with a very stilted api > if we have to use news

Re: Descriptors for fields?

2005-12-14 Thread Robert Wittams
Amit Upadhyay wrote: > > Actually I din't read the whole post, ignore my second sentence. We already > have set_ for setting, and _set would be confusing if we > use it for just getting the "set" as someone pointed out, so _list > even if not totally accurate for the reasons you said. The point

Re: Removing the magic

2005-12-14 Thread Robert Wittams
Adrian Holovaty wrote: > Thoughts? > > http://code.djangoproject.com/wiki/RemovingTheMagic > > Please comment here rather than on the wiki. > > Adrian > > -- > Adrian Holovaty > holovaty.com | djangoproject.com | chicagocrime.org > Hi, Just looking over the wiki page again, I really dislik

Re: Descriptors for fields?

2005-12-14 Thread Amit Upadhyay
On 12/14/05, Robert Wittams <[EMAIL PROTECTED]> wrote: >>> How about _list. They are python lists anyway so that would help> too.>Did you even read my post? They aren't lists. They are possibly orderedsets. To be a list, it would need to always have a meaningful order, and it would also need to be

Re: Descriptors for fields?

2005-12-14 Thread Robert Wittams
Amit Upadhyay wrote: > On 12/14/05, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED]> wrote: > >>On 12/14/05, Robert Wittams <[EMAIL PROTECTED]> wrote: >> >>[ p1.article_set.order_by('headline') ] >> >> >>>Is your confusion between set the verb and set the noun ? I don't really >>>know how to fix

Re: Descriptors for fields?

2005-12-14 Thread Amit Upadhyay
On 12/14/05, Jeroen Ruigrok van der Werven <[EMAIL PROTECTED]> wrote: On 12/14/05, Robert Wittams <[EMAIL PROTECTED]> wrote:[ p1.article_set.order_by('headline') ]> Is your confusion between set the verb and set the noun ? I don't really > know how to fix that without refactoring the English langua

Re: Descriptors for fields?

2005-12-14 Thread Jeroen Ruigrok van der Werven
On 12/14/05, Robert Wittams <[EMAIL PROTECTED]> wrote: [ p1.article_set.order_by('headline') ] > Is your confusion between set the verb and set the noun ? I don't really > know how to fix that without refactoring the English language. I don't > know what else could be done here - pluralisation i

Re: How to implement function like this?

2005-12-14 Thread zagorot
got it. Runs well. Thanks a lot. * _ *

Re: How to implement function like this?

2005-12-14 Thread kmh
zagorot wrote: > when I get rid of this below: > - > {% ifequal mod(forloop.counter0,4) 0 %} > > {% endif %} > - > It works fine. > What's happened? The end tag for {% ifequal %} is {% endifequal %}. Kieran p.s. the django-users list is a better place to

Re: How to implement function like this?

2005-12-14 Thread zagorot
when I get rid of this below: - {% ifequal mod(forloop.counter0,4) 0 %} {% endif %} - It works fine. What's happened?