Filter on count of ManyToManyField

2006-07-16 Thread [EMAIL PROTECTED]
Hi. This is probably trivial, but I've not managed to find the solution. How do I filter objects based on the count of a ManyToManyField? My example: I have two classes -- Blog and Submission: class Blog( models.Model ): entries = models.ManyToManyField( Submission ) class Submission( mod

Re: Filter on count of ManyToManyField

2006-07-16 Thread Malcolm Tredinnick
Hi Daniel, On Sun, 2006-07-16 at 09:07 +, [EMAIL PROTECTED] wrote: > Hi. > > This is probably trivial, but I've not managed to find the solution. > How do I filter objects based on the count of a ManyToManyField? > > My example: > > I have two classes -- Blog and Submission: > > class Blo

Re: user registration

2006-07-16 Thread patrickk
nice. didn“t see that. Am 15.07.2006 um 18:29 schrieb [EMAIL PROTECTED]: > > There is: > http://code.djangoproject.com/wiki/FormField > > Chris > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users

Re: Filter on count of ManyToManyField

2006-07-16 Thread Malcolm Tredinnick
On Sun, 2006-07-16 at 19:24 +1000, Malcolm Tredinnick wrote: > Hi Daniel, > > On Sun, 2006-07-16 at 09:07 +, [EMAIL PROTECTED] wrote: > > Hi. > > > > This is probably trivial, but I've not managed to find the solution. > > How do I filter objects based on the count of a ManyToManyField? > >

Re: Filter on count of ManyToManyField

2006-07-16 Thread [EMAIL PROTECTED]
Hi. Malcolm Tredinnick wrote: > I'll agree this one isn't too obvious (until you see the answer): > > Blog.objects.filter(entries__isnull = False) > > will do what you want (have a look at the underlying SQL query is you > are interested in seeing that it really works as advertised). I'm

Re: Filter on count of ManyToManyField

