Re: 2nd database for a specific app

2005-11-22 Thread patrick k
please help: i´m trying to have just ONE table for my app on a different host. all the other tables should be on dreamhost (auth, packages ...). so, when trying to install my newapp, i get an error like "table .packages not found". i basically need 2 setting files for one project (if that works).

Re: 2nd database for a specific app

2005-11-22 Thread Ian Holsman
Hi Patrick. At the moment Django can not talk to 2 different databases. If you need this, you might be able to get the data out of the 2nd database via custom functions which handle the db calls directly, or possibly futz with django/core/db regards Ian but I would wait 12-24 hours until the ex

How do I specify default value for a form field while using manipulator

2005-11-22 Thread Cheng Zhang
How do I specify default value for a form field, which maps to a foreign key as Poll.submitted_user shown below, with manipulator, in particular AddManipulator? I couldn't find relevant information from the django-users archive, at least searching with keywords: manipulator, default didn'

Re: Finding numbers of visitors

2005-11-22 Thread PythonistL
Adrian, thank you for your reply. I checked http://www.djangoproject.com/documentation/sessions/ and you say:``Session dictionary keys that begin with an underscore are reserved for internal use by Django. `` So, I expect some to be exist. Is there a list of such session dictionary keys that beg

Re: How do I specify default value for a form field while using manipulator

2005-11-22 Thread Grigory Fateyev
Hello Cheng Zhang! On Tue, 22 Nov 2005 19:36:52 +0800 you wrote: > To add a new poll, when I login as a user, say 'test1', I want the > 'submitted_user' form field (render as a pulldown list) to be > selected as 'test1' automatically. It would be better if this field > is disabled or hidden

Re: How do I specify default value for a form field while using manipulator

2005-11-22 Thread Cheng Zhang
Thanks. Guess I should get the habit of searching wiki, esp. the cookbook. On Nov 22, 2005, at 9:21 PM, Grigory Fateyev wrote: http://code.djangoproject.com/wiki/CookBookManipulators there are two ways to do this stuff.

Re: Finding numbers of visitors

2005-11-22 Thread Adrian Holovaty
On 11/22/05, PythonistL <[EMAIL PROTECTED]> wrote: > Adrian, thank you for your reply. > I checked http://www.djangoproject.com/documentation/sessions/ and you > say:``Session dictionary keys that begin with an underscore are > reserved for internal use by Django. `` > So, I expect some to be ex

ManyToMany problems

2005-11-22 Thread plisk
Hi, Based on the following model from django.models.auth import User class PolicyCategory(meta.Model): name = meta.CharField(maxlength=100); users = meta.ManyToManyField(User, blank=True) class META: db_table = 'intranet_policies' module_name = 'policies' ve

Paginating complex queries

2005-11-22 Thread [EMAIL PROTECTED]
What is the Django Way (tm) to paginate complex queries with user-controlled parameters? That is, if I want to paginate the results of a foos.get_list({'lots': 'of_complex', ['junk': 'in here']}) where the query terms are submitted via form, how should I go about that while maintaining the user-p

Re: When will there be a Oracle Backend?

2005-11-22 Thread Gwyn Evans
On 16/11/05, Maniac <[EMAIL PROTECTED]> wrote: > Oracle has 'rownum' - a virtual field representing the ordinal number of > a row. So you can do this: > > SELECT id, name FROM table where rownum<=5; This specific issue is covered in the patch, but just for reference, the 'gotcha' with rownum is t

Django job in Dallas, Texas

2005-11-22 Thread Adrian Holovaty
I spotted this on the Dallas craigslist: """ Pegasus News is looking for a Python programmer -- better yet for you and us if you're versed in Django -- to help with some light programming/tweaking on pre-existing content management system. """ http://dallas.craigslist.org/art/112889763.html Adr

Re: When will there be a Oracle Backend?

2005-11-22 Thread Maniac
Gwyn Evans wrote: This specific issue is covered in the patch, but just for reference, the 'gotcha' with rownum is that it's applied before any ORDER BY clause is applied I know :-). That's why I didn't use ORDER BY in my example :-). , so in most cases, it's not going to do what you want!

Re: ManyToMany problems

