Re: [web2py] consider adding a div around error message

2012-06-21 Thread Paolo Caruccio
I usually make my customization of the form errors trough the controller. For example in your case I would do: form = SQLFORM(db.mytable,formstyle = 'divs') if form.process().accepted: response.flash = 'form accepted' elif form.errors: for fieldname in form.errors:

[web2py] Re: how to limit a label width in a form?

2012-06-22 Thread Paolo Caruccio
Try to apply on label this css rule: white-space: pre-wrap; The white-space property is supported in all major browsers. ( http://www.w3schools.com/cssref/pr_text_white-space.asp) Il giorno venerdì 22 giugno 2012 15:35:18 UTC+2, Marco Prosperi ha scritto: > > > hi all, I would like to limit the

[web2py] Re: bootstrap carousel web2py Nightly build

2012-06-24 Thread Paolo Caruccio
LightDot, thank you. Il giorno sabato 23 giugno 2012 04:38:47 UTC+2, LightDot ha scritto: > > Hi Paolo, > > you're quite right about the amount of work needed to spot and properly > resolve such css collisions. There are quite a few left too... I'm working > on seve

[web2py] Re: external link in menu with target option

2013-01-11 Thread Paolo Caruccio
While waiting web2py developers solve the issue, you could simply comment the line in web2py_bootstrap.js and see if all works as expected. In javascript a code line is commented when you put before it "//", so the interested line becomes: // jQuery('ul.nav li.dropdown a').click(function(){win

Re: [web2py] Set up of db.py takes too long time

2013-01-15 Thread Paolo valleri
Try to add lazy_tables=True to DAL. Like: db = DAL('sqlite://storage.sqlite', migrate=False, lazy_tables=True) Paolo On Tuesday, January 15, 2013 10:06:03 AM UTC+1, Daniel Gonzalez wrote: > > No imports in the code-area profiled. Also, I am testing some requests, > but the

[web2py] Re: Auth with migrate=False

2013-01-15 Thread Paolo valleri
is on the db definition. db = DAL('postgres://web2py:web2py@localhost:5432/traffic', migrate=False, lazy_tables=True, ) Paolo On Tuesday, January 15, 2013 11:38:49 AM UTC+1, Niphlod wrote: > > migrate=False is on the db or on Auth define_table() call ? > > > > Il gi

Re: [web2py] Re: Auth with migrate=False

2013-01-15 Thread Paolo valleri
x27; ), auth.signature, on_define = lambda table: [ table.route_id.set_attributes(readable = False, writable = False), ] ) Paolo On Tuesday, January 15, 2013 3:10:32 PM UTC+1, Anthony wrote: > > Good point. Even better, use lazy_tables. You should also compile the app. >

[web2py] auth.wiki menu

2013-01-15 Thread Paolo valleri
menu.py? Thanks, Paolo --

[web2py] Re: How "experimental" is postgis?

2013-01-17 Thread Paolo valleri
r field for the elevation) but also to define 3d polylines. The 2d doesn't work with 3d, the 3d works well with 3d and 2d. The only problem is that the 3d is not backward compatible with existing 2d objects. @Massimo, how would you go with that? Paolo On Thursday, January 17, 2013 10:47:59 AM UT

[web2py] Re: How do you change memcache session expiry?

2013-01-18 Thread Paolo valleri
better to remove from the book the advise of storing the session in memcached unless we find a solution Paolo Il giorno domenica 30 settembre 2012 00:54:03 UTC+2, Robert Clark ha scritto: > > Thanks everyone, have added an issue > http://code.google.com/p/web2py/issues/detail?id=1049 >

[web2py] problems with wiki create

2013-01-20 Thread Paolo valleri
Hi all, I've just updated web2py to trunk and it seems that wiki _create is broken. I got this ticket: Traceback (most recent call last): File "/home/paolo/Dropbox/git/web2py/gluon/restricted.py", line 212, in restricted exec ccode in environment File "/home/paol

[web2py] Re: SQLFORM.factory and uploaded files. where is the link?

2013-01-23 Thread Paolo valleri
add upload=URL('default', 'download') should solve the problem. Paolo On Thursday, January 24, 2013 12:11:33 AM UTC+1, Ramos wrote: > > Hello > I dont know how to show the link to the uploaded files using > SQLFORM.factory > > > my code > > >

[web2py] auth.wiki how to format all fields

2013-01-25 Thread Paolo valleri
as Title, modified_on just to name a few. Checking the code, I figured out that the problem is due to the test: extension==html (see tools.py:5090) Could we return the other fields too? Paolo --

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-25 Thread Paolo valleri
he_servers) cache.ram = cache.disk = cache.memcache but I don't know how to understand the gain of using it. Any idea? paolo On Friday, January 25, 2013 9:51:22 PM UTC+1, Arnon Marcus wrote: > > Oh, and what about memcache? > Can web2py benefit from it? Is there somewhere an explanat