2006-07-16 Thread Malcolm Tredinnick
On Sun, 2006-07-16 at 09:33 +, [EMAIL PROTECTED] wrote: > Hi. > > Malcolm Tredinnick wrote: > > I'll agree this one isn't too obvious (until you see the answer): > > > > Blog.objects.filter(entries__isnull = False) > > > > will do what you want (have a look at the underlying SQL query

Re: Filter on count of ManyToManyField

2006-07-16 Thread [EMAIL PROTECTED]
Hi. I'm pretty sure I didn't rename anything after creating the DB. The error message I got was that the column "m2m_models_blog__entries.entries" doesn't exist. I get the same error when executing the SQL in psql directly. I hadn't seen that the m2m stuff was in the "AS" clause. OK, so m2m_mod

Re: unbuffered output to client/end-user

2006-07-16 Thread Nick
Martin,You mean if I access the model? I tried looking up a close() method for the DB api but couldn't find anything.Could you be more specific, maybe give an example, so I can write it down in case I ever need it. Currently trying to learn django, so I have a lot of newbie questions.-nick parrinOn

Re: Filter on count of ManyToManyField

2006-07-16 Thread Malcolm Tredinnick
On Sun, 2006-07-16 at 10:09 +, [EMAIL PROTECTED] wrote: > Hi. > > I'm pretty sure I didn't rename anything after creating the DB. > > The error message I got was that the column > "m2m_models_blog__entries.entries" doesn't exist. I get the same error > when executing the SQL in psql directly

Re: Samples for displaying a tree of data

2006-07-16 Thread [EMAIL PROTECTED]
Can you give some more details on how to implement this in django, how to use it with the admin interface? mamcxyz wrote: > I don't think my code is usefull for you... I build the tree from a > list like: > > ['uno\dos\tres','dos\tres\cuatro','pepe\papa\pepa'] > > However the API of elementree e

Loose coupling of objects.

2006-07-16 Thread Paul
I'm trying to come up with a way of writing re-useable code for certain common features on two-point-oh-y sites. This might become a long post, so apologies in advance. Say your building the standard blog application. It's conceivable that you'd want your users to add comments, add tags, and rate

Re: Loose coupling of objects.

2006-07-16 Thread Malcolm Tredinnick
On Sun, 2006-07-16 at 12:37 +, Paul wrote: > I'm trying to come up with a way of writing re-useable code for certain > common features on two-point-oh-y sites. This might become a long post, > so apologies in advance. > > Say your building the standard blog application. It's conceivable that

Re: Loose coupling of objects.

2006-07-16 Thread Paul
Thanks Malcolm, I thought people must have solved this problem. I just didn't realise what the ContentType field was. I also found Luke Plant's tagging app (http://groups.google.com/group/django-users/browse_thread/thread/a7cbd4fd843583be) in which he has a GenericForeignKey, but I'll investigate

Re: Django vs. Rails vs. Symfony: Django is fastest

2006-07-16 Thread [EMAIL PROTECTED]
I've done some httperf testing og the django server. I've used Arch Linux (i686) on a Acer Aspire 5002 WLMi Laptop (AMD Turion 1,6GHz, 512MB DDR RAM) from text mode (no X running) I've tested a working django server with: httperf --server=localhost --port=8080 --uri=/test/ --num-conns=7000 --num-

Re: Loose coupling of objects.

2006-07-16 Thread [EMAIL PROTECTED]
The core version was built using Luke Plant's work and Ian Holsman's work, kind of the best of both worlds. Cheers, Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group

user centric/object centric object crud tools

2006-07-16 Thread D-Arb
Hi, I am trying to figure out the best way to deal with object/user centric object creation. I am building a site that lets users create objects tied to their identities, for e.g. having users posting news entries, etc. Currently one can make a wrapper to deal with checking a user's access for v

Multiple block levels failing?

2006-07-16 Thread [EMAIL PROTECTED]
I have built a menu structure, using the category data model, http://code.djangoproject.com/wiki/CookBookCategoryDataModelPostMagic So, every category is a menu item, and can be a parent of multiple categories. In the admin, everything works fine, but now i'm building my templates. The problem is,

Web Developer Training

2006-07-16 Thread bobj
I am currently working on putting together a project plan (for my grad project) to create training on how to use web 2.0 frameworks (specifically Django). Does anyone think there is a need for such training? The training would include video and consist of interactive modules. The training would be

Re: Django vs. Rails vs. Symfony: Django is fastest

2006-07-16 Thread Jacob Kaplan-Moss
On Jul 16, 2006, at 8:45 AM, [EMAIL PROTECTED] wrote: > I've done some httperf testing og the django server. I've used Arch > Linux (i686) on a Acer Aspire 5002 WLMi Laptop (AMD Turion 1,6GHz, > 512MB DDR RAM) from text mode (no X running) Interesting stuff -- thanks for the benchmarks. I'd note

Re: Django vs. Rails vs. Symfony: Django is fastest

2006-07-16 Thread [EMAIL PROTECTED]
The test django page used no DB and the test itself didn't do much I/O operations and the system didn't go into swap. As for errors I get this from the running server (in console): ### Traceback (most recent call last): File "/home/piotr/nowe/pytho

Re: Web Developer Training

2006-07-16 Thread Jeremy Dunck
On 7/16/06, bobj <[EMAIL PROTECTED]> wrote: > > I am currently working on putting together a project plan (for my grad > project) to create training on how to use web 2.0 frameworks > (specifically Django). Does anyone think there is a need for such > training? I think that'd be great. One of th

Re: unbuffered output to client/end-user

2006-07-16 Thread Martin Glueck
Sorry Nick, but the comment about the database access wasn't mine.. so I cannot help you here Martin On 7/16/06, Nick <[EMAIL PROTECTED]> wrote: > Martin, > > You mean if I access the model? I tried looking up a close() method for the > DB api but couldn't find anything. > Could you be more

Re: Web Developer Training

2006-07-16 Thread Leon
heck yes, django is scary for non-programmers. training would be great, I'll be your first trainee. On 7/16/06, bobj <[EMAIL PROTECTED]> wrote: > > I am currently working on putting together a project plan (for my grad > project) to create training on how to use web 2.0 frameworks > (specifically

Re: unbuffered output to client/end-user

2006-07-16 Thread Ivan Sagalaev
Nick wrote: > Martin, Well, not exactly :-) > You mean if I access the model? Yes. By the time your response iterator starts working Django has already closed the database connection used in the request. If you try to access a model a connection will be automatically opened again but never c

Re: Django vs. Rails vs. Symfony: Django is fastest

2006-07-16 Thread [EMAIL PROTECTED]
a nice overview of the test (django and pylons) can be found here: http://www.cms.rk.edu.pl/benchmark.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Re: unbuffered output to client/end-user

2006-07-16 Thread Nick
On 7/16/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: Nick wrote:> Martin,Well, not exactly :-)Haha, shouldn't post with my eyes closed while waking up. > You mean if I access the model?Yes. By the time your response iterator starts working Django hasalready closed the database connection used in th

Re: Extending pluralize?

2006-07-16 Thread Carlos Yoder
> Well... A tag (or rather a filter) choosing one of three forms would be > very simple. In fact I've heard gettext already has such functionality > but I'm not very familliar with it. What is required in Django itself is > some mechanism choosing the right pluralization plugin based on page > lan

Re: Django vs. Rails vs. Symfony: Django is fastest

2006-07-16 Thread Ian Holsman
is this a test of django vs pylons or a test of mod_python vs wsgi ? a pre-test showing a serving a simple static page through both of them (also 15k) would highlight if django's templating engine is indeed faster than pylons. (and it might convince the pylons team to use mod-python instead of

field names in validator error messages

