Re: How to make such query with django ORM?

2007-11-29 Thread Eratothene
> Here's a solution that should give you a list (not a QuerySet) of all > the blogs. Don't know if this is best practice though. You can get all > blogs of a user with: > user.blog_set.all() > From this QuerySet you want only these without articles: > blogs = [] > for blog in user.blog_set.all():

Re: How to make such query with django ORM?

2007-11-29 Thread SmileyChris
On Nov 28, 9:08 am, Eratothene <[EMAIL PROTECTED]> wrote: > I need to get all blogs that belong to certain user and are empty (do > not have any articles). I can't figure out how to make it with without > extra() method. Since you can't do aggregate methods in the ORM yet, you'll just have to use

Re: How to make such query with django ORM?

2007-11-29 Thread Matthias Kestenholz
On Thu, 2007-11-29 at 00:14 -0800, Eratothene wrote: > > Here's a solution that should give you a list (not a QuerySet) of all > > the blogs. Don't know if this is best practice though. You can get all > > blogs of a user with: > > user.blog_set.all() > > From this QuerySet you want only these wit

Re: How to make such query with django ORM?

2007-11-29 Thread Chris Hoeppner
Actually, the QuerySet objects are lazy. This is, there's no such query until you access the data. Or so do I believe. El jue, 29-11-2007 a las 01:23 -0800, SmileyChris escribi�: > On Nov 28, 9:08 am, Eratothene <[EMAIL PROTECTED]> wrote: > > I need to get all blogs that belong to certain user

Problems saving values from SelectDateWidget

2007-11-29 Thread Stupid Dustbin
Hi, encountered a problem recently with SelectDateWidget. I'm not very sure what I did wrong. from django.newforms.extras.widgets import SelectDateWidget #other imports class JustAForm(forms.Form): date_of_birth = forms.DateField(label = 'date of birth',widget = SelectDateWidget(years = rang

Re: IRC Channel

2007-11-29 Thread David Reynolds
On 28 Nov 2007, at 3:49 am, Collin Grady wrote: > > Er, no, I don't own any IRC channel on freenode :) > > #django still isn't registered, we need one of the devs to do that > before anyone can get op status and actually do anything I think it would be worthwhile doing, as there's no current wa

Re: IRC Channel

2007-11-29 Thread David Reynolds
On 29 Nov 2007, at 11:01 am, Kenneth Gonsalves wrote: > but who locked the topic? It was open before This perhaps: ./freenode/2007/09/20/#django.log:10:44 -!- mode/#django [+t] by rob (pulled from my log files) -- David Reynolds [EMAIL PROTECTED] --~--~-~--~~~---

Re: IRC Channel

2007-11-29 Thread David Reynolds
On 29 Nov 2007, at 11:08 am, David Reynolds wrote: > > > On 29 Nov 2007, at 11:01 am, Kenneth Gonsalves wrote: > >> but who locked the topic? It was open before > > This perhaps: > > ./freenode/2007/09/20/#django.log:10:44 -!- mode/#django [+t] by rob Extra context to that: 10:44 -!- rob [EMAI

Re: IRC Channel

2007-11-29 Thread Kenneth Gonsalves
On 29-Nov-07, at 4:24 PM, David Reynolds wrote: >> Er, no, I don't own any IRC channel on freenode :) >> >> #django still isn't registered, we need one of the devs to do that >> before anyone can get op status and actually do anything > > I think it would be worthwhile doing, as there's no curre

Re: IRC Channel

2007-11-29 Thread James Bennett
On 11/29/07, David Reynolds <[EMAIL PROTECTED]> wrote: > Seems like someone asked for it?! > > Very confused about this.. Originally anyone could change the topic. This apparently led to a problem where troublemakers would come in and change the topic randomly, and a freenode staff member respond

Re: IRC Channel

2007-11-29 Thread David Reynolds
On 29 Nov 2007, at 11:26 am, James Bennett wrote: > Originally anyone could change the topic. This apparently led to a > problem where troublemakers would come in and change the topic > randomly, and a freenode staff member responded by locking the > channel's topic, which now can't be changed u

Re: IRC Channel

2007-11-29 Thread Kenneth Gonsalves
On 29-Nov-07, at 4:40 PM, David Reynolds wrote: > 10:44 -!- rob [EMAIL PROTECTED]/staff/rob] has joined #django > 10:44 < luckymurali_81> i will see that > 10:44 -!- mode/#django [+t] by rob > 10:44 < denny> thanks rob > 10:44 -!- wlanionut [EMAIL PROTECTED] has joined #django > 10:44 < rob> np