[web2py] Re: auth.wiki how to format all fields

2013-01-27 Thread Paolo valleri
to keep track of that, I have opened an issue http://code.google.com/p/web2py/issues/detail?id=1303 On Friday, January 25, 2013 3:32:55 PM UTC+1, Paolo valleri wrote: > > Dear all, I've just came across the fact that with the following code: > def wiki(): > return auth.

[web2py] Re: auth.wiki how to format all fields

2013-01-27 Thread Paolo valleri
ds can be retrieved; in order to 'format' better the wiki page, it would be nice to have at least information such as the fields title and modified_on. paolo On Sunday, January 27, 2013 4:56:51 PM UTC+1, Massimo Di Pierro wrote: > > I do not fully understand the issue. Can you

[web2py] Re: Howto Multi file uploader

2013-01-30 Thread Paolo valleri
I don't think you will find something out-of-the-box. However, I advice you to start from here: http://malsup.com/jquery/form/ On Wednesday, January 30, 2013 10:48:57 AM UTC+1, Ramos wrote: > > Hello, what is the best way to add multi file upload functionality. > > This is very important for me.

[web2py] Re: contribute: db diagram for web2py appadmin

2013-01-31 Thread Paolo Caruccio
mercoledì 30 gennaio 2013 17:23:21 UTC+1, Paolo Caruccio ha scritto: > > I was not able to succesfully install pygraphviz on my windows7 64bit > enviroment but I liked Jose's idea > https://groups.google.com/d/topic/web2py/cFqD1M6rkc8/discussion, so I > wrote a simple add

[web2py] wiki: how to cache media files?

2013-01-31 Thread Paolo valleri
commonly happens with for js or css. Is it a problem of my configuration or of wiki it self? paolo -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email

[web2py] Re: contribute: db diagram for web2py appadmin

2013-02-01 Thread Paolo Caruccio
sed to turn this into an admin plugin and allow appadmin > to access it? > > On Wednesday, 30 January 2013 15:04:06 UTC-6, Paolo Caruccio wrote: >> >> Massimo, >> >> thanks for the compliments and for the suggestions. >> Actually, in my mind the posted co

[web2py] Re: contribute: db diagram for web2py appadmin

2013-02-01 Thread Paolo Caruccio
Jose. thank you too for the amazing idea to draw a graph of the database. I take the opportunity to ask you where I can download a working pygraphviz build for windows. Il giorno giovedì 31 gennaio 2013 23:11:00 UTC+1, Jose ha scritto: > > Very nice. Excellent work Paolo. &g

[web2py] Re: contribute: db diagram for web2py appadmin

2013-02-02 Thread Paolo Caruccio
thank you. package downloaded from [1] setup.py modified following istructions on [2] After setup.py install command all worked fine. Il giorno sabato 2 febbraio 2013 14:03:09 UTC+1, Jose ha scritto: > > > > El viernes, 1 de febrero de 2013 15:50:43 UTC-3, Paolo Caruccio escribió

[web2py] Re: contribute: db diagram for web2py appadmin

2013-02-03 Thread Paolo Caruccio
first post updated with latest version. Il giorno venerdì 1 febbraio 2013 21:21:28 UTC+1, Massimo Di Pierro ha scritto: > > Can you post a link to the latest? > > On Thursday, 31 January 2013 08:31:53 UTC-6, Paolo Caruccio wrote: >> >> first post updated:

[web2py] Re: login by ajax

2013-02-18 Thread Paolo valleri
+1 for auth,ajax_login() paolo On Monday, February 18, 2013 4:50:20 AM UTC+1, Massimo Di Pierro wrote: > > Should we offer something like {{=auth.ajax_login()}} helper which submits > to /user/login? If would not be difficult to write. > How should it work? > > > >

[web2py] Re: [Newbee] - Error message with plugin_Wiki : 'auth' not defined

2013-02-20 Thread Paolo valleri
Hi Pibol, plugin_wiki is now deprecated, use auth.wiki() instead. http://web2py.com/books/default/chapter/29/03?search=auth.wiki#The-built-in-web2py-wiki paolo On Wednesday, February 20, 2013 3:17:42 PM UTC+1, open...@gmail.com wrote: > > Hi all, > > I am beginner in Web2Py and I lik

Re: [web2py] Re: Scheduler: new plugin cs_plugin_monitor

2013-02-25 Thread Paolo valleri
Really nice job, +1 for shipping this with web2py. paolo On Sunday, February 24, 2013 3:34:03 PM UTC+1, Massimo Di Pierro wrote: > > I think this plugin should ship with web2py. ;-) > > On Sunday, 24 February 2013 07:28:11 UTC-6, Niphlod wrote: >> >> spoilers here >&