2006-07-16 Thread Todd O'Bryan
Is there any way to specify a user-friendly name for fields when creating a Form object? I have a change password view, and right now I'm getting error messages like This field must match the 'new_password' field. Obviously, I'd prefer something like the field's label, rather than the fie

Re: Django vs. Rails vs. Symfony: Django is fastest

2006-07-16 Thread [EMAIL PROTECTED]
django vs pylons - their servers showing a page which uses a template with 5 variables (values returned by the view/controller) no mod_python, apache or any other. I'll test X + lighttp/apache soon (I need to read the docs ;) ) --~--~-~--~~~---~--~~ You received

IPython not default shell

2006-07-16 Thread cyberco
I've checked out the latest SVN version of Django, but when I try 'python manage.py shell' I get the standard shell, not IPython. But I have IPython installed on my computer. At the shell's command prompt I can just type 'import IPython' without a problem. I have IPython installed with readline, c

Re: IPython not default shell

2006-07-16 Thread cyberco
Sorry, I had an old version of Django installed which caused the problems. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To

Re: Model -- best way to do this:

2006-07-16 Thread webd0012
Thanks for your reply. I'm trying what you said but I can't get it to work. If I put class "City" first, "Place" doesn't work, and if I put another class first, other classes get errors. Not sure what is wrong with the order. from django.db import models class City(models.Model): CITIES =

Re: Model -- best way to do this:

2006-07-16 Thread Malcolm Tredinnick
On Sun, 2006-07-16 at 15:46 -0700, webd0012 wrote: > Thanks for your reply. I'm trying what you said but I can't get it to > work. If I put class "City" first, "Place" doesn't work, and if I put > another class first, other classes get errors. Not sure what is wrong > with the order. > > from

Re: Extending pluralize?

2006-07-16 Thread Rob Hunter
Ivan Sagalaev wrote: > Russell Keith-Magee wrote: > > This should be fairly easy to extend to a 1,2,3,4,... case; in your > > dolphin case, something like delfin{{ num_delfinov|pluralize:",a,i,ov"}} > > > > (excuse my Slovenian if I've messed up your example :-) > > The problem is that it's not 1,

Re: field names in validator error messages

2006-07-16 Thread Malcolm Tredinnick
On Sun, 2006-07-16 at 17:46 -0400, Todd O'Bryan wrote: > Is there any way to specify a user-friendly name for fields when > creating a Form object? > > I have a change password view, and right now I'm getting error > messages like > > This field must match the 'new_password' field. > > Obvi

Re: field names in validator error messages

2006-07-16 Thread Todd O'Bryan
On Jul 16, 2006, at 7:38 PM, Malcolm Tredinnick wrote: > > On Sun, 2006-07-16 at 17:46 -0400, Todd O'Bryan wrote: >> Is there any way to specify a user-friendly name for fields when >> creating a Form object? >> >> I have a change password view, and right now I'm getting error >> messages like >

Re: Free video of the Jenna Jameson

2006-07-16 Thread Iain Duncan
carlito556 wrote: > Free video of the Jenna Jameson > > at http://www.rosapink.net Jenna Jameson and Django Reindhardt, who knew? Those jazz players are always trouble ... ; ) Iain "I'm all in favour of grants for jazz musicians. Or any other brand of scotch" -- Eddie Condon --~--~-~

Re: field names in validator error messages

2006-07-16 Thread Todd O'Bryan
On Jul 16, 2006, at 7:51 PM, Todd O'Bryan wrote: > > > On Jul 16, 2006, at 7:38 PM, Malcolm Tredinnick wrote: > >> >> On Sun, 2006-07-16 at 17:46 -0400, Todd O'Bryan wrote: >>> Is there any way to specify a user-friendly name for fields when >>> creating a Form object? >>> >>> I have a change pa

Re: Web Developer Training

2006-07-16 Thread Kenneth Gonsalves
On 17-Jul-06, at 12:47 AM, Leon wrote: > heck yes, django is scary for non-programmers. training would be > great, I'll be your first trainee. it is not meant for non programmers -- regards kg http://lawgon.livejournal.com http://avsap.org.in --~--~-~--~~~---~-

Re: Web Developer Training

2006-07-16 Thread Leon
i meant non-programmers as in people who are programming literate, but don't consider themselves the programmer or spend their life in code. On 7/16/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > > On 17-Jul-06, at 12:47 AM, Leon wrote: > > > heck yes, django is scary for non-programmers. t

comments in Feeds

2006-07-16 Thread Julio Nobrega
/utils/feedgenerator.py has code to add the 'comments' field to feeds but it seems contrib.syndication.views.feed doesn't deal with it if I use it on my child Feed class. Am I doing something wrong? Is this intended? The docs don't mention item_comments()... I would like to use it, if it's

Free video of the Jenna Jameson

2006-07-16 Thread carlito556
Free video of the Jenna Jameson at http://www.rosapink.net Tell your friends it's free !! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@g