Problems with "initial" parameter in form handling

2009-12-31 Thread Steven Arnold
Hi, my problem is that the "initial" parameter in forms.Form seems to have no effect. I set the "subject" value in this code: form = ContactForm( initial={'subject': 'I love your site!'} ) ...yet this initialization string never makes it to the HTML as the default

Dreamhost support

2009-12-31 Thread Ramdas S
List, Got a mail from Dreamhost on availability of Django properly supported. here are the links for fellow dreamhosters to check thru. Please post your experience http://wiki.dreamhost.com/Django http://wiki.dreamhost.com/Passenger_WSGI Thanks Ramdas -- Ramdas S +91 9342 583 065 --

Re: new readonly_fields in modeladmin

2009-12-31 Thread Tim Miller
Alex_Gaynor wrote: > I've actually gone ahead and filed it, and uploaded a patch: > http://code.djangoproject.com/ticket/12477 > Thanks Alex. Your post on writing django tests has been helpful as well. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Switching from soc2009/multidb to trunk; cross db foreign keys

2009-12-31 Thread CB
> Hrm, it's clear that the current implementation is probably overly > aggressive in changing the DB I definitely agree here. It just seems like a useful working solution for 'now', clearly somethign a bit more elegant would be needed to make it into Django's core. > That being said in > your

Re: Switching from soc2009/multidb to trunk; cross db foreign keys

2009-12-31 Thread Alex_Gaynor
On Dec 31, 3:30 pm, CB wrote: > *Oops, sorry about the refrences to 'AdSalesModel' and setting > using='adsales' - you can see where I'm using these ideas :) > > Change them to PartitionedModel and self.objects.forced_using > respectively. Hrm, it's clear that the current

Re: new readonly_fields in modeladmin

2009-12-31 Thread Alex_Gaynor
On Dec 31, 3:06 pm, Alex_Gaynor wrote: > On Dec 31, 12:46 pm, Tim Miller wrote: > > > I just want to confirm this isn't my own idiocy or intended behaviour > > before I file a bug. > > > I've got the following line defined in my modeladmin entry... > > >

Re: Switching from soc2009/multidb to trunk; cross db foreign keys

2009-12-31 Thread CB
*Oops, sorry about the refrences to 'AdSalesModel' and setting using='adsales' - you can see where I'm using these ideas :) Change them to PartitionedModel and self.objects.forced_using respectively. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Switching from soc2009/multidb to trunk; cross db foreign keys

2009-12-31 Thread CB
So I did some basic poking around with managers, etc. I noticed what 'may be' a 3 part solution to keep a model on one and only one db: First, we should modify the initial queryset to use our preferred db. We can do this by adding a custom manager, with an overridden get_query_set(): class

multidb workaround

2009-12-31 Thread Continuation
>From reading several posts here, it looks like it's not a good idea to try to have ForeignKey pointing from 1 DB to another DB. The problem for me is that pretty much every single model of mine has a link to User. And I suspect that's a very common case for most people. If I put in FK to User

Re: new readonly_fields in modeladmin

2009-12-31 Thread Alex_Gaynor
On Dec 31, 12:46 pm, Tim Miller wrote: > I just want to confirm this isn't my own idiocy or intended behaviour > before I file a bug. > > I've got the following line defined in my modeladmin entry... > > readonly_fields = ('date_created', 'date_modified', 'date_published') > >

Re: Seemingly Random Admin Errors

2009-12-31 Thread Karen Tracey
On Thu, Dec 31, 2009 at 1:22 PM, DizzyDoo wrote: > Bill, > > It's my own fault for capitalising the file names in the first post, > but I'll be sure to watch out for that. > > Also, I hadn't realised it, but it did seem I was running mod_python > accidentally, when all

new readonly_fields in modeladmin

2009-12-31 Thread Tim Miller
I just want to confirm this isn't my own idiocy or intended behaviour before I file a bug. I've got the following line defined in my modeladmin entry... readonly_fields = ('date_created', 'date_modified', 'date_published') They get displayed in the admin as 'Date created', 'Date modified' and

Re: Seemingly Random Admin Errors

