Re: Re: Default representation of a Form

2006-12-11 Thread Benjamin Slavin
On 12/11/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > This is an interesting idea, but I think it's important to remember > the as_p(), as_table() and as_ul() shortcut methods are just > *shortcuts*. There's nothing stopping a developer from writing a > custom method on a Form, nor is there an

Re: Default representation of a Form

2006-12-11 Thread Gábor Farkas
Adrian Holovaty wrote: > On 12/10/06, Gary Wilson <[EMAIL PROTECTED]> wrote: >> What if instead of adding various as_* methods that we have a >> FormFormatter class that determines how the form displays. The >> _html_output and as_* methods would become FormFormatters. Formatter >> could be a p

Re: Default representation of a Form

2006-12-10 Thread Adrian Holovaty
On 12/10/06, Gary Wilson <[EMAIL PROTECTED]> wrote: > What if instead of adding various as_* methods that we have a > FormFormatter class that determines how the form displays. The > _html_output and as_* methods would become FormFormatters. Formatter > could be a parameter to the Form construc

Re: Default representation of a Form

2006-12-10 Thread Gary Wilson
Lachlan Cannon wrote: > Lakin Wecker wrote: > > as_dl() gets a +1 from me. I've used definition lists for forms and > > prefer it over tables. :) > > Maybe there needs to be an easy hook for people to specify their own way of > laying a form out. It seems the as_ methods are gonna keep growing an

Re: Re: Default representation of a Form

2006-12-07 Thread Adrian Holovaty
On 12/7/06, Waylan Limberg <[EMAIL PROTECTED]> wrote: > But looking at the code, the error string is passed in first > regardless of whether `errors_on_separate_row` or not. Perhaps > `_html_output()` should use the optional mapping key for string > substitution [1]. Hey, that's a really good sug

Re: Re: Default representation of a Form

2006-12-07 Thread Waylan Limberg
Adrian, excellent job abstracting the common code into `Form._html_output()`. Now, anyone can write there own `as_method()` as a one-liner - with one minor problem... On 12/7/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 12/1/06, James Bennett <[EMAIL PROTECTED]> wrote: > > So maybe an as

Re: Default representation of a Form

2006-12-06 Thread Adrian Holovaty
On 11/30/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > A new Form class' default representation (that is goes out of `print f`) > is an HTML table. For those who cares about that proverbial 'semantics' > thing this looks wrong. From the practical point of view it's also not > very convenient sinc

Re: Re: Default representation of a Form

2006-12-06 Thread Adrian Holovaty
On 12/1/06, James Bennett <[EMAIL PROTECTED]> wrote: > So maybe an as_dl() method needs to go in? With as_dl(), how would error messages be displayed? Adrian -- Adrian Holovaty holovaty.com | djangoproject.com --~--~-~--~~~---~--~~ You received this message be

Re: Default representation of a Form

2006-12-05 Thread Adrian Holovaty
On 12/5/06, Lachlan Cannon <[EMAIL PROTECTED]> wrote: > Lakin Wecker wrote: > > as_dl() gets a +1 from me. I've used definition lists for forms and > > prefer it over tables. :) > > Maybe there needs to be an easy hook for people to specify their own way of > laying a form out. It seems the as_ m

Re: Default representation of a Form

2006-12-05 Thread Lachlan Cannon
Lakin Wecker wrote: > as_dl() gets a +1 from me. I've used definition lists for forms and > prefer it over tables. :) Maybe there needs to be an easy hook for people to specify their own way of laying a form out. It seems the as_ methods are gonna keep growing and growing. -- Lach Personal: h

Re: Re: Default representation of a Form

2006-12-04 Thread Lakin Wecker
as_dl() gets a +1 from me. I've used definition lists for forms and prefer it over tables. :) Lakin On 12/1/06, James Bennett <[EMAIL PROTECTED]> wrote: > > > On 12/1/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > > I agree that laying out a form with CSS is not a very clean thing. But > > it do

Re: Re: Default representation of a Form

2006-12-01 Thread James Bennett
On 12/1/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > I agree that laying out a form with CSS is not a very clean thing. But > it does give you a way to change the layout with just CSS (like moving > labels to the left or to the top of a field). And with tables you can't > do it in practice. It

Re: Default representation of a Form

2006-12-01 Thread Brantley Harris
Bah. I wish all the browsers supported "display: table-cell", that would take care of all of this nonsense. On 12/1/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > > Brantley Harris wrote: > > Maybe good practice, but not practical. I'd love to not have to use > > tables. But practical CSS just

Re: Default representation of a Form

2006-12-01 Thread Ivan Sagalaev
Brantley Harris wrote: > Maybe good practice, but not practical. I'd love to not have to use > tables. But practical CSS just isn't there yet. Many web sites prove otherwise though :-) > Yes, tables aren't > good for general layout, but they still have their uses, and forms are > a prime examp

Re: Default representation of a Form

2006-12-01 Thread Waylan Limberg
Brantley Harris wrote: > Maybe good practice, but not practical. I'd love to not have to use > tables. But practical CSS just isn't there yet. Yes, tables aren't > good for general layout, but they still have their uses, and forms are > a prime example. > A table's uses generally consist of

Re: Default representation of a Form

2006-12-01 Thread Brantley Harris
Maybe good practice, but not practical. I'd love to not have to use tables. But practical CSS just isn't there yet. Yes, tables aren't good for general layout, but they still have their uses, and forms are a prime example. On 11/30/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > I would say not

Re: Default representation of a Form

2006-11-30 Thread Ivan Sagalaev
Adrian Holovaty wrote: > I like the output, > but I can definitely appreciate the argument for using s instead. I would say not using tables for layout may count as a good practice like encouraging clean URLs, proper distinction of GET and POST etc. --~--~-~--~~~---

Re: Default representation of a Form

2006-11-30 Thread Adrian Holovaty
On 11/30/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > A new Form class' default representation (that is goes out of `print f`) > is an HTML table. For those who cares about that proverbial 'semantics' > thing this looks wrong. From the practical point of view it's also not > very convenient sinc