Re: synchronization problem

2008-03-30 Thread Mark Green
On Sun, 2008-03-30 at 17:49 -0700, meppum wrote: > The easiest way to deal with this is to create a "version" column that > gets updated with the current version number of the row in the > database. Increment this column value each time a save is performed on > that row. Override the save method

Re: *Occasional* PostgreSQL Error

2008-01-30 Thread Mark Green
On Wed, 2008-01-30 at 19:34 -0600, James Bennett wrote: > On Jan 30, 2008 6:01 PM, Mark Green <[EMAIL PROTECTED]> wrote: > > Ahem, there's a huge difference between being confronted with > > a spinner/progress bar or an error page. The former speaks > > "Please wai

Re: *Occasional* PostgreSQL Error

2008-01-30 Thread Mark Green
On Wed, 2008-01-30 at 11:03 -0600, James Bennett wrote: > On Jan 30, 2008 8:57 AM, Mark Green <[EMAIL PROTECTED]> wrote: > > Well, "Build for failure". Temporary overload can happen at any > > time and I'd expect django to behave exceptionally bad in that >

Re: *Occasional* PostgreSQL Error

2008-01-30 Thread Mark Green
On Tue, 2008-01-29 at 23:33 -0600, James Bennett wrote: > On Jan 29, 2008 11:18 PM, Mark Green <[EMAIL PROTECTED]> wrote: > > I agree on the loadbalancer front but the overhead for all > > those TCP connections (and pgpool managing them) worries me a bit. > > I'v

Re: *Occasional* PostgreSQL Error

2008-01-29 Thread Mark Green
On Tue, 2008-01-29 at 22:07 -0600, James Bennett wrote: > On Jan 29, 2008 10:04 PM, Mark Green <[EMAIL PROTECTED]> wrote: > > Just curious, what's the state of connection pooling in django? > > My personal opinion is that the application level (e.g., Django) is > the wr

Re: *Occasional* PostgreSQL Error

2008-01-29 Thread Mark Green
On Fri, 2008-01-25 at 15:14 -0800, Jacob Kaplan-Moss wrote: > Hi Doug -- > > On 1/24/08, Doug Van Horn <[EMAIL PROTECTED]> wrote: > > OperationalError: could not connect to server: No such file or > > directory > >Is the server running locally and accepting > >connections on

hierarchical constraints (country/city) and form validation?

2007-12-01 Thread Mark Green
Hello djangoics, I'd like to ask for the opinion of some django veterans on a task that I imagine to be a fairly common one. My site allows the user to set a country and city as part of their UserProfile. Obviously the city-field should only allow values that are valid within the context of the

Re: Passing the max_length from the Model into the Form

2007-11-23 Thread Mark Green
On Fri, 2007-11-23 at 14:59 -0800, leotr wrote: > Yes, not only it's dirty but it's ineffective as well! And your idea violates DRY. > Declare a constant somewhere and use it in both model and form. And where would that "somewhere" be? Custom constants on the model? I see no point in adding

Re: image/file uploads, custom filenames, security

2007-10-17 Thread Mark Green
On Tue, 2007-10-16 at 10:18 -0400, Marty Alchin wrote: > I've done some work on FileField lately that address some of your concerns. > > On 10/16/07, Mark Green <[EMAIL PROTECTED]> wrote: > > * does django properly sanitize the filename or rather, use > > safe temp

image/file uploads, custom filenames, security

2007-10-16 Thread Mark Green
hi all, i've been playing with ImageField and FileField recently and so far they work like a charm. some questions remain, though: * does django properly sanitize the filename or rather, use safe temp files? i wonder what would happen if i tried to upload a file called

choices/, how to get rid of the dashes?

2007-10-02 Thread Mark Green
Hi all, sorry for repeating my question but I haven't gotten a solution on first attempt and this really nags me. This is my model: class Person(models.Model): GENDER_CHOICES = ( ( 'm', 'Male' ), ( 'f', 'Female' ), ) gender = models.CharField( blank=False,

Re: Should Django have a road map?

2007-10-01 Thread Mark Green
On Mon, 2007-10-01 at 17:07 +0200, Stefan Matthias Aust wrote: > Joe, > > 2007/10/1, Joe <[EMAIL PROTECTED]>: > > [...] > > And this is the biggest disconnect between Django's team and the > > business world. If I went to my bosses and told them "It's done when > > it's done" about our

