Re: Newforms and hidden fields

2007-01-05 Thread Adrian Holovaty
On 1/5/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: For a contact form, I think it would be a common use-case that you would want to pre-populate name and email address if you were registered. In fact, I'm trying to do this right now and don't see an easy way to do it without subclassing t

Re: Newforms and hidden fields

2007-01-05 Thread [EMAIL PROTECTED]
Ooops. I see that Russell beat me to the punch. Either way it's good to see that we both came up with similar approaches to solving the problem. Surely that counts for something ;) -Chris --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: Newforms and hidden fields

2007-01-05 Thread Russell Keith-Magee
On 1/6/07, Adrian Holovaty <[EMAIL PROTECTED]> wrote: On 1/5/07, Honza Král <[EMAIL PROTECTED]> wrote: > see the 'initial' parameter for field... > it is failry new, so you might want to run svn up... Yes, and I just added documentation for that feature last night: http://www.djangoprojec

Re: Newforms and hidden fields

2007-01-05 Thread [EMAIL PROTECTED]
If Waylan's approach is incorrect, then what would be the preferred manner to pre-populate dynamic data? For a contact form, I think it would be a common use-case that you would want to pre-populate name and email address if you were registered. In fact, I'm trying to do this right now and don'

Re: Newforms and hidden fields

2007-01-05 Thread Waylan Limberg
On 1/5/07, Waylan Limberg <[EMAIL PROTECTED]> wrote: Prior to `initial` being available, I created a static (although is could be a dynamically populated) dict, and passed that in when initializing a blank form. Being I never validated the form, no errors appeared. So that is another option. I

Re: Newforms and hidden fields

2007-01-05 Thread Adrian Holovaty
On 1/5/07, Waylan Limberg <[EMAIL PROTECTED]> wrote: > The immediate use case for me is hidden fields. The user can't fill in > a hidden field, so this data must come from the form initialization; > but if you provide a sparse data set on initialization, the first > presentation of the form will

Re: Newforms and hidden fields

2007-01-05 Thread Waylan Limberg
On 1/5/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: Hi All, I've been using newforms in anger recently, and I've hit a bit of a hurdle. There might be an obvious way around this, but I can't see it. If you define a form, you can instantiate it with no data, or you can instantiate it wit

Re: Newforms and hidden fields

2007-01-05 Thread Adrian Holovaty
On 1/5/07, Honza Král <[EMAIL PROTECTED]> wrote: see the 'initial' parameter for field... it is failry new, so you might want to run svn up... Yes, and I just added documentation for that feature last night: http://www.djangoproject.com/documentation/newforms/#initial Adrian -- Adrian Ho

Re: Newforms and hidden fields

2007-01-05 Thread Honza Král
see the 'initial' parameter for field... it is failry new, so you might want to run svn up... On 1/6/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: Hi All, I've been using newforms in anger recently, and I've hit a bit of a hurdle. There might be an obvious way around this, but I can't see

Newforms and hidden fields

2007-01-05 Thread Russell Keith-Magee
Hi All, I've been using newforms in anger recently, and I've hit a bit of a hurdle. There might be an obvious way around this, but I can't see it. If you define a form, you can instantiate it with no data, or you can instantiate it with complete data (binding the form). However, what if you onl

Re: Handling bad URLs

2007-01-05 Thread James Bennett
Or, maybe, a better solution would be to keep the distinction (since it is useful for debugging) but rename it. The core problem, I think, is that Django is primarily used for web applications, which means that everything revolves around HTTP request/response cycles. And in that context, "does n

Re: Handling bad URLs

2007-01-05 Thread James Bennett
On 1/5/07, Adrian Holovaty <[EMAIL PROTECTED]> wrote: No can do -- that would couple the database layer to HTTP, which wouldn't be a good thing. I wonder, though, if this is a case of practicality beating purity; also, it's incredibly ugly to raise an exception that says "I couldn't find what

Re: Recommended way to connect Oracle Databases

2007-01-05 Thread Michael van der Westhuizen
Hi, On 1/5/07, vizcayno <[EMAIL PROTECTED]> wrote: [snip discussion of "lite" connection strings vs. TNS] To properly specify a database connection you'd also need provision for a port number (the listener port). While that seems like a reasonable idea, TNS is a better mechanism as it abstra

Recommended way to connect Oracle Databases

2007-01-05 Thread vizcayno
Hello: Assuming I have an Oracle database with next connection info: user = scott pass = tiger host = Oracle host Name or IP address ORCL = Name of database with no tnsnames.ora file 1) From command line I can do: sqlplus scott/[EMAIL PROTECTED]/ORCL 2) From a Python script: import

Re: Problems with site domain in Admin interface

2007-01-05 Thread James Bennett
On 1/5/07, Tool69 <[EMAIL PROTECTED]> wrote: Thank you Baxter, you avoid me a big waste of time and effort. I was studing my Django code, and couldn't find the answer. The problem was solved in changing kib2.webfactionnal.com to 1, as you said. Cross-posting this to django-developers because I