Re: Generating Javascript w Django

2007-01-11 Thread John Morton
On Friday 12 January 2007 16:04, cwurld wrote: > Hi, > > Does this make sense? I wanted some code to cycle thru some banner ads. > I could have done it with dojo doing a callback to my view, have my > view send the image path and the corresponding url, but that seemed > like a lot of

Re: What svn (subversion) client do you use for OS X?

2007-01-11 Thread 张成
在 2007-1-11,下午12:36,Noah 写道: > > I'm a switcher... but I'm also an svn user, and I got svn installed ok > using the darwin ports but I need a decent GUI for svn. I was using > TortoiseSVN on Windows and it was great. > > This is something of an issue for me as I have over 15,000 project > files

Re: What svn (subversion) client do you use for OS X?

2007-01-11 Thread Noah
I could hope there is a rewrite... after all there hasn't been a news update since 2004... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: What svn (subversion) client do you use for OS X?

2007-01-11 Thread Noah
Sorry, I hit post twice. --~--~-~--~~~---~--~~ 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 email to

Re: What svn (subversion) client do you use for OS X?

2007-01-11 Thread Noah
Not all of my files are Python, in fact probably only 500 or so of the 15,000 files I'm versioning are actually py files. The rest are graphics, data and resources of other kinds. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: What svn (subversion) client do you use for OS X?

2007-01-11 Thread Noah
Not all of my files are Python, in fact probably only 500 or so of the 15,000 files I'm versioning are actually py files. The rest are graphics, data and resources of other kinds. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

(<= EASY APPLE PIE RECIPES =>)

2007-01-11 Thread Tina Bajaj
[image: Apple Pie Recipes] *Apple Pie Recipes *http://taniarajpo.mb.com/recipe/apple_pie/ *Best Apple pie Cooking recipes easy to make For best recipes please visit: http://taniarajpo.mb.com/recipe/apple_pie/ Sonia *

<<< NEW 2007 CARS >>>

2007-01-11 Thread Tina Bajaj
NEW 2007 Cars All new models [image: NEW 2007 Cars] Please visit: http://allnewcars.mb.com/ Lexus Mercedes BMW Honda Ford http://allnewcars.mb.com/ Thanks Sonia --~--~-~--~~~---~--~~ You received this message because you

Re: dynamically refresh the urlconf?

2007-01-11 Thread James Bennett
On 1/11/07, Justin <[EMAIL PROTECTED]> wrote: > I'm digging through Django trying to figure out how I can manually tell > it to run through the settings.ROOT_URLCONF again, or how I can load a > fresh list into memory for resolving. Generally when you need to reload a Python module, the standard

Re: a candidate for a custom decorator?

2007-01-11 Thread Kenneth Gonsalves
On 12-Jan-07, at 8:42 AM, Patrick J. Anderson wrote: > @redirect_staff > @redirect_anonymous > def my_view(request): > #view logic and HttpResponse make only one decorator for both options - i think the problem is in chaining the decorators - dont they get nested or something? --

Re: a candidate for a custom decorator?

2007-01-11 Thread Patrick J. Anderson
Brian Beck wrote: > I think your problem is the return values. args is a tuple and request > should be there instead. In both of your decorators, return fn(request, > *args, **kwargs) instead of fn(args, kwargs). > > > > > Yes, Brian, that was the problem. Thanks for your help.

Re: What svn (subversion) client do you use for OS X?

2007-01-11 Thread Rob Hudson
There's also SCPlugin which is going through a re-write at the moment. You might have some success with their old version, however. http://scplugin.tigris.org/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: a candidate for a custom decorator?

2007-01-11 Thread limodou
On 1/12/07, Brian Beck <[EMAIL PROTECTED]> wrote: > > I think your problem is the return values. args is a tuple and request > should be there instead. In both of your decorators, return fn(request, > *args, **kwargs) instead of fn(args, kwargs). > I think you are right. -- I like python!

Re: a candidate for a custom decorator?

2007-01-11 Thread Brian Beck
I think your problem is the return values. args is a tuple and request should be there instead. In both of your decorators, return fn(request, *args, **kwargs) instead of fn(args, kwargs). --~--~-~--~~~---~--~~ You received this message because you are

Re: a candidate for a custom decorator?