Re: how to scale (was: how to do something at startup)

2007-09-30 Thread Mark Green
On Sun, 2007-09-30 at 20:37 -0500, James Bennett wrote: > On 9/30/07, Mark Green <[EMAIL PROTECTED]> wrote: > > I'm not sure what drove me to call it "fragment caching". > > What I really meant to point at are the little things (such as > > form_for_model()

Re: how to scale (was: how to do something at startup)

2007-09-30 Thread Mark Green
On Sun, 2007-09-30 at 20:29 -0500, James Bennett wrote: > On 9/30/07, Mark Green <[EMAIL PROTECTED]> wrote: > > My question was really only about the former, a much simpler problem: > > How to keep a tcp connection persistent and re-use it across requests? > > By

Re: how to scale (was: how to do something at startup)

2007-09-30 Thread Mark Green
On Sun, 2007-09-30 at 16:16 -0500, James Bennett wrote: > On 9/30/07, Mark Green <[EMAIL PROTECTED]> wrote: > > Hm, this raises some serious scalabity questions for me. > > >From your description it sounds like there is no template > > fragment caching, not even

Re: how to do something at startup

2007-09-30 Thread Mark Green
On Fri, 2007-09-28 at 22:34 -0600, staff-gmail wrote: > James Bennett wrote: > > On 9/28/07, Mark Green <[EMAIL PROTECTED]> wrote: > > > >> i'm looking for a way to perform a bunch of initialization tasks > >> right after django startup. > >

Re: how to scale (was: how to do something at startup)

2007-09-30 Thread Mark Green
On Fri, 2007-09-28 at 22:29 -0500, James Bennett wrote: > On 9/28/07, Mark Green <[EMAIL PROTECTED]> wrote: > > i'm looking for a way to perform a bunch of initialization tasks > > right after django startup. > > There really is no such thing as "Django startup&qu

how to do something at startup

2007-09-28 Thread Mark Green
hi all, i'm looking for a way to perform a bunch of initialization tasks right after django startup. where would i put such things and how/when are they called? -mark --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Two newform best practice questions

2007-09-26 Thread Mark Green
Hi Joseph, I say thanks for the pointer, too. A quick question (since you seem to be involved with this), is there any reason to have django not prefix the form fields by default with, say, the model-name (so prefix='' or prefix='somethingelse' can still be used if someone doesn't want it that

Re: how to implement "stay logged on this computer until i log out"?

2007-09-24 Thread Mark Green
=res=4=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fdjango-users%2Fbrowse_thread%2Fthread%2F7b65ff5783f71b9c%2Fa4079aa60e7dfa37=GFT3Ro7tOKGegAPn49C_BA=AFQjCNHCE35TvLu4ZdYy1SklwYZh8b_wqg=fPsOuIxzECnESDy_ZtHWqg > > -joe > > On 9/23/07, Mark Green <[EMAIL PROTECTED]> wrote: > > > &

how to implement "stay logged on this computer until i log out"?

2007-09-23 Thread Mark Green
Hi list, I would like to have sessions normally timeout after 8 hours, that is easily achieved by setting SESSION_COOKIE_AGE in settings.py. But additionally I'd like to provide a checkbox to "stay logged in on this computer until i log out" which shall make the session immortal (remove

Re: choices/ and getting rid of the dashes?

2007-09-23 Thread Mark Green
ial when calling your form class. > > formClass = forms.form_for_model(Person) > form = formClass(initial={'gender': 'm'}) > > On Sep 6, 4:31 pm, Mark Green <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > This is my model: > > > > class Person(mode

Re: Form field deletion

2007-09-07 Thread Mark Green
On Fri, Sep 07, 2007 at 03:24:46PM -0500, jake elliott wrote: > > Oleg Korsak wrote: > >> Sure - use the 'fields' option to specify the subset of model fields > >> you want to use on the form. > >> > > form_for_instance() got an unexpected keyword argument 'fields' > > > > this argument to

choices/ and getting rid of the dashes?

2007-09-06 Thread Mark Green
Hi all, This is my model: class Person(models.Model): GENDER_CHOICES = ( ( 'm', 'Male' ), ( 'f', 'Female' ), ) gender = models.CharField( blank=False, "gender", maxlength=1, choices=GENDER_CHOICES, default='m' ) Using form_for_model() on the above model results