How to change the form field's size

156 views
Skip to first unread message

Esteban

unread,
Nov 6, 2011, 6:24:07 PM11/6/11
to Satchmo developers
Hi all!

I need to modify the checkout form (step 1).
It's a simple change: The size for the fields....
…and I'm wondering what's the best way to do it?

I can change the class ContactInfoForm, that's 1 option.
But I think maybe there is another way without need to change the base
class.

…any idea will be appreciated! thanks!

hynekcer

unread,
Nov 17, 2011, 2:53:38 PM11/17/11
to Satchmo developers
The idea is to take a short "Django tutorial", write a similarly
simple application, try to join two chosen smaller downloaded Django
application into one project, try look at Django Cookbook (but skip
all outdated recipes) write a question on paper and look at it after a
wild weekend if you could undersand it clearly and everything would be
four times easier for you and for them who you want ask.

Do you need only to change CSS and template or you lose some last
characters now? This is exactly more basical than the tutorial 1 2 3
4 = 4x half hour reading on https://docs.djangoproject.com/en/1.3/
+ 3x take a break:-)

Esteban

unread,
Nov 17, 2011, 9:44:46 PM11/17/11
to satchmo-d...@googlegroups.com
Doesn't look so basical to me, sorry!
If I'm asking is because I read and I don't find what is the best way to achieve this.

For each form where the field size have to be changed I need to extend the class????? 
No, really I don't think so. 

CSS is not a problem at all, templates I have been doing well but I didn't find there how to change the size for fields defined in a class.

Only thing I found is changing the widgets in the same class but again I don't believe this is the way. 
In the future that class could be changed and I will lose my changes.

...I have been looking for in the Django tutorial and didn't found anything like this.





--
You received this message because you are subscribed to the Google Groups "Satchmo developers" group.
To post to this group, send email to satchmo-d...@googlegroups.com.
To unsubscribe from this group, send email to satchmo-develop...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/satchmo-developers?hl=en.


hynekcer

unread,
Nov 19, 2011, 8:31:46 AM11/19/11
to Satchmo developers
Esteban,
OK. Please, create a virtualenv with a fresh satchmo copy and try a
change it with regard to other users.
Create a patch with modified "forms.CharField(max_length=..." you
think are needed to be changed and explain why by examle. Verify that
it is not more than the field size in the database and that it would
not be trimmed elsewhere. Add some lines to CSS and format that fields
to be not much wide or unarranged in the browser.

It was really silly in satchmo to use the same max_length for form
design and not to use css. I am sorry, I was not aware of that and
therefore I did not understand your first post.

Create an issue for it. Maybe it mostly makes sense to change them all
to be equal related database field max_lenght.

I anticipate: It is not possible to change *database fields*
groundlessly for joy. It requires good discussion with Chris. Every
change - the smallest or big - requires much additional code and all
users must migrate their databases for this. The last example is
https://bitbucket.org/chris1610/satchmo/changeset/7fa34a6569eb.
Further changes should be preferable postponed to be made together in
bulk with finishing list of backward incompatible changes for v.
0.9.2, if possible, and mark them only by TODO comments in models.py
now.

For sure you can write an example patch how laborios it would be for
the developer to change something similarly small in a checkout view
by inconvenient way considered to be recommended.

-- Hynek

On 18 lis, 03:44, Esteban <esteban.ve...@gmail.com> wrote:
> Doesn't look so basical to me, sorry!
> If I'm asking is because I read and I don't find what is the best way
> to achieve this.
>
> For each form where the field size have to be changed I need to extend the
> class?????
> No, really I don't think so.
>
> CSS is not a problem at all, templates I have been doing well but I didn't
> find there how to change the size for fields defined in a class.
>
> Only thing I found is changing the widgets in the same class but again I
> don't believe this is the way.
> In the future that class could be changed and I will lose my changes.
>
> ...I have been looking for in the Django tutorial and didn't found anything
> like this.
>
> On 17 November 2011 19:53, hynekcer <hy...@sdb.cz> wrote:
>
>
>
>
>
>
>
> > The idea is to take a short "Django tutorial", write a similarly
> > simple application, try to join two chosen smaller downloaded Django
> > application into one project, try look at Django Cookbook (but skip
> > all outdated recipes) write a question on paper and look at it after a
> > wild weekend if you could undersand it clearly and everything would be
> > four times easier for you and for them who you want ask.
>
> > Do you need only to change CSS and template or you lose some last
> > characters now? This is exactly more basical than the tutorial 1 2 3

> > 4  = 4x half hour reading onhttps://docs.djangoproject.com/en/1.3/

Reply all
Reply to author
Forward
0 new messages