[web2py] Re: [newbee] Wiki_plugin - WidgetBuilder-jqgrid : How to link data from db to jqgrid

2013-02-26 Thread Paolo valleri
Hi Bruno, plugin_wiki is deprecated and it has been replaced by auth.wiki, have a look here: http://web2py.com/books/default/chapter/29/03?search=auth.wiki#The-built-in-web2py-wiki Paolo On Tuesday, February 26, 2013 5:09:06 PM UTC+1, open...@gmail.com wrote: > > Hi, > > I am new o

[web2py] Re: SQLFORM in Bootstrap modal

2013-02-26 Thread Paolo valleri
n adding just a few jquery lines that fire the click event to the original sumbit when the modal submit is clicked. This approach is not clear at all, it works though, Something better would be nice to come. Paolo On Wednesday, February 27, 2013 3:59:36 AM UTC+1, Vincenzo Ampolo wrote: > >

[web2py] Re: Optimising caching and enabling gzip for web2py on heroku?

2013-03-03 Thread Paolo valleri
w the browser cache, in this case the 'somehow' is not clear to me yet. Paolo On Sunday, March 3, 2013 5:51:29 AM UTC+1, Alec Taylor wrote: > > Going through the Google PageSpeed Insights report > (https://developers.google.com/speed/pagespeed/insights) to see what I > sho

[web2py] Re: web2py 2.4.2 is OUT

2013-03-03 Thread Paolo valleri
Good works, I will try it later today. I don't know if you have already discussed about that, just in case, I would suggest to start the use of git tags so it will be easier to update web2py and keep track of the different releases. Paolo On Monday, March 4, 2013 7:58:19 AM UTC+1, Massi

[web2py] Re: web2py 2.4.2 is OUT

2013-03-05 Thread Paolo Caruccio
to iron but I could not wait any longer. >> >> Changelog: >> >> - 2D GEO API: geoPoint, getLine, geoPolygon >> - support for 'json' field type in DAL >> - schema export with db.as_json/as_xml, thanks Alan >> - graph representation of models &

[web2py] Re: web2py 2.4.2 is OUT

2013-03-06 Thread Paolo Caruccio
l be out shortly describing this version. >>> I am sure there are some corners to iron but I could not wait any longer. >>> >>> Changelog: >>> >>> - 2D GEO API: geoPoint, getLine, geoPolygon >>> - support for 'json' field type in DAL

Re: [web2py] Re: web2py 2.4.2 is OUT

2013-03-06 Thread Paolo Caruccio
8:38:19 PM UTC-7, Massimo Di Pierro wrote: >>>>>>> >>>>>>> The book will be out shortly describing this version. >>>>>>> I am sure there are some corners to iron but I could not wait any >>>>>>> longer. >>&

[web2py] Re: Slow DAL initialization

2013-03-14 Thread Paolo valleri
I am wondering why the pool_size is set to 0 by default http://web2py.com/books/default/chapter/29/06#Connection-pooling Which are the side effect of having something greater than 0? Is not worth to have it set for example as 5 by default? paolo On Thursday, March 14, 2013 2:47:56 PM UTC+1

Re: [web2py] Re: Scheduler: new plugin cs_plugin_monitor

2013-03-15 Thread Paolo valleri
"/home/pvalleri/src/web2py/gluon/dal.py", line 8443, in insert ret = self._db._adapter.insert(self, self._listify(fields)) File "/home/pvalleri/src/web2py/gluon/dal.py", line 1201, in insert raise e OperationalError: database is locked Paolo On Thursday, Februar

Re: [web2py] Re: Scheduler: new plugin cs_plugin_monitor

2013-03-16 Thread Paolo valleri
plugin!)? Paolo On Friday, March 15, 2013 11:29:26 AM UTC+1, Niphlod wrote: > > maybe the fact that you're using sqlite :D > If you have a recent sqlite distribution activate the WAL, it can zero out > the issues for normal loads (usually also for low loads SQLite ends up > l

[web2py] Cache performance with computed columns

2013-03-25 Thread Paolo valleri
en when the cache is enabled the first query is taking longer. The question that came to my mind is about computed columns, are they cached? Paolo -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group an

Re: [web2py] Re: Cache performance with computed columns

2013-03-25 Thread Paolo valleri
cache.ram getting: q1: 9.77516174316e-06 q2: 0.00217413902283 q1: 1.62124633789e-05 q2: 0.00206780433655 q1: 8.10623168945e-06 q2: 0.00120091438293 Given that, in a local env cache.ram is faster than memcache. Paolo On Monday, March 25, 2013 11:54:07 AM UTC+1, Niphlod wrote: > > well, when

[web2py] scheduler sincronization

2013-03-25 Thread Paolo valleri
e a way to impose more accuracy ? paolo -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more