Re: Street address normalisation

2007-11-29 Thread Corey Oordt
I ported part of the Geo Street Address from the perl module: address_regex.py from geocode.address_dicts import * STREET_TYPE_REGEX = "|".join(STREET_TYPES.keys()) + "|" + "|".join(STREET_TYPES.values()) STATE_REGEX = "|".join(STATE_CODES.values()) DIRECTIONS_REGEX = "|".join(DIRECTI

Re: should we place set_test_cookie/test_cookie_worked on every page?

2007-11-29 Thread jim
I played around with this a bit more and found that when we call set_test_cookie, no cookie by the name of 'testcookie' is set on your local box. If you look at the code it is supposed to set a 'testcookie' with the value of 'worked'. Since it did not work as expected, I worked around this by che

Re: 'Context' object has no attribute 'push'

2007-11-29 Thread e bergmundur
Hi Malcolm The code of the view in question is like tihis (with unrelevant changes to keep secrets secret :-) # -*- coding: utf-8 -*- [...] def settle(request, amount="9.00" ): amount = request.POST['amount'] vat = request.POST['vat'] transport = request.POST['transport

Re: Street address normalisation

2007-11-29 Thread jim
There are some commercial address standardization software such as: http://www.semaphorecorp.com/zp4/ (i do not work for this company :) but have used their software) jim On Nov 29, 7:31 am, Corey Oordt <[EMAIL PROTECTED]> wrote: > I ported part of the Geo Street Address from the perl module:

Passing text object to function and returning text via Pygments

2007-11-29 Thread Tane Piper
Hi Folks, I have only been using Python since the weekend, and Django since Tuesday so I'm quite new to the API, and I've hit a snag with what I'm trying to do. I'm currently working on porting over my CakePHP application which used the GeSHi library for syntax highlighting and I came across Pyg

Re: Passing text object to function and returning text via Pygments

2007-11-29 Thread Karen Tracey
On 11/29/07, Tane Piper <[EMAIL PROTECTED]> wrote: > > > Hi Folks, > > I have only been using Python since the weekend, and Django since > Tuesday so I'm quite new to the API, and I've hit a snag with what I'm > trying to do. I'm currently working on porting over my CakePHP > application which use

Re: Passing text object to function and returning text via Pygments

2007-11-29 Thread Tane Piper
I was actually just about to reply to say I had found this problem :) Silly me. However, I now have an issue (which is probably out of scope here, but I'll ask here just incase anyone can help). Now I get the formatted code back, however when I render it in my template, rather than actually comi

django on iis

2007-11-29 Thread 头太晕
pyISAPI_SCGI is a ISAPI Extension for SCGI. It can run django on iis. http://code.google.com/p/pyisapi-scgi/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Passing text object to function and returning text via Pygments

2007-11-29 Thread Karen Tracey
You need to turn off Django's HTML autoescaping when you want to render raw HTML. See: http://www.djangoproject.com/documentation/templates/#automatic-html-escaping Karen On 11/29/07, Tane Piper <[EMAIL PROTECTED]> wrote: > > > I was actually just about to reply to say I had found this problem

Re: django on iis

2007-11-29 Thread Jeremy Dunck
Nice. Any chance of getting this page translated to English? http://code.google.com/p/pyisapi-scgi/wiki/howtousepyisapiscgi Unfortunately, I can't help. :( On Nov 29, 2007 10:10 AM, 头太晕 <[EMAIL PROTECTED]> wrote: > > pyISAPI_SCGI is a ISAPI Extension for SCGI. It can run django on iis. > > http

Re: Passing text object to function and returning text via Pygments

2007-11-29 Thread Tane Piper
Brilliant, thanks for that Karen, works great :) On Nov 29, 2007 4:18 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > You need to turn off Django's HTML autoescaping when you want to render raw > HTML. See: > > http://www.djangoproject.com/documentation/templates/#automatic-html-escaping > > Karen

Re: IRC Channel

2007-11-29 Thread ikks
Some spanish-spoken django fans, also want #django-es , I would love to help being #django-es moderator or op if you wish, just let me know, I'm frequently on both channels as ikks. On 29 nov, 06:26, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 11/29/07, David Reynolds <[EMAIL PROTECTED]> wrot

Re: How to display if a user is logged in? Do I develop a custom template tag?