2009-12-31 Thread DizzyDoo
Bill, It's my own fault for capitalising the file names in the first post, but I'll be sure to watch out for that. Also, I hadn't realised it, but it did seem I was running mod_python accidentally, when all I wanted was my django.wsgi. So a quick uninstall and a few minutes of testing seems to

Re: Tutorial help

2009-12-31 Thread Bill Freeman
Your code doesn't belong in any directory being served by webserver at all. If your hosting arrangement requires that, then it's the wrong hosting environment. In order of preference django should be running: under mod_wsgi under mod_python as the development server with the front end

Re: questions from a noob - win7 using django

2009-12-31 Thread Bill Freeman
On Thu, Dec 31, 2009 at 5:31 AM, shofty wrote: > ive been using django for a couple of weeks, i can see massive > potential for actually finishing a couple of projects that i've had on > the go for a good while. thing is its my first attempt at using a > framework and ive

Re: Tutorial help

2009-12-31 Thread Tim Goddard
After more testing: Can I restrict access to the code by using an .htaccess file or is that not safe enough? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe

Re: Seemingly Random Admin Errors

2009-12-31 Thread Bill Freeman
I don't see anything wrong with the code that you posted, other than perhaps that the initial letter on your module names, Urls.py, Settings.py, and Models.py, appear to be in upper case. That doesn't seem to be causing you a problem, probably because you are running on a file system that is case

Re: Tutorial help

2009-12-31 Thread Tim Goddard
Ok, so I need to do some testing of my server's capability Here is my directory of my /home/www: name type backend folder creativeapex.freehostia.com folder Inside backend there is a file name test.html that has a simple heading of "This is a test file" or something like that Inside the other

Re: Tutorial help

2009-12-31 Thread dartdog
as a general rule freehosts don't allow long running processes and therefore can't run Django, YMMMV let us know if you do get it going on a freehost, I doubt it.. On Dec 31, 9:39 am, CreativeApex wrote: > Ok, I've been following the tutorial.. I'm currently in the

Re: questions from a noob - win7 using django

2009-12-31 Thread dartdog
Look at a project like Django-mingus (on github) to see good layout and integration ideas..as well as proper use of the setup.py file which you need to be using. Your issues have nothing to do with windows at this time,, btw you should get familiar with Virtual-env and use it again Mingus is good

Re: Tutorial help

2009-12-31 Thread Shawn Milochik
You definitely need your Django code to be in a folder that is unavailable from the Internet. It shouldn't be accessed by your visitors or your server app (such as apache). When you run Django in a production environment, it listens on a specific port, and from there it serves the pages.

Tutorial help

2009-12-31 Thread CreativeApex
Ok, I've been following the tutorial.. I'm currently in the midst of part 3. I have the development server running on my laptop and everything is working. How Django works is 'clicking' with the exception of how it will work on a real server. I will be using free hosting. I currently have

Seemingly Random Admin Errors

2009-12-31 Thread DizzyDoo
Hi, I'm following a tutorial, very simple, all I've done is got my database set up, wrote a small and simple blog app and activated the admin. I'm running Django 1.1.1 on Apache, on my deployment box. The problem is seemingly random. I have two blogpost objects successfully added to the MySQL

obtaining sessionId(s) of logged in user by username

2009-12-31 Thread Subramanyam
Hi what is the most efficient way to get the sessionId(s) of a user by the username (where in the same user can log-in on mulitple systems) , btw the I am using sessionID as the key for my cached objects Is there any middleware that I can use Thanks Subramanyam -- You received this message

Re: Foreign Key Across Database in Django multidb

2009-12-31 Thread Doug Blank
On Wed, Dec 30, 2009 at 11:54 PM, malik wrote: > I heard that that multi DB support is now available in Django.Can some > one tell me whether it is possible to have foreign Key across > Databases. > > Please see this thread:

Re: Newbie question: empty is not empty?

2009-12-31 Thread Javier Guerra
On Thu, Dec 31, 2009 at 7:13 AM, BobAalsma wrote: >  if request.get('q',False): use:if request.GET.get('q',False): -- Javier -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: IntegrityErrors after Postgres database restore attempt

