Ok, thank you for the answer. I am using newforms with an older django
codebase so thats why I ran into this.
On Jan 9, 3:38 pm, "Adrian Holovaty" <[EMAIL PROTECTED]> wrote:
> On 1/9/07, serbaut <[EMAIL PROTECTED]> wrote:
>
> > fields.py tries to get settings.URL_VALIDATOR_USER_AGENT with:
>
> >
Adrian Holovaty wrote:
> The try/except in this case is meant to handle the case in which
> somebody is using newforms without the rest of Django, which was an
> early goal of mine. Since then, I've sort of resigned myself to
> requiring Django, due to ties into the internationalization hooks and
On 1/9/07, serbaut <[EMAIL PROTECTED]> wrote:
> fields.py tries to get settings.URL_VALIDATOR_USER_AGENT with:
>
> try:
> from django.conf import settings
> URL_VALIDATOR_USER_AGENT = settings.URL_VALIDATOR_USER_AGENT
> except ImportError:
> # It's OK if Django settings aren't configur
fields.py tries to get settings.URL_VALIDATOR_USER_AGENT with:
try:
from django.conf import settings
URL_VALIDATOR_USER_AGENT = settings.URL_VALIDATOR_USER_AGENT
except ImportError:
# It's OK if Django settings aren't configured.
URL_VALIDATOR_USER_AGENT = 'Django (http://www.djan
Adrian,
I think rassilon is talking about something like "help_text".
I've seen this discussed before... both here and on django-users.
As a result, I've created a patch that has been posted to trac. [1]
-Ben
[1] http://code.djangoproject.com/ticket/3255
On 1/8/07, Adrian Holovaty <[EMAI
On 1/8/07, rassilon <[EMAIL PROTECTED]> wrote:
One issue i have with new forms is that there is no detail/description
space for the forms, it would be really useful, since at the moment,
rather than being able to use the automatic generation methods, i have
to write custom templates for each for
One issue i have with new forms is that there is no detail/description
space for the forms, it would be really useful, since at the moment,
rather than being able to use the automatic generation methods, i have
to write custom templates for each form with the labels in (or use an
ugly hack to pul
On 12/5/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote:
> Adrian Holovaty wrote:
> > This is an interesting problem. That template fix would be OK by me,
> > but it's sort of a hack. I think we're going to run into similar
> > issues with Form.__str__() returning a Unicode object. Maybe, as you
> > s
Adrian Holovaty wrote:
> This is an interesting problem. That template fix would be OK by me,
> but it's sort of a hack. I think we're going to run into similar
> issues with Form.__str__() returning a Unicode object. Maybe, as you
> suggest, Form.__str__() should return a bytestring according to
Adrian Holovaty wrote:
> On 12/1/06, Gábor Farkas <[EMAIL PROTECTED]> wrote:
>> what about the following change?:
>>> if not isinstance(output, basestring):
>>> -return str(output)
>>> +try:
>>> +return str(output)
>>> +except UnicodeEnc
On 12/1/06, Gábor Farkas <[EMAIL PROTECTED]> wrote:
> what about the following change?:
> > if not isinstance(output, basestring):
> > -return str(output)
> > +try:
> > +return str(output)
> > +except UnicodeEncodeError:
> > +
On Nov 30, 6:31 pm, "Adrian Holovaty" <[EMAIL PROTECTED]> wrote:
> The django.newforms library is getting more solid by the day, and I'm
> using it for some personal and work projects. Real-world use has
> helped me find and fix problems with it, and I'm pretty happy with how
> things have turned
Another (sorry, I'm pretty sure this is my last today).
A label keyword would be great for specifying the label for the field.
password2 = CharField(widget=PasswordInput, label="Password (again):")
Would render:
Password (again):
--~--~-~--~~~---~--~~
You recei
One other thing:
-- newforms/forms.py - line 40 --
def __init__(self, data=None, auto_id=False): # TODO: prefix stuff
self.ignore_errors = data is None
Change to:
def __init__(self, data=None, auto_id=False): # TODO: prefix stuff
self.ignore_errors = not bool(data)
That way yo
On 12/1/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote:
>
> Honza Král wrote:
> > I get a ProgrammingError, the SQL command is missing quotes around the
> > value in question. I worked around this using str(
> > form.clean()['form_field'] ), but that doesn't strike me as very nice.
>
> As far as I rem
Awesome. I approve. I'm warming to the whole "Widget" thing.
Although I hate that name, as it's specifically nondescript, I can't
think of another.
Some comments:
I'd like to see auto_id default to "id_%s" rather than False. Why not
just give it as the default?
I love clean_XXX(), and clean()
On 12/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> If there's one more suggestion that I can make...when creating models,
> there's a separate CharField and TextField. In newforms, it seems that
> there's no such distinction, so an as_textarea function determines its
> display (if I'm see
Adrian Holovaty wrote:
> I think you may be missing something. :) A Form is a collection of
> Fields, which are validation / data types. Each Field has a Widget,
> which is an HTML representation of the field.
Got it now, thanks, and newforms is really shaping up to be great. :)
If there's one m
On 12/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Maybe I'm missing something, but is there any way to associate a Widget
> with a Form, or do those need to be instantiated separately?
>
> In all of the unit tests, the Forms only consist of a collection of
> Fields, but in almost every us
Adrian Holovaty wrote:
> So, then, I'd encourage everybody to play around with django.newforms
> and post a message if you have any issues or thoughts. There is no
> formal documentation, but the unit tests are *quite extensive* and
> serve as pretty good documentation. The unit tests live in the
Adrian Holovaty wrote:
> On 11/30/06, gabor <[EMAIL PROTECTED]> wrote:
>> but if i want to render it in a template and it contains non-ascii text,
>> it fails in /home/gabor/src/django/django/template/__init__.py,
>> line 745, UnicodeEncodeError.
>>
>> the code there calls str() on the form, and i
Honza Král wrote:
> I get a ProgrammingError, the SQL command is missing quotes around the
> value in question. I worked around this using str(
> form.clean()['form_field'] ), but that doesn't strike me as very nice.
As far as I remember psycopg2 does correctly accept unicode strings. You
can ju
On 11/30/06, Honza Král <[EMAIL PROTECTED]> wrote:
> great work on those forms, I really like them, thanks.
> I am currently using them for a few projects and am delighted with them.
>
> I am also facing some UNICODE issues, when saving into a database
> (postgres), the backend fails to quote the
On 11/30/06, gabor <[EMAIL PROTECTED]> wrote:
> but if i want to render it in a template and it contains non-ascii text,
> it fails in /home/gabor/src/django/django/template/__init__.py,
> line 745, UnicodeEncodeError.
>
> the code there calls str() on the form, and it's a problem because it
> cal
Hi Adrian,
great work on those forms, I really like them, thanks.
I am currently using them for a few projects and am delighted with them.
I am also facing some UNICODE issues, when saving into a database
(postgres), the backend fails to quote the values from the form
correctly (field is a charfie
Adrian Holovaty wrote:
> Hi all,
>
> The django.newforms library is getting more solid by the day, and I'm
> using it for some personal and work projects. Real-world use has
> helped me find and fix problems with it, and I'm pretty happy with how
> things have turned out.
>
> So, then, I'd encou
26 matches
Mail list logo