2007-11-29 Thread pk
There are two issues. 1) you can't change the auth_user table/class. There are different ways to "extend" the auth_user class. The "B-List" site has some article on how you may do it. http://www.b-list.org/ I have my own "user" class that is one-to-one implemented as "many-to- one" back to the a

Access urls in template tags?

2007-11-29 Thread MikeHowarth
Basically I'm looking to expand a sub navigation dependent upon whether the category belongs to the selected hierachy. Basically I was thinking of doing something along the lines: url = 'parent/child' url_bits = url.split('/') if cat.slug == url[1]: #build parent nav - don't recurse else:

How use splitdatetime?

2007-11-29 Thread mamcxyz
Hi, I'm triying to use SplitDateTimeField. I have this form definition: class EventsForm(forms.Form): title = forms.CharField(help_text=u'Ingrese el título de la noticia', required=True, label=u'Titulo') tags = TagField(help_text=u'Ej: Fiesta, Internet, Jovenes, etc..', required=True, la

Why not get inherited block on template?

2007-11-29 Thread mamcxyz
I follow the advice in use a lot of blocks for my site desing, is truly flexible this way. However, I have a problem understanding why a parent block not get rendered. I think is related of use of includes. I have this: I have the templates inside each app, example:jhonWeb\shared\core \templates

How do "SELECT * FROm x WHERE Id IN Y"?

2007-11-29 Thread mamcxyz
I have a model of events and city. class Event(models.Model): city= models.ForeignKey(City, blank=True, null=True, core=True, verbose_name='ciudad') Then, I wanna let the user filter the events by city. But I don't wanna show ALL the city, because a lot can't have events attached. So

Re: How do "SELECT * FROm x WHERE Id IN Y"?

2007-11-29 Thread Malcolm Tredinnick
On Thu, 2007-11-29 at 13:15 -0800, mamcxyz wrote: > I have a model of events and city. > > class Event(models.Model): > city= models.ForeignKey(City, blank=True, null=True, > core=True, verbose_name='ciudad') > > Then, I wanna let the user filter the events by city. But I don't > wa

Re: How use splitdatetime?

2007-11-29 Thread Karen Tracey
On 11/29/07, mamcxyz <[EMAIL PROTECTED]> wrote: > > > Hi, > > I'm triying to use SplitDateTimeField. I have this form definition: > > class EventsForm(forms.Form): > title = forms.CharField(help_text=u'Ingrese el título de la > noticia', required=True, label=u'Titulo') > tags = TagField(hel

Use dispatcher or override model's save method?

2007-11-29 Thread Ryan K
I have a model called a course that when created needs to insert several classes (another model) into the schedule model. Is it best to override the course's save method or use the dispatcher? Is there any difference for this use case? Thanks, Ryan Kaskel --~--~-~--~~~

Re: Use dispatcher or override model's save method?

2007-11-29 Thread Alex Koshelev
No, there is no difference in your case On 30 нояб, 02:28, Ryan K <[EMAIL PROTECTED]> wrote: > I have a model called a course that when created needs to insert > several classes (another model) into the schedule model. Is it best to > override the course's save method or use the dispatcher? Is th

Re: Use dispatcher or override model's save method?

2007-11-29 Thread Malcolm Tredinnick
On Thu, 2007-11-29 at 15:28 -0800, Ryan K wrote: > I have a model called a course that when created needs to insert > several classes (another model) into the schedule model. Is it best to > override the course's save method or use the dispatcher? Is there any > difference for this use case? As

Re: How do "SELECT * FROm x WHERE Id IN Y"?

2007-11-29 Thread mamcxyz
Excellent! That do the trick. Thank you. --~--~-~--~~~---~--~~ 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 unsubscribe from this group, send e

Use of newforms prefixes in html templates

2007-11-29 Thread Cat
Hello I have a list of forms that I want to pass to my template but I am not sure how to include the prefix. My template - abbreviated - is something like {% for i in form_list %} {{ i.first}} {{ i.closest }} {% endfor %} Thanks for any help --~--~-~--~~~---~--~--

Re: Access urls in template tags?

2007-11-29 Thread Tim
You may want to investigate the code at Satchmo (www.satchmoproject.com). I know that they do something similar for their categories and sub-categories. Tim On Nov 29, 1:14 pm, MikeHowarth <[EMAIL PROTECTED]> wrote: > Basically I'm looking to expand a sub navigation dependent upon > whether the

Re: How use splitdatetime?