2009-12-31 Thread Felipe Reyes
Hi 2009/12/31 Jason : > The big problem now, as you can see from the above error, is that if I > try to add a new app, it squawks presumably because it's trying to > assign an already existing pkey to django_content_type.  The > sequencereset command looked promising,

Re: Newbie question: empty is not empty?

2009-12-31 Thread BobAalsma
Thanks Jani, I've tried to folow your suggestions (and thanks for explaining the r/ s difference) into the current version of the test: def search(request): if request.get('q',False): q = request.GET['q'] klanten = Klant.objects.filter(naam__icontains=q)

Re: Newbie question: empty is not empty?

2009-12-31 Thread Masklinn
On 31 Dec 2009, at 12:31 , Jani Tiainen wrote: > > Or to make things a bit more Pythonic: > > if request.get('q', False): The `False` is pretty pointless in this case: .get returns None by default, and None is falsy. Unless specifically testing with 'is False', the default behavior works

Re: Newbie question: empty is not empty?

2009-12-31 Thread BobAalsma
Yes. I've copied your text into the views.py and now I get the expected answers - thanks! I'll study the differences to see what went wrong. Thanks again, Bob On Dec 31, 12:26 pm, Masklinn wrote: > On 31 Dec 2009, at 12:20 , BobAalsma wrote: > > > Thanks Masklin, I've

Re: Newbie question: empty is not empty?

2009-12-31 Thread Masklinn
On 31 Dec 2009, at 12:20 , BobAalsma wrote: > > Thanks Masklin, I've just tried your suggestion and there is no > change. > > I'm somewhat mystified by the 'u' that gets added to all answer > messages - is this something to do with unicode? Could this be the > root of (some) evil? > > I've

Re: Newbie question: empty is not empty?

2009-12-31 Thread Jani Tiainen
On Thu, 2009-12-31 at 03:20 -0800, BobAalsma wrote: > Thanks Masklin, I've just tried your suggestion and there is no > change. > > I'm somewhat mystified by the 'u' that gets added to all answer > messages - is this something to do with unicode? Could this be the > root of (some) evil? Again,

Re: Newbie question: empty is not empty?

2009-12-31 Thread Masklinn
On 31 Dec 2009, at 12:20 , BobAalsma wrote: > > Thanks Masklin, I've just tried your suggestion and there is no > change. > > I'm somewhat mystified by the 'u' that gets added to all answer > messages - is this something to do with unicode? Could this be the > root of (some) evil? It shouldn't

Re: Newbie question: empty is not empty?

2009-12-31 Thread BobAalsma
Thanks Masklin, I've just tried your suggestion and there is no change. I'm somewhat mystified by the 'u' that gets added to all answer messages - is this something to do with unicode? Could this be the root of (some) evil? I've tried using [ ] instead of the suggested ( ), which leads to a

questions from a noob - win7 using django

2009-12-31 Thread shofty
ive been using django for a couple of weeks, i can see massive potential for actually finishing a couple of projects that i've had on the go for a good while. thing is its my first attempt at using a framework and ive found the tutorial followable, but lacking. it tells you what to do, but doesnt

Foreign Key Across Database in Django multidb

2009-12-31 Thread malik
I heard that that multi DB support is now available in Django.Can some one tell me whether it is possible to have foreign Key across Databases. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Newbie question: empty is not empty?

2009-12-31 Thread Masklinn
On 31 Dec 2009, at 10:58 , BobAalsma wrote: > > I'm following the Django book to learn Django. I'm getting unexpected > responses and can't find how to address this. It seems that submitting > an empty form is not handled as if it is empty ?? > > In views.py: > def search(request): > if

Re: Newbie question: empty is not empty?

2009-12-31 Thread Jani Tiainen
On Thu, 2009-12-31 at 01:58 -0800, BobAalsma wrote: > I'm following the Django book to learn Django. I'm getting unexpected > responses and can't find how to address this. It seems that submitting > an empty form is not handled as if it is empty ?? > > In views.py: > def search(request): >

Newbie question: empty is not empty?

2009-12-31 Thread BobAalsma
I'm following the Django book to learn Django. I'm getting unexpected responses and can't find how to address this. It seems that submitting an empty form is not handled as if it is empty ?? In views.py: def search(request): if 'q' in request.GET: message = 'U zocht: %r' %