2007-01-11 Thread limodou
I suggest that you print the request, args, and kwargs to see the real arguments. -- I like python! UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou --~--~-~--~~~---~--~~ You received this message because you are

ValuesQuerySet table join problem

2007-01-11 Thread [EMAIL PROTECTED]
I have been having trouble extracting data from a related data entry field when it comes to trying to get the values from related (joined) field. Perhaps the best way to explain what I need to do can be seen in the code snippet attached below.

dynamically refresh the urlconf?

2007-01-11 Thread Justin
I'm digging through Django trying to figure out how I can manually tell it to run through the settings.ROOT_URLCONF again, or how I can load a fresh list into memory for resolving. I'd like to reload the list w/out having to restart my instance of Django. Apologies if this has been asked

a candidate for a custom decorator?

2007-01-11 Thread Patrick J. Anderson
Hello, I wanted to ask for some advice on a little issue I have with implementing decorators in my views. I have this piece of code, which I include in each view, to redirect anonymous and staff users to a notice page (I don't want them to access site members stuff): def my_view(request):

Re: Hello all. Tutorials for PHP refugee moving to Django...?

2007-01-11 Thread Mark Rodriguez
Thanks all. I've just jumped into the Django Book! On 1/11/07, Joseph Heck <[EMAIL PROTECTED]> wrote: > > Head to the tutorials at http://www.djangoproject.com/documentation/ and > work through them. Once you're done with that, take a look at > http://www.djangobook.com/ > > -joe > > On 1/11/07,

Generating Javascript w Django

2007-01-11 Thread cwurld
Hi, Does this make sense? I wanted some code to cycle thru some banner ads. I could have done it with dojo doing a callback to my view, have my view send the image path and the corresponding url, but that seemed like a lot of activity for such a simple process. Instead, I generated the

Re: What svn (subversion) client do you use for OS X?

2007-01-11 Thread James Bennett
On 1/11/07, Noah <[EMAIL PROTECTED]> wrote: > Anyone? Maybe we could make a list and I'll try them all out... I use a combination of the command-line client and Emacs' built-in version-control support (which lets me check in directly from Emacs once I'm done with a file). -- "May the forces of

Re: Can a view open a page in a new browser window?

2007-01-11 Thread Jeremy Dunck
On 1/11/07, Julio Nobrega <[EMAIL PROTECTED]> wrote: > > No. What you can do is open a "normal" webpage and use window.open() > at body tag onLoad(). ...which will almost certainly be blocked by any popup blocker. In any case, you'll want to make the finished report accessible by URL and then

Re: Can a view open a page in a new browser window?

2007-01-11 Thread Julio Nobrega
No. What you can do is open a "normal" webpage and use window.open() at body tag onLoad(). On 1/11/07, Bob T. <[EMAIL PROTECTED]> wrote: > > Hi All, > > I have a situation on the Django site where a view needs to either > return a normal page, or it might need to open a new browser window to >

Re: Internationalization problem in template system

2007-01-11 Thread Nuno Mariz
Jacob Kaplan-Moss wrote: > On 1/11/07 2:35 PM, Nuno Mariz wrote: >> Any idea to resolve this , this don't scale. If I what to add another >> language, I have to patch all of my templates. > > If I were you, I'd write a simple accessor on your model to get the current > translation. Off the

Re: What svn (subversion) client do you use for OS X?

2007-01-11 Thread Stefan Foulis
I use eclipse with subclipse for svn and pydev for python support... everything nicely integrated and in one place. On Jan 11, 2007, at 06:57, Noah wrote: > > I recently switched to a mac and I've been keeping all of my projects > in subversion and I don't have a good GUI client. What do you

Re: What svn (subversion) client do you use for OS X?

2007-01-11 Thread Joseph Heck
the command line one? (svn) On 1/11/07, Noah <[EMAIL PROTECTED]> wrote: > > > Anyone? Maybe we could make a list and I'll try them all out... > > RapidSVN > SvnX > ZigVersion > > what else? > > > > > --~--~-~--~~~---~--~~ You received this message because you

Re: What svn (subversion) client do you use for OS X?

2007-01-11 Thread bedros
try esvn; they claim Mac OSX compatibility (as well as Linux and windows) using QT lib. http://esvn.umputun.com/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Hello all. Tutorials for PHP refugee moving to Django...?

2007-01-11 Thread Joseph Heck
Head to the tutorials at http://www.djangoproject.com/documentation/ and work through them. Once you're done with that, take a look at http://www.djangobook.com/ -joe On 1/11/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > I'm relatively new to hardcore web programming etc. Most of the

Re: Hello all. Tutorials for PHP refugee moving to Django...?

2007-01-11 Thread Jeremy Dunck
On 1/11/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Any links would be helpful...no need to search for me...just if you > know anything off the top of your head...my search continues... > You're (part of) the intended audience for the Django book. http://www.djangobook.com/en/beta/

Re: What svn (subversion) client do you use for OS X?

2007-01-11 Thread Noah
Anyone? Maybe we could make a list and I'll try them all out... RapidSVN SvnX ZigVersion what else? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Can a view open a page in a new browser window?

2007-01-11 Thread Bob T.
Hi All, I have a situation on the Django site where a view needs to either return a normal page, or it might need to open a new browser window to display the response (a report). I know for the normal case I can just return an HttpResponse, but is there anything that can cause the response to be

Hello all. Tutorials for PHP refugee moving to Django...?

2007-01-11 Thread [EMAIL PROTECTED]
I'm relatively new to hardcore web programming etc. Most of the stuff I've done is OGF (one giant function) per Cal Henderson's terminology in PHP. I'm looking to dive into Python, Django etc...and not sure where to begin? Any links would be helpful...no need to search for me...just if you

Re: Internationalization problem in template system

2007-01-11 Thread Jacob Kaplan-Moss
On 1/11/07 2:35 PM, Nuno Mariz wrote: > Any idea to resolve this , this don't scale. If I what to add another > language, I have to patch all of my templates. If I were you, I'd write a simple accessor on your model to get the current translation. Off the top of my head, you could do

Re: Running Django on OpenBSD...best practices?

2007-01-11 Thread Tim Chase
>> Any suggestions for which direction I should pursue? (Building >> Apache2 + building mod_python) Options I haven't uncovered? > > > I went this route under OpenBSD 3.9 and have had very few issues. The most > trouble I had was with getting mod_python to compile correctly, mostly > related

Internationalization problem in template system

2007-01-11 Thread Nuno Mariz
I have a internationalization problem to solve in the template system. In my model: [...] text_pt = TextField() text_en = TextField() [...] In my template: {% load i18n %} {% get_current_language as LANGUAGE_CODE %} {% ifequal LANGUAGE_CODE 'en' %} {{ object.text_en }} {% else %} {{

Re: Empty related sets = Page not found?

2007-01-11 Thread Brian Beck
John Matthew wrote: > Thank you for the reply. No problem. :) --~--~-~--~~~---~--~~ 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: Signed Cookies

2007-01-11 Thread Gulopine
> Better would be to open a ticket at code.djangoproject.com and then take this > up on django-developers. Done (ticket #3285), and done. Is that the normal procedure, then, for contrib apps? The note on the bottom of the contrib add-on page says to take it up here, which is what I did. However,

Re: Django Projects and Subversion

2007-01-11 Thread Joseph Heck
That's exactly what we're doing. Our "update production" script reads: svn update /u/django/project sudo /etc/init.d/apache2 restart The only time this doesn't work is if someone has tweaked a model and there's schema changes to be made in conjunction. -joe On 1/10/07, Cam <[EMAIL PROTECTED]>

Re: Empty related sets = Page not found?

2007-01-11 Thread John Matthew
Thank you for the reply. On 1/10/07, Brian Beck <[EMAIL PROTECTED]> wrote: > > > Hi, > > object_list takes an allow_empty argument, try settings it to True. > >From the docs: > > allow_empty: A boolean specifying whether to display the page if no > objects are available. If this is False and no

fw chapter 18 - custom view in admin

2007-01-11 Thread Picio
Hello, I need to filter the results of my admin change_list page. Following the djangobook chap. 18 , I managed to build my Custom View for a change_list page. Unfortunately I lost all the pretty things like, the search field, date hierarchy, filter per day month, etc. These are my steps: 1)

Re: Creating an empty queryset

2007-01-11 Thread medhat
Well, the patch now has documentation and tests. -- Thanks, Medhat --~--~-~--~~~---~--~~ 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: Django joining multiple tables together

2007-01-11 Thread Michael Radziej
David Cramer schrieb: > Why does Django join "files_file" twice? I do a > .filter(file__game=blah).select_related(fields=['file', 'type']) so it > joins the files table twice? This would happen the same with a normal > .select_related() as well. Maybe the SQL engine optimizes this but I'm > not

Re: The order of ""Add-on applications (contrib)" section

2007-01-11 Thread Adrian Holovaty
On 1/11/07, dutche <[EMAIL PROTECTED]> wrote: > I was reading the Django doc and I started to read the Flatpage doc, > but while I was reading it I realize that I must understand at least a > bit about Sites framework, just to know that my site has an ID and how > to use it even if I have one

Re: Signed Cookies

2007-01-11 Thread Jacob Kaplan-Moss
On 1/11/07 8:58 AM, Jeremy Dunck wrote: > On 1/10/07, Gulopine <[EMAIL PROTECTED]> wrote: > ... >> The code for middleware.py follows (I've placed it in >> django.contrib.signed_cookies, but any other name would suffice): >> > > This looks useful, but please re-send the code as an attachment to

Re: Evaluation of urls.py in mod_python

2007-01-11 Thread Waylan Limberg
If my understanding is correct, when you use this method: > choices = { > 'queryset': Poll.objects.filter(opening_date__lte=datetime.now(), > closing_date__gte=datetime.now()) > } The value of datetime.now() is evaluated at compilation time when apache/mod_python is started (or at least

Re: Signed Cookies

2007-01-11 Thread Jeremy Dunck
On 1/10/07, Gulopine <[EMAIL PROTECTED]> wrote: ... > The code for middleware.py follows (I've placed it in > django.contrib.signed_cookies, but any other name would suffice): > This looks useful, but please re-send the code as an attachment to avoid email line wrap munging. :)

Signed Cookies

2007-01-11 Thread Gulopine
In response to some discussion on Chapter 20 of the Django book, I'd like to submit my first contrib package for consideration, a middleware package that transparently implements signed cookies. It uses the SECRET_KEY setting already included in Django, and could easily be modified to allow

Model with 4 ForeignKeys, display 50 recoreds (MySQL vs. PostgreSQL)

2007-01-11 Thread Robert
Hello, I have a model containing 7 fields, wich of 4 are ForeignKeys to some other models. When displaying a table with 50 records from this model (which means it makes > 200 db queries) it takes ~10s to load. My hardware is not that bad, but it's not the point. I've tried with cache_page()

Django joining multiple tables together

2007-01-11 Thread David Cramer
What it should be (I believe): SELECT `files_version`.`id` , `files_version`.`file_id` , `files_version`.`md5` , `files_version`.`name` , `files_version`.`post_date` , `files_version`.`archive` , `files_version`.`change_log` , `files_version`.`author_id` , `files_version`.`downloads` ,

order_by with Foreign Keys

2007-01-11 Thread [EMAIL PROTECTED]
I've seen a few posts that this was a bug where you cannot specify order_by with a column from a foreign key ... order_by(foreignkeytable__foreignkeycolumn) because it says table not found. Does anyone know if there are plans to fix this...or if there is a work around? I have several resultsets

What svn (subversion) client do you use for OS X?

2007-01-11 Thread Noah
I recently switched to a mac and I've been keeping all of my projects in subversion and I don't have a good GUI client. What do you recommend? I tried svnX but it did not work properly and RapidSVN wasn't very usable and ZigVersion didn't like how large my repository was (15,000+ files)

What svn (subversion) client do you use for OS X?

2007-01-11 Thread Noah
I'm a switcher... but I'm also an svn user, and I got svn installed ok using the darwin ports but I need a decent GUI for svn. I was using TortoiseSVN on Windows and it was great. This is something of an issue for me as I have over 15,000 project files under version control and as it stands now

The order of ""Add-on applications (contrib)" section

2007-01-11 Thread dutche
Sup folks!! I was reading the Django doc and I started to read the Flatpage doc, but while I was reading it I realize that I must understand at least a bit about Sites framework, just to know that my site has an ID and how to use it even if I have one site. So I thought that should be better if

Re: watched items and content type

2007-01-11 Thread [EMAIL PROTECTED]
anyone? --~--~-~--~~~---~--~~ 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 email to [EMAIL PROTECTED] For

Evaluation of urls.py in mod_python

2007-01-11 Thread Jyrki Pulliainen
Hi, after running in some rather strange problems I got curious about the way Django and/or mod_python evaluates urls.py. Is there a difference if I use following code: now = datetime.now() choices = { 'queryset': Poll.objects.filter(opening_date__lte=now, closing_date__gte=now) } Or if

Re: Segmentation fault with mod_python (Ubuntu Edgy Eft)

2007-01-11 Thread James Turnbull
Hi Nikl, > - have you tried to increase apache's loglevel? Yes, but the errors were no more verbose. > - do you have any php-extensions installed? if so, you might want > to check out > if php is really the factor by loading it without any extensions. > if that > works, try adding them

Re: Creating an empty queryset

2007-01-11 Thread Russell Keith-Magee
On 1/11/07, medhat <[EMAIL PROTECTED]> wrote: > > The patch is in http://code.djangoproject.com/ticket/3283 Remember - no patch is complete without unit tests and documentation... Yours, Russ Magee %-) --~--~-~--~~~---~--~~ You received this message because you

Re: Creating an empty queryset

2007-01-11 Thread medhat
The patch is in http://code.djangoproject.com/ticket/3283 -- Thanks, Medhat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Segmentation fault with mod_python (Ubuntu Edgy Eft)

2007-01-11 Thread Nikolaus Schlemm
hi James, > I'm running Ubuntu Edgy Eft, with the following versions (updated to > the most recent available from apt-get) > Apache/2.0.55 (Ubuntu) mod_python/3.2.8 Python/2.4.4c1 PHP/5.1.6 > mod_ssl/2.0.55 OpenSSL/0.9.8b > and Django 0.95. I'm running pretty much the same combo, but with

Segmentation fault with mod_python (Ubuntu Edgy Eft)

2007-01-11 Thread James Turnbull
Hi all, I'm running Ubuntu Edgy Eft, with the following versions (updated to the most recent available from apt-get) Apache/2.0.55 (Ubuntu) mod_python/3.2.8 Python/2.4.4c1 PHP/5.1.6 mod_ssl/2.0.55 OpenSSL/0.9.8b and Django 0.95. Following the documentation here

How to ensure model instance has at least one relater

2007-01-11 Thread Crispin Bennett
Hi, I have a pair of models A and B, where B has a foreign key pointing to A. I want to ensure that instances of A have at least one (B) referrer. The obvious way (to me, still learning python and Django) was to override A's 'save' method, checking for the existence of at least one referring B

Re: admin > custom error message

2007-01-11 Thread Rob Slotboom
Hi James et all, Because of what I want it isn't possible to just rely on a validator, I need a manipulator to get a request object. The manipulator only has to add an extra validator to one field. This validator validates using the database. No custom form is needed. The manipulator will be

Re: Announce: Portable Python v1.0 beta

2007-01-11 Thread Perica Zivkovic
Thanks, please send all your comments, ideas to me so I can add them in future release(s) grtz Perica On 1/10/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: > > On 1/10/07, Perica Zivkovic <[EMAIL PROTECTED]> wrote: > > I would like to announce the *first* beta release of the Portable > > Python

Re: Python 2.5 + MySQLdb

2007-01-11 Thread John-Scott
I'm not using windows these days, but taking a quick look at http://sourceforge.net/projects/mysql-python seems to indicate that they've only compiled a windows installer that depends on python2.4. You have at least two options, 1) download the source for mysql-python and attempt to build it

Re: sorting the results of a queryset

2007-01-11 Thread Rob Slotboom
And of course a new kind of sorting function. Thank's to 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

Re: sorting the results of a queryset

2007-01-11 Thread Robert Slotboom
I was thinking about a custom get_query_set().get_data() function but this is out of scope I suppose So I figured out three possible solutions: First is a recursive quey. Not supported bij Postgres :-( Second is to add a column for storing the path value, calculated and added just before

Re: Python 2.5 + MySQLdb

2007-01-11 Thread Carl Holm
Thanks, I'm getting the impression that MySQLdb is not available to Python 2.5, but if anyone is using this configuration, I would like to find out about the details. The OS in question is WinXP - Version 5.1.2600. Regards, CL Brett Parker wrote: > On Wed, Jan 10, 2007 at 02:21:38AM -0800,