2005-11-22 Thread Adrian Holovaty
On 11/22/05, plisk <[EMAIL PROTECTED]> wrote: > >>> pc.get_user_list(groups__name__exact='Tech') > Traceback (most recent call last): > File "", line 1, in ? > File "/usr/lib/python2.4/site-packages/django/utils/functional.py", > line 3, in _curried > return args[0](*(args[1:]+moreargs), *

Re: ManyToMany problems

2005-11-22 Thread rotmer
Adrian Holovaty wrote: On 11/22/05, plisk <[EMAIL PROTECTED]> wrote: pc.get_user_list(groups__name__exact='Tech') Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.4/site-packages/django/utils/functional.py", line 3, in _curried return args[0](*(args[1:]+m

Re: Django developing in NewEdit

2005-11-22 Thread Dagur Páll Ammendrup
limodou wrote: NewEdit is a Python Editor base on wxPython. I'm learning django recently, and I'm beginning develop some extension about django in NewEdit. The process is continuing. I'v finished something like these: * django project wizard(need install it) -- you can create a django project

Re: Finding numbers of visitors

2005-11-22 Thread Luciano Rodrigues da Silva
I think that is time for the admin have some statistics usage of the applications. Or maybe another app include with the package.

Re: Form Value Array

2005-11-22 Thread Kevin
Unfortunately, I believe they're necessary. My exact code is a list of radio inputs, in template lanaguage and radio buttons use the input name as a way of grouping. My Models would be: class OptionSet(Model): name = CharField() class Option(Model): name = CharField option_set = Foreig

Re: Form Value Array

2005-11-22 Thread Adrian Holovaty
On 11/22/05, Kevin <[EMAIL PROTECTED]> wrote: > {% for option_set in item.get_options %} > > {{option_set.name}} > {% for option in option_set.get_choices %} > value="{{option.id}}"> {{option.name}} > {% endfor %} > {% endfor %} In this example, there's nothing forcing you to use the square brac

Re: Paginating complex queries

2005-11-22 Thread Gustavo Picon
Use the (undocumented) django.core.paginator class: http://code.djangoproject.com/browser/django/trunk/django/core/paginator.py You can see an example on how it works in: http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/views/main.py in the change_list function, the one t

Re: Form Value Array

2005-11-22 Thread Kevin
I understand, and that's what I'm really doing at the moment, but I was just curious if there's a better way to retrieve these POST values than just: options = [] for name, value in request.POST.items(): if(name.startswith("option")): options.append(value)

Re: Finding numbers of visitors

2005-11-22 Thread Simon Willison
On 22 Nov 2005, at 17:43, Luciano Rodrigues da Silva wrote: I think that is time for the admin have some statistics usage of the applications. Or maybe another app include with the package. Stats is a very obvious application for Middleware. I bet you could do something very, very cool alo

Re: Paginating complex queries

2005-11-22 Thread [EMAIL PROTECTED]
I've already dug into the paginator code. I was hoping there was a way to do it without having to munge query parameters by hand every time I get a new page. I thought my solution was bad but that code in the admin interface is pretty much the same sort of edge-case-ridden sin against nature. M

Re: Finding numbers of visitors

2005-11-22 Thread Luciano Rodrigues da Silva
Well, I think I am not the best person to do this, but I can try. Can you gime some sugestion about the data the stats need to have. I think number of user in days, weeks, months, type of browser, geographic location, ...

templates and using repr to 'stringify' objects in views

2005-11-22 Thread wrb
Is this standard practice? I'd been having a tough time using some parts the template language (in particular ifequals, many of the filter and string functions) until I discovered that some of the template "magic" doesn't work correctly unless I "pre", repr(o) objects within the code of my view (

Re: Paginating complex queries

2005-11-22 Thread Tom Tobin
On 11/22/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > What is the Django Way (tm) to paginate complex queries with > user-controlled parameters? That is, if I want to paginate the results > of a foos.get_list({'lots': 'of_complex', ['junk': 'in here']}) where > the query terms are submitt

Re: Paginating complex queries

2005-11-22 Thread Luke Plant
On Tue, 22 Nov 2005 07:09:06 -0800 [EMAIL PROTECTED] wrote: > What is the Django Way (tm) to paginate complex queries with > user-controlled parameters? That is, if I want to paginate the > results of a foos.get_list({'lots': 'of_complex', ['junk': 'in > here']}) where the query terms are submi

Re: Form Value Array

2005-11-22 Thread Luke Plant
On Tue, 22 Nov 2005 10:37:08 -0800 Kevin wrote: > > I understand, and that's what I'm really doing at the moment, but I > was just curious if there's a better way to retrieve these POST > values than just: > > options = [] > for name, value in request.POST.items(): > if(name.startswith("opt

Re: Form Value Array

2005-11-22 Thread Kevin
I decided to try writing a generic array converter as a middleware: import re class ParamsMiddleware: patt = re.compile("^([a-zA-Z_]\w*)\[\(d*)\]$") LARGE_INT = 2**30 def process_request(self, request): if(request.POST): post = requ

Re: Django developing in NewEdit

2005-11-22 Thread limodou
> Great job! I was waiting for something like this! > Thanks. :) -- I like python! My Blog: http://www.donews.net/limodou NewEdit Maillist: http://groups.google.com/group/NewEdit

Re: Django job in Dallas, Texas

2005-11-22 Thread Cheng Zhang
Looks like Django is starting to occupy the fields of news organization, beyond the stronghold of World Online. :-) Hopefully we will see such signs all over the world in near future, indicating the rapid occupation/adaptation of Django, at least as a competent counterpart of Rails. - Che

Re: Django developing in NewEdit

2005-11-22 Thread Albert Lee
That's what we need. 2005/11/23, limodou <[EMAIL PROTECTED]>: > > > Great job! I was waiting for something like this! > > > Thanks. :) > > -- > I like python! > My Blog: http://www.donews.net/limodou > NewEdit Maillist: http://groups.google.com/group/NewEdit > -- 欢迎访问我的小站: http://www.2tuzi.com

Re: Performance tuning tips?

2005-11-22 Thread Milton Waddams
sorry for the delay, got buried under a ton of work :( I haven't applied any patches to it (well except a couple of filters that I put into the default filters file). I switched to file based cache, results are below, sadly no great improvement. It may help to know that I'm running openload wit

Re: DRY templates

2005-11-22 Thread Bryan Murdock
On 11/15/05, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote: > > On Nov 15, 2005, at 5:09 PM, oggie rob wrote: > > But when I get to the > > template, no scalable option is obvious. I would expect something > > like: > > (% for field in form.fields %) > [snip] > > As of revision [1253] this is now po

Re: Performance tuning tips?

2005-11-22 Thread Eugene Lazutkin
For comparison I ran openload against my blog page (http://lazutkin.com/blog/). It is 38012 bytes at the moment. I don't know how many db transactions required to build it, but with cache it's a moot point anyway. Incidentally I use "file:" cache. The site is hosted with DreamHost --- cheap co

Re: OODB with Django? Was Re: ZODB Anyone ?

2005-11-22 Thread mario ruggier
That's what the original motivation for it was, rapid prototyping. But also because for a specific application I needed a richly-relationshipped (tm) model, and one that does some heavy processing on many related objects, and one (with its data) that can be easily adapted and evolved. I thoug