2007-11-29 Thread mamcxyz
You are rigth. I do bad the import, but anyway get the same error. Also, yes, I confirm is because I do {{ field }} The problem was that I pass a Initial date as string, so the code try to call "value.date' and obviously fail. However, I must turn off autoescape for the widget to render right.

NodeList.render() and SafeString

2007-11-29 Thread Michael Elsdörfer
I just updated to an auto-escaping enabled trunk, and I'm trying to adjust some template tags. One of them stores a nodelist and renders it at some point. Now, NodeList.render() returns escaped data, but does not mark it as safe (it's a unicode instance). Is this just an oversight, or as designed

Re: Problems loading fixtures using loaddata

2007-11-29 Thread Russell Keith-Magee
On Nov 27, 2007 8:12 PM, Divan Roulant <[EMAIL PROTECTED]> wrote: > > For those of you who are using loaddata, should loaddata be as > straighforward as to dumpdata and then load it (after cleaning the > database) or are there other steps in between that I am missing? It should be straightforward

Re: NodeList.render() and SafeString

2007-11-29 Thread Malcolm Tredinnick
On Fri, 2007-11-30 at 02:54 +0100, Michael Elsdörfer wrote: > I just updated to an auto-escaping enabled trunk, and I'm trying to > adjust some template tags. One of them stores a nodelist and renders > it at some point. > > Now, NodeList.render() returns escaped data, but does not mark it as >

Re: django on iis

2007-11-29 Thread 头太晕
Hi, i create a english version .http://code.google.com/p/pyisapi-scgi/downloads/detail?name=pyISAPI_SCGI_0.0.1_En.zip and http://code.google.com/p/pyisapi-scgi/wiki/howtoen. but I cant't say expressly. Please help me. Thank you! 2007/11/30, Jeremy Dunck <[EMAIL PROTECTED]>: > > Nice. Any chance o

Unit tesing with XML-RPC server

2007-11-29 Thread meledictas
Anybody have experience running unit testing against mock xml-rpc server? What is posible solution?. Creating mock of XML-RPC server and redirect all XML-RPC request from application to a mock server is initial idea. Any idea or example will be my appliciate. Thanks --~--~-~--~~-

Call for reviews on the django book !!

2007-11-29 Thread Subramanyam
Hi All I am planning to buy the "The Definitive Guide to Django: Web Development Done Right" by Adrian Holovaty , Jacob Kaplan-Moss Can you please share your reviews like , is it the same as the django book available in the www.djangoproject.com or does it include more coverages of code snippets

Unit tesing with XML-RPC server

2007-11-29 Thread meledictas
Anybody have experience running unit testing against mock xml-rpc server? What is posible solution?. Creating mock of XML-RPC server and redirect all XML-RPC request from application to a mock server is initial idea. Any idea or example will be my appliciate. Thanks --~--~-~--~~-

Re: Call for reviews on the django book !!

2007-11-29 Thread Kenneth Gonsalves
On 30-Nov-07, at 12:52 PM, Subramanyam wrote: > I was referring to the paper edition what is there in the site will be there on paper and vice versa -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference for the common man: http://registration.fossconf.in/

Re: Call for reviews on the django book !!

2007-11-29 Thread Kenneth Gonsalves
On 30-Nov-07, at 12:22 PM, Subramanyam wrote: > Can you please share your reviews like , is it the same as the django > book available in the www.djangoproject.com or does it include more > coverages of code snippets. look at it here and make up your mind: http://www.djangobook.com/ -- reg

Re: Call for reviews on the django book !!

2007-11-29 Thread Kenneth Gonsalves
On 30-Nov-07, at 1:01 PM, Subramanyam wrote: > Better dont assume and answer > > let me know if you have gone through the book even the authors have not gone through the book as it is not released as yet. However the authors state that the book is released under the GFDL and will be availab

Re: Call for reviews on the django book !!

2007-11-29 Thread Subramanyam
Hi kenneth I was referring to the paper edition On Nov 30, 12:15 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 30-Nov-07, at 12:22 PM, Subramanyam wrote: > > > Can you please share your reviews like , is it the same as the django > > book available in thewww.djangoproject.comor does it i

Re: Call for reviews on the django book !!

2007-11-29 Thread Subramanyam
Better dont assume and answer let me know if you have gone through the book On Nov 30, 12:26 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 30-Nov-07, at 12:52 PM, Subramanyam wrote: > > > I was referring to the paper edition > > what is there in the site will be there on paper and vice v