Re: [web2py] Re: scheduler sincronization

2013-03-26 Thread Paolo valleri
problem or something different. Do you think that should be fixed by using a different db engine? Paolo On Tuesday, March 26, 2013 12:42:14 PM UTC+1, Niphlod wrote: > > with the default logging.conf the timestamp is present as in all other > web2py-related logging > > PS: ar

Re: [web2py] Re: scheduler sincronization

2013-03-26 Thread Paolo valleri
> I find hard to believe that with a single worker, with that function that > basically just prints something and an execution every 300 seconds the > problem lies into a lock, unless the SQLite library available on your > system is reallly old. > > On Tuesday, March 26, 2013 2

[web2py] Re: Just knew about Server-Sent Events and want to share it with you

2013-04-05 Thread Paolo Caruccio
Well, I just tested version 2.4.5 Stable ts 2013.04.04.21.10.38 and all worked for me. What issue have you encountered? Anyway, the code was and is experimental (for example it doesn't work on IE). If do you want something more tested please try comet messaging included in web2py as Derek sugge

[web2py] Re: Server-Sent Events

2013-04-08 Thread Paolo Caruccio
When I wrote the small app "SSE_clock" I was searching a replacement for a "long polling javascript code" that I was using in order to push db's table update notifications to clients. I abandoned the project by lack of browser's support. Anyway, the application is a simple translation from php t

Re: [web2py] Re: Server-Sent Events

2013-04-09 Thread Paolo Caruccio
just a crazy question: what about if you wrap the eventsource in a web worker? Il giorno martedì 9 aprile 2013 22:56:51 UTC+2, Arnon Marcus ha scritto: > > The first yield WILL block the thread, but as you say, only the thread of > that connection. So the inter-thread communication would then be

[web2py] Re: help with css

2013-04-14 Thread Paolo Caruccio
The first behavior (a small button is shown on narrow screen) is normal. The second no. Original behavior was to show all submenu when you clicked on small button. You could check this on web2py 2.3.0. Something broke this I'll investigate and submit a patch asap. Il giorno sabato 13 aprile 201

[web2py] Re: help with css

2013-04-14 Thread Paolo Caruccio
ad to side effects. Il giorno domenica 14 aprile 2013 16:52:03 UTC+2, Massimo Di Pierro ha scritto: > > Can we increase width that triggers the first behavior (small button)? > > On Sunday, 14 April 2013 05:06:01 UTC-5, Paolo Caruccio wrote: >> >> The first behavior (a smal

[web2py] Re: css-menu

2013-04-14 Thread Paolo Caruccio
The Niphlod's solution is better but add following rules .navbar-inverse .navbar-inner { background-color:green; background-image:none; } .navbar-inverse .nav>li>a { color:red; } to the section "other rules" in web2py_bootstrap.css for a very fast and not complete customization. Il giorno d

[web2py] Re: Where do I change the size of the editor object in admin?

2013-04-14 Thread Paolo Caruccio
A possible solution in order to hide the small vertical scrollbar displayed when the page is loaded: in applications/admin/static/codemirror/lib/codemirror.css please change line 13 from height: 300px; to height: auto; the css rule after the change will be: .CodeMirror-scroll { overflow: aut

[web2py] Re: Where do I change the size of the editor object in admin?

2013-04-14 Thread Paolo Caruccio
No. My previous solution doesn't work in all circumstances. The problem is more complex and involves the javascript code. Il giorno lunedì 15 aprile 2013 00:35:19 UTC+2, Paolo Caruccio ha scritto: > > A possible solution in order to hide the small vertical scrollbar > displayed wh

[web2py] Re: Help with menu error using web2py 2.0.9

2012-10-02 Thread Paolo Caruccio
If you are interested, here you will find the definition of portable application http://en.wikipedia.org/wiki/Portable_application I repeat, I'm just reporting a method by which I am fine, I'm not making advertising. Il giorno martedì 2 ottobre 2012 16:50:07 UTC+2, JoeCodeswell ha scr

Re: [web2py] New version of bootstrap

2012-10-02 Thread Paolo Caruccio
Richard, the issue has been corrected some time ago. Please check the trunk version. Anyway, you could replace .icon-white{background-image:url("../images/glyphicons-halflings-white.png" );} /* right folder for bootstrap white images/icons */ with /* right folder for bootstrap white images/ico

Re: [web2py] New version of bootstrap

2012-10-02 Thread Paolo Caruccio
ha scritto: > > Solved > > Thanks Paolo, it was driving me nuts. > > Richard > > On Tue, Oct 2, 2012 at 4:39 PM, Richard Vézina > > > wrote: > >> Thanks Paolo, >> >> It works for welcome. >> >> Still have difficulties with

[web2py] Re: Help with menu error using web2py 2.0.9

2012-10-03 Thread Paolo Caruccio
With "datatable" do you mean that one from datables.net? If yes, I used this guide http://datatables.net/blog/Twitter_Bootstrap_2 and I did not have any problem. Il giorno mercoledì 3 ottobre 2012 02:16:07 UTC+2, apps in tables ha scritto: > > For me, > > The using of datatable will make the m

Re: [web2py] pass a arbitrary html attributes with helpers (bootstrap data-toggle with A() for example)

2012-10-03 Thread Paolo Caruccio
Please put the attribute with the hyphen in a dictionary: UL([ LI(A(l.upper(), _href='#tab1', **{{_data-toggle:'tab'}})) for l inlist_of_letters_required ], _class='nav nav-tabs') >From web2py book http://web2py.com/books/default/chapter/29/5#HTML-helpers: *Instead of a set of unnamed argumen

Re: [web2py] pass a arbitrary html attributes with helpers (bootstrap data-toggle with A() for example)

2012-10-03 Thread Paolo Caruccio
it, I should read the book before sorry! >> >> Richard >> >> >> On Wed, Oct 3, 2012 at 1:33 PM, Paolo Caruccio >> >> > wrote: >> >>> Please put the attribute with the hyphen in a dictionary: >>> >>> UL([ LI(A(l.upper(),

Re: [web2py] Please stop embedding Bootstrap classes in your HTML!

2012-10-04 Thread Paolo Caruccio
I completely agree with everything Niphlod said in his message. Based on my experience, the css file is only a dress for a pre-existing structure in html. Not surprisingly, Niphlod mentioned "zengarden", namely a html template having css selectors already set, to be dressed. In fact, the CSS fram

[web2py] Re: delete posts

2012-10-11 Thread Paolo Caruccio
Sometimes the message was deleted, if I forgot to wrap the code through apposite tool (button with braces symbol) . Maybe for security reasons. Il giorno giovedì 11 ottobre 2012 13:45:31 UTC+2, curiouslearn ha scritto: > > This is perhaps a problem with google groups. Only reasons I am saying

[web2py] Re: grid export button

2012-10-22 Thread Paolo Caruccio
For grid export menu I'm happy with below method In the views/*.html file where is your grid put on top (just below extend layout command) the following code: {{ w2p_grid_tbl = grid.element('table') if w2p_grid_tbl: export_menu = grid.element('div.w2p_export_menu') export_menu_links = export_

[web2py] Re: grid export button

2012-10-22 Thread Paolo Caruccio
**{'_data-toggle':"dropdown"} > ), > UL(*export_menu_items, > _class='dropdown-menu' > ), > _class='w2p_export_menu btn-grou

Re: [web2py] web2py.css and bootstrap

2012-10-22 Thread Paolo Caruccio
The margin is required when the html code is generated by web2py in one string without line breaks and the elements are "inline elements" (as the "input" element is). Please in a view put following code case #1 {{=DIV(INPUT(_type='text',_value='first element'),'\n',INPUT(_type='text',_value='s

[web2py] Re: checking for an empty list

2012-10-24 Thread Paolo Caruccio
web2py is written in Python. In http://www.python.org/dev/peps/pep-0008/ For sequences, (strings, lists, tuples), use the fact that empty sequences > are false. So in your case: if not result: print "No stops" Il giorno mercoledì 24 ottobre 2012 22:33:03 UTC+2, Hector Magnanao ha scrit

[web2py] Re: Formatter and values=None problem

2012-10-25 Thread Paolo Caruccio
Did you try: db.tablename.fieldname.represent= lambda value: value if value else 'NT" ? web2py book reference http://web2py.com/books/default/chapter/29/06?search=represent#Record-representation Il giorno giovedì 25 ottobre 2012 03:20:29 UTC+2, Joe Barnhart ha scritto: > > I have an applicatio

[web2py] Re: Formatter and values=None problem

2012-10-25 Thread Paolo Caruccio
or better def format_function (value) formatted_value = . return formatted_value db.tablename.fieldname.represent= lambda value,row: format_function(value) if value else "Not Standard Time" Il giorno giovedì 25 ottobre 2012 13:31:43 UTC+2, Paolo Caruccio ha scritt

[web2py] Re: grid export button

2012-10-25 Thread Paolo Caruccio
al_export_menu.elements('a') > > export_menu_items = [] > for link in export_menu_links: > item = LI(link) > export_menu_items.append(item) > pass > new_export_menu = DIV( > A( T('Exports'), > SPAN(_class=

[web2py] Re: Formatter and values=None problem

2012-10-25 Thread Paolo Caruccio
Why don't you manage None values in int_to_hms function? Il giorno giovedì 25 ottobre 2012 21:56:17 UTC+2, Joe Barnhart ha scritto: > > Actually Paolo, I have a custom Validator which contains the formatter > function. It is supplied automatically when I use the validator, so I d

Re: [web2py] page min height

2012-10-25 Thread Paolo Caruccio
Bootstrap extensions for footer to stick at the bottom seem to work. http://bootstrapfooter.codeplex.com/ Il giorno giovedì 25 ottobre 2012 23:29:20 UTC+2, Richard ha scritto: > > Forget about the example of the sticky footer I gave... I will be back > with a better implementation. > > There we

[web2py] Re: Formatter and values=None problem

2012-10-26 Thread Paolo Caruccio
in code of the Field class > tests the value for None and then exits before calling my formatter. So it > doesn't matter that my formatter can handle None -- it is never called. > > That's why I posted the change to the Field class in the first message of > this thread.

Re: [web2py] really hard using bootstrap input-append and add-on because of web2py error mechanism

2012-10-29 Thread Paolo Caruccio
another workaround (without jquery) is (exemplifying): ''' replace , with your own values ''' ### controller ### def my_controller: form = SQLFORM(db.my_table,formstyle = 'bootstrap') if form.process().accepted: response.flash = 'form accepted' elif form.errors: response.flash = 'form has er

[web2py] Re: Reading a text file after uploading in a form

2012-11-01 Thread Paolo Caruccio
a simple skeleton code (please check for errors): def page_controller(): form = FORM( TABLE ( TR( TD(LABEL('Upload File:')), TD(INPUT(_type='file', name='myfile', id='myfile', requires=IS_NOT_EMPTY())) ), TR( TD(INPUT(_type='submit',_value='Submit')) ) ) ) txt_content[] if form.process().accepted

[web2py] Re: Icons/ imgs rather than labels for Grid headers

2012-11-04 Thread Paolo Caruccio
Tables and grids have a "headers" parameter. It's a dictionary where the key is the header in the form "tablename.fieldname" and value is the header representation. For example with: headers = dict((str(header), B(EM(header.label))) for header in db.tablename ) table = SQLTABLE(rows, headers=hea

[web2py] Re: Icons/ imgs rather than labels for Grid headers

2012-11-04 Thread Paolo Caruccio
Complete example extrapolated from my working code (please adapt it to your needs) : #model db.define_table('t_customer', Field('f_vat', type='string', notnull=True, label=T('VAT Nr.'), length=32, ), Field('f_name', type='string

[web2py] Re: Icons/ imgs rather than labels for Grid headers

2012-11-04 Thread Paolo Caruccio
Not necessarily. You may return in the view only the table with new headers. Following code is not tested, so please check for errors. # controller @auth.requires_login() def customer_select(): f,v = request.args(0), request.args(1) try: query = f and db.t_customer[f] == v or db.t_custome

[web2py] Re: REF: Modal Window: Automatically close and update parent window:

2012-11-08 Thread Paolo Caruccio
a possible solution (skeleton code so please check for errors and omissions): # controllers def companies(): return dict() def add_company(): form = SQLFORM(db.company, formstyle='bootstrap') if form.process().accepted: session.flash = 'form accepted' redirect(URL('a

[web2py] Re: id tag in SQLFORM.grid()

2012-11-08 Thread Paolo Caruccio
In the controller: myGrid = SQLFORM.grid(db.tablename) w2p_grid_tbl = myGrid.element('table') w2p_grid_tbl['_id'] = 'table_id' return dict(grid=myGrid) or in the view: {{extend 'layout.html'}} {{w2p_grid_tbl = grid.element('table')}} {{w2p_grid_tbl['_id'] = 'table_id'}} Il giorno giovedì 8 no

[web2py] Re: xhtml2pdf / pisa in a web2py view

2012-11-11 Thread Paolo Caruccio
did you try appreport (a web2py plugin) https://github.com/lucasdavila/web2py-appreport ? Il giorno domenica 11 novembre 2012 06:39:21 UTC+1, chris_g ha scritto: > > > Has anyone had any luck running Pisa in a web2py view? > I've only had success with using it at the command line: > pisa e

[web2py] Re: Validator on a db subset -- how to?

2012-11-13 Thread Paolo Caruccio
Considering that (http://web2py.com/book/default/chapter/07#Validators) - a w2p validator acts at form level - we can get the value of another field on the form through "request.vars" - in IS_NOT_IN_DB validator, first parameter can be a set of records a possible answer to your question is db.dog

Re: [web2py] delete button + confirm instead of "check to delete" + confirm + submit

2012-11-13 Thread Paolo Caruccio
a possible solution # controller def update_record(): form = crud.update(db.table, request.args(0)) delete_confirmation = T('Are you sure you want to delete this record?') delBtn = A('Delete', _href=URL('delete_record', args=['table', request.arg

Re: [web2py] delete button + confirm instead of "check to delete" + confirm + submit

2012-11-13 Thread Paolo Caruccio
2012 23:11:48 UTC+1, Richard ha scritto: > > Hello Paolo, > > So far I have this: > > form.add_button(T('Delete'), '#', _class='btn-small btn-danger') > delete_confirmation = T('Are you sure you want to delete this > record?')

Re: [web2py] Re: Getting error near "interval_time": syntax error

2012-11-14 Thread Paolo Caruccio
Please try: query = Expression(db,"interval_time < (strftime('%M','now') - strftime('%M', updated_on))") On the page suggested by Niphlod we read: Compute the number of seconds between two dates: SELECT strftime('%s','now') - strftime('%s','2004-01-01 02:34:56'); So by replacing '%s' with '%

[web2py] Re: flash obtained during not entering a value

2012-11-14 Thread Paolo Caruccio
Important advise: use the book as first help. It is a precious information source. From http://web2py.com/books/default/chapter/29/07?search=validators#Validators Built-in validators have constructors that take an optional argument: IS_NOT_EMPTY(error_message='cannot be empty') error_message

[web2py] Re: custom built login form

2012-11-20 Thread Paolo Caruccio
In order to apply attributes to a custom form you have to change form.custom.begin before. The following code should work: #view html {{extend 'layout.html'}} {{ # add class to form form['_class'] = "form-horizontal" # change form.custom.begin form.custom.begin = XML("<%s %s>" % (form.tag, form._

[web2py] Re: changing the look of a form

2012-11-20 Thread Paolo Caruccio
Login form like all web2py forms has an argument 'formstyle' that can take following values 'table3cols', 'table2cols', 'divs', 'ul' and 'bootstrap' Latter is not documented. Therefore, for login form simply apply in your controller (or also in model) but before auth.form call auth.settings.fo

[web2py] Re: custom built login form

2012-11-20 Thread Paolo Caruccio
In this group there are several discussions on this subject (i.e.https://groups.google.com/d/msg/web2py/gLTthVDhqFM/dWldB9xGavgJ ) Search for messages containing the word '_xml' We are replacing the original form.custom.begin value with a new one within which is the '_class' attribute >From web

[web2py] Re: Login error messages

2012-11-21 Thread Paolo Caruccio
>From the book http://web2py.com/books/default/chapter/29/09#Authenticationwe >know that: *The password field of the db.auth_user table defaults to a CRYPT validator* >From http://web2py.com/books/default/chapter/29/09#Customizing-Auth we know also that: *You can add any field you wish, and y

[web2py] Re: I need a bit of Help with a function ! .. please ...

2012-11-22 Thread Paolo Caruccio
Please follow lyn2py's answer and you will be on the right track. def index(): if auth.is_logged_in(): redirect(URL('profile', 'member', args=auth.user_id)) @auth.requires_login() def member(): if int(request.args(0)) == auth.user_id: print 'profile of connected membe

[web2py] Re: datetime delta with Sqlite - how to?

2012-11-24 Thread Paolo Caruccio
As a reference, you can see the example given by Massimo Di Pierro in this post https://groups.google.com/forum/#!msg/web2py/NXhu8PmvHOs/aO-oum4m0NgJ Il giorno sabato 24 novembre 2012 05:36:48 UTC+1, apps in tables ha scritto: > > I am using web2py 2.2.1 . I did import time in db.py > > still the

[web2py] Re: web2py and Internet Explorer 7

2012-11-27 Thread Paolo Caruccio
Patch submitted http://code.google.com/u/102984225811410587490/ to correct following problems in IE7: 1) div.flash width is affected from span floated to right within it 2) dropdown-menu doesn't show due to an unnecessary css rule in web2py_bootstrap.css However, if the SO is windows xp and

Re: [web2py] dashboard using bootstrap

2012-11-29 Thread Paolo Caruccio
other alternatives: https://github.com/HumbleSoftware/Flotr2 http://canvasxpress.org/ http://jsxgraph.uni-bayreuth.de/wp/ I like and use, in combination with web2py, Flot http://www.flotcharts.org/ Il giorno giovedì 29 novembre 2012 21:19:15 UTC+1, Manuele ha scritto: > > Il 29/11/12 17:24, R

[web2py] Re: Change layout from 12 to 6 columns

2012-11-30 Thread Paolo Caruccio
If you don't like .less, you can modify grid system variables trough the web interface at http://twitter.github.com/bootstrap/customize.html and download modded bootstrap files. Il giorno giovedì 29 novembre 2012 23:29:42 UTC+1, Stephen Tanner ha scritto: > > Now that web2py uses bootstrap for

[web2py] Re: getting access to sqlform.grid forms in a view

2012-12-02 Thread Paolo Caruccio
If #article_DTU_Content is a textarea {{results.update_form.element('#article_DTU_Content')['_cols']=300}} should work as well as {{results.update_form.element('#article_DTU_Content')['_rows']=10}} unless you set the element width somewhere. In other words, for example (code from my controlle

[web2py] Re: Setting class for MENU helper

2012-12-02 Thread Paolo Caruccio
You could use also css3 selector :last-child (ie<9 and safari<3.2 doesn't support it) For example, in your css file add: .menu ul li:last-child /*in this way ul.menu direct children are bypassed*/ {/* apply your rules, for example: */ color: red; background-color: yellow; } Il giorno dom

Re: [web2py] Re: dashboard using bootstrap

2012-12-04 Thread Paolo Caruccio
For flot: put in yourapp/static/js jquery.flot.js and jquery.flot.resize.js (for scalability) usage in the view for example {{extend 'layout.html'}} {{=T('My first chart')}} jQuery(document).ready(function() { jQuery.plot(jQuery("#placeholder"), [ {{=data_chart}} ]); //dat

Re: [web2py] web2py 2.3.1?

2012-12-04 Thread Paolo Caruccio
uction. >>> >>> I explained, it may be possible that the problem I face have be not >>> notice by someone who not use the welcome layout or use it with the default >>> bootstrap top nav bar color (black). But the hover of the main entry of the >>> top navbar are not working properly and it can be appreciate when use >>> navbar inverse bootstrap class. The hover sometimes stick other time >>> disappear, etc. >>> >>> Also, when you quit the main entry to go in the submenu, sometime they >>> just close baldly. >>> >>> I try to tweak the script, but I don't understand it pretty well. I will >>> try again. >>> >>> Maybe the one that implement that could have look at it. I think it is >>> Paolo, but I am not sure. >>> >>> Thanks. >>> >>> Richard >>> >>> On Tue, Dec 4, 2012 at 9:56 AM, Massimo Di Pierro >>> >>> > wrote: >>> >>>> he file is there but looks like it was not committed to git. Did you >>>> get from github? >>>> >>> >>> >> > --

[web2py] Re: class nav-collapse in layout.html

2012-12-07 Thread Paolo Caruccio
Nav-collapse is a bootstrap class. Are you using default web2py configuration or have you modified something? I'm on windows7 and all works fine with last trunk. Il giorno venerdì 17 agosto 2012 00:05:09 UTC+2, mweissen ha scritto: > > I have a program with a menu and I tried Firefox and Google

[web2py] Re: class nav-collapse in layout.html

2012-12-08 Thread Paolo Caruccio
Since bootstrap css uses the media-queries, what are your viewport dimensions? Are you using the default web2py configuration? Which is web2py version? Il giorno venerdì 7 dicembre 2012 21:39:05 UTC+1, Luca ha scritto: > > I have the problem that the menus are collapsed even when there is ample

[web2py] Re: Displaying an image

2012-12-08 Thread Paolo Caruccio
please try : import os db.define_table('tutor', Field('user', 'reference auth_user', default=auth.user_id), Field('t_Image', 'upload', uploadfolder=os.path.join(request.folder, 'uploads/profiles'), requires=IS_EMPTY_OR(IS_IMAGE(extensions=('jpeg', 'jpg' , 'png', 'gif', Field('t_Lo

[web2py] Re: New use for detect_record_change=True?

2012-12-09 Thread Paolo Caruccio
For update forms I used the following strategy (maybe hackish but it does its dirty work) The submit button is disabled at start. I added (by the controller) to each form control: - an attribute "initval" containing the stored value - an attribute "isdirty" with default = "false" - an event "on

[web2py] Re: Formstyle="bootstrap" visual problem with "error" flash

2012-12-12 Thread Paolo Caruccio
Yes, there are stylistic reasons. The style is inspired to bootstrap "input with error" example (validation state paragraph in http://twitter.github.com/bootstrap/base-css.html?#forms). You can revert the original error behaviour by adding a comment to the lines from # 56 to # 73 in web2py_boot

[web2py] Re: Formstyle="bootstrap" visual problem with "error" flash

2012-12-12 Thread Paolo Caruccio
I would add also that error shouldn't interfere with the comment span of the control, but I discovered a bug: in web2py_bootstrap.css lines #72 and 73 should be: div.controls .help-inline{color:#3A87AD;} div.controls .error_wrapper + .help-inline {margin-left:-9px;} In this way when an err

Re: [web2py] Re: help please

2012-12-19 Thread Paolo Caruccio
Mine is a very stupid question but sometime... Is there an "active" field in your db tables? Il giorno mercoledì 19 dicembre 2012 16:54:50 UTC+1, Aurelijus Useckas ha scritto: > > Yeah I know.. I have an old backup only :( me bad > > > On Wed, Dec 19, 2012 at 5:51 PM, Mark >wrote: > >> Do you h

<    1   2   3   4   5   6   7   >