This should work..
# On models
class SQLFORM(SQLFORM):
''' Customized SQLFORM '''
def __init__(self, *args, **kwargs):
kwargs.setdefault("formstyle", "divs")
super(MySQLFORM, self).__init__(*args, **kwargs)
On Sun, Sep 2, 2012 at 8:11 PM, vinicius...@gmail.com
<mailto:vinicius...@gmail.com> <vinicius...@gmail.com
<mailto:vinicius...@gmail.com>> wrote:
Anthony, another one would be hide_error.
These are settings affect app style of visualization and user
interaction. So, it makes sense to be defined once and overriden
when necessary.
--
Vinicius Assef
On 09/02/2012 12:34 PM, Anthony wrote:
Are there other examples of potential global configs? For forms,
perhaps
we could set the default via a "formstyle" class attribute,
which you
could then change once in your code.
Anthony
On Sunday, September 2, 2012 11:27:42 AM UTC-4, viniciusban wrote:
I think it would be nice to have some global configs in web2py.
One of them is formstyle.
It's unpleasant to define formstyle in every FORM definition.
This formstyle config could come in db.py like Auth configs.
So, once defined my app formstyle, it should be used as
default. But in
a specific FORM, I could override it, according to my needs.
Any oppinion?
--
Vinicius Assef
On 09/02/2012 12:12 PM, Anthony wrote:
> We also need to document the new formstyle='bootstrap'
option as well as
> the new callable formstyle option that takes the form and
fields and
> builds the entire form DOM.
>
> Anthony
>
> On Saturday, September 1, 2012 5:37:11 PM UTC-4, Massimo
Di Pierro wrote:
>
> These features are now documented in the html book.
Working on more.
>
> [x] Support for DAL(lazy_tables=True) and
> db.define_table(on_define=__lambda table:), thanks
Jonathan
> [x] db(...).select(cacheable=True) make select 30% faster
> [x] db(...).select(cache=(cache.__ram,3600)) now
caches parsed data
> 100x faster
> [x] db(...).count(cache=(cache.__ram,3600)) now supported
> [x] MongoDB support in DAL (experimental), thanks
Mark Breedveld
> [x] db.mytable._before_insert, _after_insert,
_before_update,
> _after_update, _before_delete. _after_delete (list of
callbacks)
> [x] DAL BIGINT support and DAL(...,bigint_id=True)
> [x] IS_IN_DB(..., distinct=True)
> [x] new syntax:
db.mytable.insert(__myuploadfield=open(....)), thank
> you Iceberg
> [x]
db(...).select(db.mytable.__myfield.count(distinct=True))
> [x] teradata adapter, thanks Andrew Willimott
> [x] experimental Sybase Adapter
> [x] added db.table.field.avg()
> [x] Field(... 'upload', default=path) now accepts a
path to a local
> file as default value, if user does not upload a
file. Relative path
> looks inside current application folder, thanks Marin
> [x] executesql(...,fields=,__columns=) allows parsing
of results in
> Rows, thanks Anthony
>
> [x] @auth.requires_login(__otherwise=URL(...))
> [x] CRYPT now defaults to pbkdf2(1000,20,sha1)
> [x] allow storage of uploads on any PyFileSystem
(including amazon)
>
> [x] more export options in SQLFORM.grid and
SQLFORM.smartgrid (html,
> xml, csv, ...)
>
> [x] new layout based on Twitter Bootstrap
> [x] New generic views: generic.ics (Mac Mail
Calendar) and
> generic.map (Google Maps)
> [x] request.args(0,default=0, cast=int,
otherwise=URL(...)), thanks
> Anthony
> [x] redirect(...,type='auto') will be handled
properly in ajax responses
> [x] routes in can redirect outside with
> routes_in=[('/path','303->__http://..')]
> [x] .coffee and .less support in response.files,
thanks Sam Sheftel
> [x] ldap certificate support
> [x] pg8000 postgresql driver support (experimental)
>
> [x] db.table.field.like(...,case___sensitive=False)
(thanks Floyd)
> [x] db.table.field.regexp(...) for sqlite and postgres
> [ ] db(...,ignore_common_filters=__True)
> [x]
db(db.dog_id.belongs(db.dogs.__owner=='james')).select()
> [ ] db(...).select().group_by___value(db.table.field)
(thanks Yair)
> [x] db = DAL('imap://user:password@__server:port')
support (thanks
> Alan Etkin)
> [x] db = DAL('teradata://DSN=dsn;UID=__user;PWD=pass;
> DATABASE=database') (thanks Adrew Willmott)
> [x] db = DAL('mongodb://127.0.0.1:5984/__db
<http://127.0.0.1:5984/db> <http://127.0.0.1:5984/db>
> <http://127.0.0.1:5984/db>') (experimental, thanks
Mark Breedveld)
> [x] db = DAL('cubrid') (experimental)
> [x] db = DAL('postgres:pg8000:...') and
DAL('postgres:psycopg2:...')
> [x] pg8000 now ships with web2py (thanks Mariano)
> [x] reponse.delimiters = ('\\[','\\]') (thanks Denes)
> [x] conditional menu items
> (reponse.menu=[(title,bool,__link,[],condition)]
>
>
>
> I could use some help documenting these features
>
> [ ] geodal and spatialite, thanks Denes and Fran
(experimental)
> [ ] Support for Google App Engine projections, thanks
Christian
> [ ] Scheduler Improvements (thanks to niphlod,
ykessler, dhx, toomim)
> [ ] DIV(..).elements(...replace=..__.), thanks Anthony
> [ ] new fpdf, thanks Mariano
> [ ] included web-based debugger (experimental, thanks
Mariano)
> [ ] pluralization system (Vladyslav)
> [ ] T.M helper (Vladyslav)
>
>
> Eventually some of the new features require a loger
discussion in a
> blog-like fashion than just a mention and a short
example in the book.
>
>
> --
>
>
>
--
--
--