[web2py] Re: [py4web] - how to disable some auth actions?

2020-03-28 Thread Paolo Caruccio
In my case I only need login and logout.
The creation of an account will be done by other users with privileges 
established by the administrators. The modification of the profile will 
also be done partially by the user himself (change password, change email, 
add / change personal data etc) who has the account enabled and is already 
logged in.
Obviously I can delete all links and specific functions from the frontend, 
as well as I can require to approve any registration made from the outside 
but it would be more secure to also do a server-side prevention by 
disabling actions that do not need.


Translated with www.DeepL.com/Translator (free version)

Il giorno sabato 28 marzo 2020 20:30:48 UTC+1, Massimo Di Pierro ha scritto:
>
> not possible yet. I can implement it easily but I would like to understand 
> some use cases.
>
> On Saturday, 28 March 2020 10:12:32 UTC-7, Paolo Caruccio wrote:
>>
>> In py4web is there any way to disable some auth actions? I can't find 
>> anything in the code about this.
>>
>> In web2py this is possible via auth.settings.action_disabled
>>
>> For example:
>>
>> auth.settings.action_disabled=['register']
>>
>> prevents the "register" action from working.
>>
>> Tank you.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c6945cf6-c014-4f55-9d12-a55244159f72%40googlegroups.com.


[web2py] [py4web] - how to disable some ayth actions?

2020-03-28 Thread Paolo Caruccio
In py4web is there any way to disable some auth actions? I can't find 
anything in the code about this.

In web2py this is possible via auth.settings.action_disabled

For example:

auth.settings.action_disabled=['register']

prevents the "register" action from working.

Tank you.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/877d4abf-70db-464d-aebf-7479c055bc7b%40googlegroups.com.


[web2py] is field representation changed from web2py 2.14.6?

2018-10-27 Thread Paolo Caruccio
with this model (very simplified)

db.define_table('table1',
Field('first_field'
),
format='%(first_field)s'
)


db.define_table('table2',
Field('field_one'
),
Field('field_two','reference table1'
)



db.table2.field_one.represent = lambda value, row: CAT (row.field_two)

returns

*table1 id *in web2py 2.14.6

and

*table1 first_field* (i.e. table1 format) in web2py 2.17.2

Is this intentional?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py 2.16.1 and login menu on mobile systems NOT WORKING

2018-04-23 Thread Paolo Caruccio
This issue has been already fixed in trunk. Please see:

https://github.com/web2py/web2py/issues/1828

https://github.com/web2py/web2py/issues/1886

If you don't want to download the updated version of layout.html file and 
prefer to manually correct the problem please see 

https://groups.google.com/d/msg/web2py/Am138qbZCuo/TCFOMKRqAgAJ



Il giorno domenica 22 aprile 2018 21:54:06 UTC+2, Andrea Fae' ha scritto:
>
> If you try to use welcome application on web2py 2.16.1 login menu 
> (hamburger icon) is not working. Clicking on it nothing happens...it's 
> a bug.
> Am I right?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: SQL strings and SQLTABLE issue in last web2py release. Is there a solution for it?

2018-03-15 Thread Paolo Caruccio
Leonel's suggestion worked but I had to set the key within headers 
dictionary and column name within column lists of SQLTABLE to 

'''GROUP_CONCAT("RISCHI"."rischio", \', \')'''

However, it seems to me that pyDal accepts SQL strings but it is SQLTABLE 
that doesn't handle them as before. So I have two questions.

1) If pyDal regularly returns the rows of a select containing a SQL string, 
why doesn't SQLTABLE - which should just serialize these in a view - accept 
them?

2) since the problem is generated by the following line

tablemap = dict(((f.tablename, f.table) if isinstance(f, Field) else (f.
_table._tablename, f._table) for f in fieldmap.values()))

In the SQLTABLE class is it doable  to apply the Leonel suggested code or 
to make a fallback to the old working code when f._table is None ?

Thank you for your attention.



Il giorno giovedì 15 marzo 2018 16:02:32 UTC+1, Anthony ha scritto:
>
> On Thursday, March 15, 2018 at 7:59:42 AM UTC-4, Leonel Câmara wrote:
>>
>> I'm going to say it outright I don't think this should be supported.
>>
>> I don't think this should be considered a backwards compatibility 
>> problem, because you're not using the DAL API you're just sending SQL in a 
>> string.
>>
>
> Agreed, it's not strictly a backward compatibility issue. Therefore, we 
> don't necessarily need to restore the old functionality exactly (i.e., 
> allow SQL strings to be passed to .select() and expect SQLTABLE to display 
> the results), but it would be good to provide some means of achieving 
> similar results.
>  
>
>> from pydal.objects import Expression
>> dialect = db._adapter.dialect
>>
>> def group_concat(first, second, query_env={}):
>> return "GROUP_CONCAT(%s, '%s')" % (dialect.expand(first, query_env), 
>> second)
>>
>> rischi_della_mansione = Expression(db, group_concat, db.RISCHI.id, ', ', 
>> 'string')
>>
>>
>> We need to define that the proper way to put custom SQL mixed with DAL 
>> code is using Expression and document how to use it. SQL in strings isn't 
>> acceptable, for that you use executesql.
>>
>
> The above is not part of the DAL public API either, and it is a rather 
> cumbersome way to add custom SQL to a select. So, rather than simply 
> documenting the above, it would be better if we could come up with a 
> simplified API for adding custom SQL expressions to both queries  (i.e., 
> "WHERE" clauses) and selects. In the short term, I suppose we could 
> document the above as a workaround, but I'm not sure we want to commit to 
> that as a public API that must be supported indefinitely (we then lose the 
> freedom to change any of those exposed internal implementation details).
>
> Anthony
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: SQL strings and SQLTABLE issue in last web2py release. Is there a solution for it?

2018-03-14 Thread Paolo Caruccio
Hi Dave.

Yes, I am running on Windows 8 with stand-alone Python. I am using the 
source downloaded from github this evening. The pydal version is 17.11
The same issue is on a production server Ubuntu 16.04 with nginx and uwsgi 
and latest stable version of web2py
The database is SQLite 3 in both configurations.


Il giorno giovedì 15 marzo 2018 00:00:01 UTC+1, Dave S ha scritto:
>
>
>
> On Wednesday, March 14, 2018 at 3:32:46 PM UTC-7, Paolo Caruccio wrote:
>>
>> The relevant code that generates the issue is:
>>
> [...] 
>
>> The traceback screenshot is:
>>
>
>>
>> <https://lh3.googleusercontent.com/-WMtRONVueqU/WqmeVm7gToI/BBs/sAGtbWmUkYw5q71s8Q8rjZJH5VE9EY7EQCLcBGAs/s1600/Screenshot.png>
>>  
>>
>
>> Please note that the code is working well on web2py Version 
>> 2.14.6-stable+timestamp.2016.05.10.00.21.47
>>
>> Has anybody found the same issue and solved it?
>>
>> Thank you.
>>
>>
>>  
> I see you're running on Windows but with a stand-alone Python.  Are you 
> using the source download of web2py?  What version of pydal do you have?
>
> /dps
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] SQL strings and SQLTABLE issue in last web2py release. Is there a solution for it?

2018-03-14 Thread Paolo Caruccio
The relevant code that generates the issue is:



rischi_della_mansione = "GROUP_CONCAT(rischio, ', ')"


l = [db.RISCHI_MANSIONE.on(
(db.RISCHI_MANSIONE.mansione_ID==db.MANSIONE.id)),
 db.RISCHI.on(
(db.RISCHI.id==db.RISCHI_MANSIONE.rischio_ID))
]


mansioni = db((db.MANSIONE.id>0)).select(db.MANSIONE.mansione,
 rischi_della_mansione,
 left=l,
 groupby=db.MANSIONE.id
)


fattori_rischio = SQLTABLE(mansioni,
   truncate=None,
   _id="rischi",
   headers={'MANSIONE.mansione':'MANSIONE',
rischi_della_mansione:'FATTORI DI 
RISCHIO'
},
columns=['MANSIONE.mansione',
 rischi_della_mansione
]
)

The traceback screenshot is:





Please note that the code is working well on web2py Version 
2.14.6-stable+timestamp.2016.05.10.00.21.47

Has anybody found the same issue and solved it?

Thank you.





-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: mobile menu not working?

2018-01-26 Thread Paolo Caruccio
Please try the solution in  https://github.com/web2py/web2py/issues/1828

Regards.

Il giorno venerdì 26 gennaio 2018 18:18:18 UTC+1, Yi Liu ha scritto:
>
> Dear all,
>
> I have latest web2py running at trialert.com
>
> Both my barebone app and welcome app at trialert.com/welcome have problem 
> with mobile theme. The mobile menu at top right corner does not work, not 
> clickable.
>
> Best, Yi
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: nav bar in 2.16.1

2017-12-23 Thread Paolo Caruccio
Regarding the collapsed navbar issue, in the web2py 2.16.1 welcome 
layout.html page is missing the id on the navbar-collapse




Il giorno sabato 23 dicembre 2017 14:12:46 UTC+1, lucas ha scritto:
>
> as I reported when the screen isn't wide enough, it will default to the 
> pull down button, that doesn't work in safari or Firefox.  it also doesn't 
> work on iOS.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: nav bar in 2.16.1

2017-12-23 Thread Paolo Caruccio
In the web2py 2.16.1 welcome layout.html page, in order to move to the 
right the login dropdown, you could apply the bootstrap 4 class mr-auto  to 
the form in navbar



and add the class dropdown-menu-right to the dropdown




Il giorno sabato 23 dicembre 2017 14:12:46 UTC+1, lucas ha scritto:
>
> as I reported when the screen isn't wide enough, it will default to the 
> pull down button, that doesn't work in safari or Firefox.  it also doesn't 
> work on iOS.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: image alt text on hover

2017-12-23 Thread Paolo Caruccio
use the "title attribute"



More info about html "title" 
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title  



Il giorno sabato 23 dicembre 2017 11:21:50 UTC+1, Dave S ha scritto:
>
> I'd like to have the  alt text show when I hover over the image (like a 
> tooltip).  
> 
>
> Is there already a css class that sets that up, do I need to make my own 
> class, or is javascript needed?  Would the IMG() helper make this easier?
>
> If I wanted to use some other text than the alt, does that require 
> javascript  ?
>
> /dps ":hover at will"
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: menu li > a padding in case of button

2017-12-05 Thread Paolo Caruccio
Maybe

.web2py-menu li:nth-of-type(2) {padding:0;}



Il giorno martedì 5 dicembre 2017 09:35:32 UTC+1, Annet ha scritto:
>
> Hi Paolo,
>
> Thanks for your reply. The problem is that the padding is on the  item 
> not the  btn one.
> My menu is rendered as follows:
>
> 
>href="/init/default/search">class="fa fa-search"
>   Log 
> in
>   > href="/init/default/static/account">Open 
> account
>  
>
>
> The padding is on the second  item which does not have a class I can 
> reference in my css.
> Removing the padding on the last  item is not an option for it renders 
> the item out of lign
> in case of a collapsed menu.
> Removing the padding on all  iyems is not an option either for I need 
> de padding on some
>  items.
>
> Kind regards,
>
> Annet
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: menu li > a padding in case of button

2017-12-03 Thread Paolo Caruccio
To remove it, you could try following css rules in an external css file 
loaded after bootstrap css files 

.web2py-menu span.btn{padding:0;}




Il giorno sabato 2 dicembre 2017 18:47:55 UTC+1, Annet ha scritto:
>
> I have the following menu:
>
> response.application_menu = [
> (CAT(I(_class="fa fa-search")), False, URL('default', 'search')),
> (CAT(SPAN('Log in', _class="btn btn-primary")), False, URL('com', 
> 'default', 'user', args='login', scheme=SECURESCHEME, host=COMDOMAIN)),
> (CAT(SPAN('Open account', _class="btn btn-success")), False, 
> URL('default', 'static', args='account')),
> ]
>
> I'd like to remove the padding on li > a which encloses the span selector.
>
>
> Kind regards,
>
> Annet
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Formatting numbers in view

2017-10-30 Thread Paolo Caruccio
If it is feasible for you, you could use *Intl.NumberFormat* (
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat)
 
javascript Internationalization API.



Il giorno lunedì 30 ottobre 2017 18:59:27 UTC+1, Gualter Portella ha 
scritto:
>
> Dear all,
>
> I have been trying to reformat the numbers retrieved from the DB into the 
> format used in my country (Brazil).
>
> I want to change decimals to ',' and thousands to '.'
>
> The thing is that the only solution that I can figure out is in Python 3 - 
> I am am new to programming and webdev, like this:
>
> In the model:
>swap_separators = { ord('.'):',', ord(','):'.' }
>
> In the view:
>
>{{ ativos = format(float(table.column), '0.2f') }}
>
>   {{=format(float(ativos), ',').translate(swap_separators)}}
>
>
> I am currently working with Python 3. My question is: will this  solution 
> work when I deploy the app in a host that uses Python 2 for web2py?
>
> If someone else has asked or posted a solution for this before, please 
> direct me to it. Otherwise, any help is really appreciated.
>
> Cheers,
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Alias column names (akin to AS clause) in db select

2017-08-28 Thread Paolo Caruccio
Maybe 

def test():
rows = db(db.Table1.foo==db.Table2.foo).select(db.Table1.foo.with_alias(
'foo'), db.Table2.bar.with_alias('blah'))
for row in rows:
print row.foo, row.blah
return locals()

should work.

Another way - if you can rewrite tables definitions - is to use the "rname" 
field value. From the web2py book 
http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?#Field-constructor
 

>
> *rname* provides the field was a "real name", a name for the field known 
> to the database adapter; when the field is used, it is the rname value 
> which is sent to the database. *The web2py name for the field is then 
> effectively an alias*.


So with 

db.define_table('Table2', Field('blah', 'string', rname="bar")

the query becomes

db(db.Table1.foo==db.Table2.foo).select(db.Table1.foo, db.Table2.blah)

If you want alias fields in a query without joins you could write

rows = db(db.Table2.id>0).select('bar AS blah')



Il giorno lunedì 28 agosto 2017 08:50:20 UTC+2, Brendan Barnwell ha scritto:
>
> On Monday, July 31, 2017 at 1:25:31 PM UTC-7, Paolo Caruccio wrote:
>>
>> Maybe the web2py book could help you:
>>
>>
>> http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=with_alias#Self-Reference-and-aliases
>>
>>
> That appears to only be talking about using aliases for tables, and 
> specifically to be able to create and query tables that reference one 
> another.  What I'm describing is conceptually much simpler than that: I 
> just want to take a query that already works and give my own names to the 
> columns of the result.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Admin UI - Error ticket less information in the latest web2py releases

2017-08-16 Thread Paolo Caruccio
ticket open https://github.com/web2py/web2py/issues/1740


Il giorno mercoledì 16 agosto 2017 04:58:17 UTC+2, Massimo Di Pierro ha 
scritto:
>
> very weird. Can you open a ticket about this?
>
> On Tuesday, 15 August 2017 10:19:42 UTC-5, Paolo Caruccio wrote:
>>
>> Hello everyone.
>>
>> In a view, I have a trivial NameError: name 'fattura' is not defined due 
>> to
>>
>> {{for ft in fatture:}}
>> {{=fattura.id}}
>> {{pass}}
>>
>> But the Error Ticket returned by web2py is different depending on the 
>> development environment.
>>
>> *Case 1 (best)*
>> SO: windows 8
>> Web2py: Version 2.14.6-stable + timestamp.2016.05.10.00.21.47
>> Python: Python 2.7.13
>>
>>
>> <https://lh3.googleusercontent.com/-99-DJfHC9RE/WZMPC9MprAI/ALw/esqukrPxyWYRtsoXGzzKY54Y9fYWnpRggCLcBGAs/s1600/Error_ticket_case1-compressor.png>
>>
>>
>> *Case 2*
>> SO: windows 8
>> Web2py: Version 2.15.3-stable + timestamp.2017.08.07.12.51.45
>> Python: Python 2.7.13
>> *Filename missing*
>>
>>
>> <https://lh3.googleusercontent.com/-rEi9dMrL7No/WZMPReIlczI/AL0/Aa1SO94j__wZXNETWObS4szc_xtCy8mdACLcBGAs/s1600/Error_ticket_case2-compressor.png>
>>
>>
>> *Case 3*
>> SO: Linux MInt 8.2
>> Web2py: Version 2.15.3-stable + timestamp.2017.08.07.12.51.45
>> Python: Python 2.7.12
>> *The same as the case 2 but also Error snapshot and Python version are 
>> missing. *
>>
>>
>> <https://lh3.googleusercontent.com/-STR1oyCRhEc/WZMPmVl0sNI/AL4/OxgV4ffdw1A7dPx9Xa2RVQXOH7u9DOZ4wCLcBGAs/s1600/Error_ticket_case3-compressor.png>
>>
>>
>> *Case 4 (worse)*
>> SO: Linux MInt 8.2
>> Web2py: Version 2.15.3-stable + timestamp.2017.08.07.12.51.45
>> Python: Python 3.6.2
>> *Python version, reference to filename and line are missing. New 
>> exception occurred.*
>>
>>
>> <https://lh3.googleusercontent.com/-hb9pyqJd_Vs/WZMP__bKMUI/AL8/QlKnBbqZtjs_qqyzRfVyTXQe3NoCR1LGACLcBGAs/s1600/Error_ticket_case4-compressor.png>
>>
>>
>>
>> Has anyone ever encountered this problem? How did he solve it?
>>
>> Thank you.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Admin UI - Error ticket less information in the latest web2py releases

2017-08-15 Thread Paolo Caruccio
Hello everyone.

In a view, I have a trivial NameError: name 'fattura' is not defined due to

{{for ft in fatture:}}
{{=fattura.id}}
{{pass}}

But the Error Ticket returned by web2py is different depending on the 
development environment.

*Case 1 (best)*
SO: windows 8
Web2py: Version 2.14.6-stable + timestamp.2016.05.10.00.21.47
Python: Python 2.7.13




*Case 2*
SO: windows 8
Web2py: Version 2.15.3-stable + timestamp.2017.08.07.12.51.45
Python: Python 2.7.13
*Filename missing*




*Case 3*
SO: Linux MInt 8.2
Web2py: Version 2.15.3-stable + timestamp.2017.08.07.12.51.45
Python: Python 2.7.12
*The same as the case 2 but also Error snapshot and Python version are 
missing. *




*Case 4 (worse)*
SO: Linux MInt 8.2
Web2py: Version 2.15.3-stable + timestamp.2017.08.07.12.51.45
Python: Python 3.6.2
*Python version, reference to filename and line are missing. New exception 
occurred.*





Has anyone ever encountered this problem? How did he solve it?

Thank you.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: posibility to disable the mobile admin interface

2017-08-15 Thread Paolo Caruccio
Why is it not compatible?
Have you already asked for help from this group?


Il giorno martedì 15 agosto 2017 09:41:23 UTC+2, Vic Ding ha scritto:
>
> Thanks, Paolo. I'll try this after I revert to old version. The component 
> I use to mimic excel for user input is not compatible with new version :(
>
> On Tuesday, August 15, 2017 at 12:40:29 AM UTC+2, Paolo Caruccio wrote:
>>
>> My known way.
>>
>> In the "web2py/applications/admin/controllers/default.py" file at line 
>> nr.3 set EXPERIMENTAL_STUFF to False
>>
>> You must apply the above change every time you update web2py.
>>
>>
>> Il giorno lunedì 14 agosto 2017 12:50:39 UTC+2, Vic Ding ha scritto:
>>>
>>> I know this is pretty old post, but is there a way to do so? Thanks!
>>>
>>> On Tuesday, November 22, 2016 at 10:30:24 AM UTC+1, Oli wrote:
>>>>
>>>> is there a posibility to disable the mobile interface? there is only a 
>>>> white screen on pythonanywhere.com with web2py version 2.14.6 .
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: posibility to disable the mobile admin interface

2017-08-14 Thread Paolo Caruccio
My known way.

In the "web2py/applications/admin/controllers/default.py" file at line nr.3 
set EXPERIMENTAL_STUFF to False

You must apply the above change every time you update web2py.


Il giorno lunedì 14 agosto 2017 12:50:39 UTC+2, Vic Ding ha scritto:
>
> I know this is pretty old post, but is there a way to do so? Thanks!
>
> On Tuesday, November 22, 2016 at 10:30:24 AM UTC+1, Oli wrote:
>>
>> is there a posibility to disable the mobile interface? there is only a 
>> white screen on pythonanywhere.com with web2py version 2.14.6 .
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Change value of select

2017-08-12 Thread Paolo Caruccio
Have you tried with javascript?

If the selectbox has an id should be simple accomplish your goal.

For example:


document.getElementById('listofvalues').value='3';


sets as selected the option with value = '3'  in the following selectbox.

   
  Value 11
  Value 22
  Value 33
  Value 44
  Value 55
   


Il giorno venerdì 11 agosto 2017 12:59:17 UTC+2, Simona Chovancová ha 
scritto:
>
> I need to change selected option in the view, I know that to change input 
> value I do it like this: {{form.element('input', _name='field')['_value'] = 
> "new_value"}}, but how do I do this with select? Also, this needs to be 
> done in view, not controller so I cannot use default='some_option'.
> Any ideas? Thanks!
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: multiple form in 1 page using tab

2017-08-12 Thread Paolo Caruccio
Maybe the issue is due to class 'active' in the view.
To be honest, I did not fully understand your question but the following 
code - for example - should show the tab with the submitted form.

*controllers/default.py*
def report():
query = (db.table_0.id > 0)

#redirect_url_0 = 'report_detail'
formname_0 = 'formname_0'

form_0 = SQLFORM.factory(
Field("from_date", "date", 
  requires = IS_DATE() ),
Field("to_date", "date", 
  requires = IS_DATE() ), 
Field("table_0", "list:reference table_0", 
  requires = IS_EMPTY_OR(IS_IN_DB(db(query), db.table_0.id, 
  db.table_0._format, multiple 
= True) ) )
)
if form_0.process(formname = formname_0).accepted:
#response.new_window = URL(redirect_url_0, vars = form_0.vars)
redirect_url_0 = URL('report', vars = dict(tab_active="tab-1"))
redirect(redirect_url_0)
elif form_0.errors:
response.flash = T('Form has errors')

#redirect_url_1 = 'report_summary'
formname_1 = 'formname_1'

form_1 = SQLFORM.factory(
Field("from_date", "date", 
  requires = IS_DATE() ),
Field("to_date", "date", 
  requires = IS_DATE() ), 
Field("table_0", "list:reference table_0", 
  requires = IS_EMPTY_OR(IS_IN_DB(db(query), db.table_0.id, 
  db.table_0._format, multiple 
= True) ) )
)
if form_1.process(formname = formname_1).accepted:
#response.new_window = URL(redirect_url_1, vars = form_1.vars)
redirect_url_1 = URL('report', vars = dict(tab_active="tab-2"))
redirect(redirect_url_1)
elif form_1.errors:
response.flash = T('Form has errors')

return dict(form_0 = form_0, form_1 = form_1)

*views/default/report.html*
{{extend 'layout.html'}}


  
  Detail
  
  
  Summary
  



  
{{=BR() }}
{{=form_0}}
  

  
{{=BR() }}
{{=form_1}}
  




Il giorno sabato 12 agosto 2017 03:54:45 UTC+2, 黄祥 ha scritto:
>
> is it possible to have multiple form in 1 page using tab? z
> tried it before but no luck (no error occured but the result is not 
> expected) the result that should open the new browser tab didnt open, after 
> submit it just return flash 'success'
> *e.g.*
> *controllers/default.py*
> def report():
> query = (db.table_0.id > 0)
>
> redirect_url_0 = 'report_detail'
> formname_0 = 'formname_0'
>
> form_0 = SQLFORM.factory(
> Field("from_date", "date", 
>  requires = IS_DATE() ),
> Field("to_date", "date", 
>  requires = IS_DATE() ), 
> Field("table_0", "list:reference table_0", 
>  requires = IS_EMPTY_OR(IS_IN_DB(db(query), db.table_0.id, 
>db.table_0._format, multiple = True) ) )
> )
> if form_0.process(formname = formname_0).accepted:
> response.new_window = URL(redirect_url_0, vars = form_0.vars)
> #redirect(URL(redirect_url, vars = form.vars) )
> elif form_0.errors:
> response.flash = T('Form has errors')
>
> redirect_url_1 = 'report_summary'
> formname_1 = 'formname_1'
>
> form_1 = SQLFORM.factory(
> Field("from_date", "date", 
>  requires = IS_DATE() ),
> Field("to_date", "date", 
>  requires = IS_DATE() ), 
> Field("table_0", "list:reference table_0", 
>  requires = IS_EMPTY_OR(IS_IN_DB(db(query), db.table_0.id, 
>db.table_0._format, multiple = True) ) )
> )
> if form_1.process(formname = formname_1).accepted:
> response.new_window = URL(redirect_url_1, vars = form_1.vars)
> #redirect(URL(redirect_url, vars = form.vars) )
> elif form_1.errors:
> response.flash = T('Form has errors')
>
> return dict(form_0 = form_0, form_1 = form_1)
>
> *views/default/report.html*
> {{extend 'layout.html'}}
>
> 
>   
>   Detail
>   
>   
>   Summary
>   
> 
>
> 
>   
> {{=BR() }}
> {{=form_0}}
>   
>
>   
> {{=BR() }}
> {{=form_1}}
>   
> 
>
> thanks and best regards,
> stifan
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Can't load form using {{=form}} only by {{=LOAD('default','def')}} or submit the form.

2017-08-06 Thread Paolo Caruccio
Do you have a file named "order.load" or "order.html" in views/default 
folder?

LOAD helper needs a view  that does not extend the layout.

Sample of content default order.load (please note the absence of  {{extend 
'layout.html'}}):

{{=order}}


More on LOAD helper in 
http://web2py.com/books/default/chapter/29/12/components-and-plugins#LOAD

 

Il giorno venerdì 4 agosto 2017 17:54:05 UTC+2, Samuel Gosling ha scritto:
>
> faced with this! invalid function (default/order)
>
> Started off with that statement you see.
> Really confused at this , seems to be nobody else is having this problem!
>
> On Friday, August 4, 2017 at 3:59:34 PM UTC+1, Jim S wrote:
>>
>> In your controller, try:
>>
>> return dict(order=order)
>>
>> instead of:
>>
>> return order
>>
>> -Jim
>>
>> On Friday, August 4, 2017 at 9:45:51 AM UTC-5, Samuel Gosling wrote:
>>>
>>> Hey guys completely new to web development and web2py , enjoying it so 
>>> far. It has a lot of potential.
>>>
>>> Need help loading my form in my index.html as I can't using {{=form}} or 
>>> in this case {{=order}} only by using the command 
>>> {{=LOAD('default','order')}}. I believe this may be my problem in 
>>> submitting the form also as I keep getting my error back and the page won't 
>>> redirect.
>>> I know usually for using a form you use the {{=form.custom.begin}} , 
>>> {{=form.custom.submit}}  and {{=form.custom.end}} but since I can't use 
>>> {{=form} that isn't an option. If i use {{=form}} , I get the error that it 
>>> is not defined. I have looked for answers but they resulted to no avail. 
>>>  Hope you guys can help and I appreciate it greatly. 
>>>
>>> default.py
>>> def order():
>>> order = SQLFORM(db.order,
>>>submit_button='Buy!',
>>>buttons=['submit'],
>>> formstyle='table3cols')
>>> if order.process(keepvalues=True).accepted:
>>> session.flash = 'Order submitted.'
>>> redirect(URL('payment'))
>>> elif order.errors:
>>> session.flash = 'Error.'
>>> else:
>>> session.flash = 'Please enter a wallet address.'
>>> return order
>>>
>>> db.py
>>> db = DAL('sqlite://storage.sqlite')
>>> db.define_table('order', Field('amount', requires=IS_IN_SET(['100 ɌDD', 
>>> '250 ɌDD', '500 ɌDD' , '1000 ɌDD', '2500 ɌDD', '5000 ɌDD', '1 ɌDD'])),
>>> Field('address', requires=IS_NOT_EMPTY()))
>>>
>>> index.html
>>> 
>>> {{=LOAD('default','order')}}
>>> 
>>>
>>>
>>>
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Alias column names (akin to AS clause) in db select

2017-07-31 Thread Paolo Caruccio
Maybe the web2py book could help you:

http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=with_alias#Self-Reference-and-aliases


Il giorno lunedì 31 luglio 2017 00:19:11 UTC+2, Brendan Barnwell ha scritto:
>
> On Monday, May 29, 2017 at 11:30:53 PM UTC-7, Brendan Barnwell wrote:
>>
>> When running queries that do joins, I often find the format of the result 
>> somewhat cumbersome, with its nested structures representing the different 
>> tables in the join.  If I were writing the query in raw SQL, I would 
>> probably use "AS" clauses to select just the columns that I want, with 
>> simple "top-level" names.  Something like
>>
>> Select Table1.foo as stuff, Table2.bar as blah from Table1, Table2 ...
>>
>> Is there a way to do this with Web2py?  It would seem natural to specify 
>> this inside the select call, something like
>>
>> db(db.Table1.foo=db.Table2.foo).select(db.Table1.foo.alias('foo'), 
>> db.Table2.bar.alias('blah'))
>>
>
> Any ideas on this?  I continue to be especially frustrated at having to 
> unpack the nested structure that occurs when I select using a join.  I want 
> to be able to easily "flatten" the structure into a single list of column 
> names, rather than the existing structure where column names are nested 
> inside table names.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Semantic UI for SQLFROM.grid

2017-06-04 Thread Paolo Caruccio
Yes it's diffcult but not impossible.

With CSS preprocessors, for example, we can write adaptive rules by 
extending a class defined in choiced css library to a HTML element 
generated by web2py having a different css class or a specific identifier.

web2py, in my opinion, it's flexibile enough in order to obtain a 
soddisfacent result since it adds an identifier or class to (almost) all 
html components.

For example (please be aware the code -  although it's working - is only 
for demostration!) just applying the attached file (of course compiled) to 
our layout.html we will obtain that shown in the following image  (the grid 
come from estore3 by Massimo Di Pierro)










Il giorno venerdì 26 maggio 2017 15:35:02 UTC+2, Najtsirk ha scritto:
>
> Hi,
>
> I would like to have Semantic UI in my application. However the 
> SQLFORM.grid has Bootstrap by default. Is there "the right" way to 
> implement SQLFORM.grid with SemanticUI?
>
> Can somebody point me into the right direction?
>
> Thanks,
> Kristjan
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


w2p_sui_adapter.less
Description: Binary data


[web2py] Re: How do I change the sqlform button location

2017-05-12 Thread Paolo Caruccio
For label within its related input, you could use placeholder HTML 
attribute.

In order to accomplish this you could customize the field widget.

For example, the widget for the password field of auth_user table could be 

db.auth_user.password.widget=lambda f, v: SQLFORM.widgets.password.widget(f, 
v, _placeholder=f.label, _class="form-control")

Read more about widgets in the web2py book 
 http://web2py.com/books/default/chapter/29/7#Widgets 


About css conventions please check
 
http://www.web2py.com/books/default/chapter/29/07/forms-and-validators#CSS-conventions
 


Generally speaking, SQLFORM wraps the form controls (label + input + 
comment) with a div identified with #mytable_myfield__row  where mytable is 
the tablename and myfield is the fieldname

For a more accurate structure of the row wrapper and its content see the 
web2py formstyles. How stated in the book 
http://www.web2py.com/books/default/chapter/29/07/forms-and-validators?#SQLFORM

Hints can be found in the source code file sqlhtml.py (look for functions 
> named formstyle_) 


Form buttons also are wrapped in a container identified with  
#submit_record__row

For example, the following css rules will move the form buttons on the 
right side

#submit_record__row,
#submit_record__row .col-sm-9,
#submit_record__row .w2p_fw {text-align: right;}

 

Il giorno mercoledì 10 maggio 2017 21:21:03 UTC+2, hardclock ha scritto:
>
>
>  Hello everyone.
> I'm sorry for the inconvenience,I just started learning css and web2py 
> recently. With the\is page I want to create a login layout similar to the 
> on in ubuntu where the input fields are in the middle and the 
> "username/password" texts are inside the fields.
> I was able to change the colors,font and border of the texts and fields 
> but I couldn't change the submit button nor move any of them out of the 
> corner.Is there any way to do it?I remembered each field has a 
> corresponding class but couldn't find it in the manual.Thank you and sorry 
> for the trouble.
>
>
> h1 {
> color: #6b9430;
> text-align: center;
>font-family: FontAwesome;
>font-size: 50px;
>font-weight: 300;
>text-transform: none !important;
> }
> body, input, select, textarea {
> color: black;
> font-family: FontAwesome;
> font-size: 10pt;
> font-weight: 900;
> line-height: 1.65em;
> }
> input[type='text'],
> input[type='password'],
> input[type='email'],
> input[type='select']
> textarea{
> color: #3b9e3b;
> margin-left: auto;
> margin-right: auto;
> border-radius: 8px;
> width: 200px;
> height: 20px;
> }
> I've tried input[type='submit'] and button 
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: how to control what A displays while working

2017-02-08 Thread Paolo Caruccio
You could try with css.

1. assign to the component trigger a specific class for example 
"link_with_loader"

A(IMG(_src=image), _href=URL('default', 'getit'), _class="link_with_loader", 
user_signature=True, cid=request.cid)


2. since web2py adds  the "disabled" class to the component trigger when 
it's working,  we can customize it with css

a.link_with_loader.disabled img {visibility: hidden; /* hides the original 
image preserving its dimensions */}
a.link_with_loader.disabled {
color: transparent; /* makes invisible the "Working..." text */
cursor: not-allowed;
pointer-events: none;
display: inline-block;
background: url("../static/images/our_loader.gif") no-repeat; /* shows 
the loader image */
}


Maybe you should add more css rules in order to fit your needs.
Please note that the customized css code goes preferibly in a separate file 
and loaded after other we2py/template css files (see  section in 
layout.html for reference).


Il giorno mercoledì 8 febbraio 2017 01:17:11 UTC+1, Tim Korb ha scritto:
>
> I'm using the Ajax feature of the A tag to replace a component:  
>
> A(IMG(_src=image), _href=URL('default', 'getit'), 
> user_signature=True, cid=request.cid)
>
> While the content (default/getit) is being fetched, I would like to 
> replace the current image with a spinner image, rather than the default 
> "Working..." text.  I see a number of related posts in the forum involving 
> w2p_disable_with, but I can't figure out how to make that work (if it is 
> even supposed to).
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Customising Calendar widgets in Start Date and End date of SmartGrid

2017-01-16 Thread Paolo Caruccio
Below link should work yet.

http://sourceforge.net/projects/jscalendar/ 


Within the file you'll find the refrence and other original resources about 
jscalendar 1.0 of dynarch

Il giorno venerdì 13 gennaio 2017 11:16:14 UTC+1, Amit Kumar Modak ha 
scritto:
>
> Hello,
>
> I am using Smartgrid in which there are two date fields Start Date and End 
> Date.
> Is it possible to make in Start Date field Calendar widget only dates 
> ahead of today enabled and in End Date only dates ahead of date selected in 
> Start Date is enabled.
>
>
> Regards,
> Amit
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: required=True

2016-12-28 Thread Paolo Caruccio
In addition to the Anthony's answer 
, if you 
want also experiment simple native client side validation for web form, you 
could customize the field widget

Field('myfield', 'string', requires=IS_NOT_EMPTY(), widget=lambda f,v:
SQLFORM.widgets.string.widget(f,v,_required=True))

Read more 
https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Forms/Data_form_validation#The_required_attribute


Il giorno mercoledì 28 dicembre 2016 13:24:57 UTC+1, Andrea Fae' ha scritto:
>
> Why if I use this option in Field table database but when I insert and I 
> leave not typed this field the system accepted it?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: table headers with style

2016-12-08 Thread Paolo Caruccio
*Premise*
bootstrap tables with striped rows have the following classes:

 - table
 - table-striped

reference: http://getbootstrap.com/css/#tables

*Padding*
bootstrap .table class assigns a padding of 8px to th and td elements while 
in stupid the th and td padding is 5px
So in order to assign a different value we should set

.table.myeheaders th,
.table.myeheaders td {
 /* top | right | bottom | left */
padding: 0 0 0 0;   /* change values as you like  */
}


*Table width*
bootstrap .table has a width of 100%
So in order to give a natural width to the table.table we should set

.table.myeheaders {
width:auto;
}


Our code becomes:


.table.myeheaders {width:auto;}
.table.myeheaders th,
.table.myeheaders td {
 /* top | right | bottom | left */
padding: 0 0 0 0;   /* change values as you like  */
}
.table-striped .w2p_odd.odd {background-color:#ddffcc;}



{{extend 'layout.html'}}
This is the default/sorted.html template
{{=SQLTABLE(rows, truncate=30, headers = {'tbl1.a':'Ayy', 'tbl1.b':'Bee', 
'tbl1.c':'Cee', 'tbl1.d':'Dee'}, 
columns=['tbl1.a', 'tbl1.b', 'tbl1.c', 'tbl1.d'], _class="table 
table-striped myeheaders")}}



Il giorno giovedì 8 dicembre 2016 08:03:53 UTC+1, Dave S ha scritto:
>
>
>
> On Wednesday, December 7, 2016 at 3:02:10 PM UTC-8, Paolo Caruccio wrote:
>>
>> Below code should work with bootstrap and stupid.css
>>
>> 
>> .table.myeheaders th {padding-right:2em;}
>> .table-striped .w2p_odd.odd {background-color:#ddffcc;}
>> 
>>
>> {{extend 'layout.html'}}
>> This is the default/sorted.html template
>> {{=SQLTABLE(rows, truncate=30, headers = {'tbl1.a':'Ayy', 'tbl1.b':'Bee', 
>> 'tbl1.c':'Cee', 'tbl1.d':'Dee'}, 
>> columns=['tbl1.a', 'tbl1.b', 'tbl1.c', 'tbl1.d'], _class="table 
>> table-striped myeheaders")}}
>>
>>
>> Some readings:
>>
>> https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
>> https://developer.mozilla.org/en-US/docs/Web/CSS/Universal_selectors
>>
>>
>>
> The table class does interesting things, but not what I want.   That gave 
> 8px padding on all 4 sides, and the columns divided up the full width.   
> Better than the default styling, but I prefer a more compact look.
>
> What I have now is
>
> 
> .myeheaders th {padding-right:2em;}
> .table-striped .w2p_odd.odd {background-color:#ddffcc;}
> 
>
> {{extend 'layout.html'}}
> This is the default/sorted.html template
> {{=SQLTABLE(rows, truncate=30, headers = {'tbl1.a':'Ayy', 'tbl1.b':'Bee', 
> 'tbl1.c':'Cee', 'tbl1.d':'Dee'}, 
> columns=['tbl1.a', 'tbl1.b', 'tbl1.c', 'tbl1.d'], 
> _class="table-striped myeheaders")}}
>
>
>  Interesting that that looks like your first post ... I must have missed 
> something on the earlier try.
>
> Thanks for your help.
>
> /dps
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: table headers with style

2016-12-07 Thread Paolo Caruccio
Below code should work with bootstrap and stupid.css


.table.myeheaders th {padding-right:2em;}
.table-striped .w2p_odd.odd {background-color:#ddffcc;}


{{extend 'layout.html'}}
This is the default/sorted.html template
{{=SQLTABLE(rows, truncate=30, headers = {'tbl1.a':'Ayy', 'tbl1.b':'Bee', 
'tbl1.c':'Cee', 'tbl1.d':'Dee'}, 
columns=['tbl1.a', 'tbl1.b', 'tbl1.c', 'tbl1.d'], _class="table 
table-striped myeheaders")}}


Some readings:

https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
https://developer.mozilla.org/it/docs/Web/CSS/Universal_selectors



Il giorno mercoledì 7 dicembre 2016 09:33:20 UTC+1, Dave S ha scritto:
>
>
>
> On Sunday, December 4, 2016 at 2:48:15 AM UTC-8, Paolo Caruccio wrote:
>>
>> The correct sintax for the css .class selector is
>>
>> .class {
>> css declarations;
>> }
>>
>> so 
>>
>>  .myeheaders th {padding-right: 2em;} 
>>
>> should work.
>>
>>
>>
> Thanks, but what I ended up with was
>
>   th { padding-right: 2em ! important } 
>
>
> but I could change the color or background color without the !important.
>
>   *.odd  {background-color: #ddffcc}  /* light green-bar 
>  */ 
>
> The _class parameter was assigning the class name to the whole table. 
>  Using th.myeheaders in the style rule did not work, even with the 
> !important.  I'm doing this starting with the welcome app, so I'm 
> interacting with bootstrap3, which seems to have some pain points involved. 
>  Maybe I should try starting with the examples app and stupid.css instead.
>
> /dps 
>
>  
>
>> Il giorno domenica 4 dicembre 2016 05:32:55 UTC+1, Dave S ha scritto:
>>>
>>> I'm finding that SQLTABLE, though mostly well-behaved, doesn't properly 
>>> take the th elements into account when sizing the table space; I'd like to 
>>> add padding-right to those elements, but I've forgotten how to do it.
>>>
>>> My view looks like:
>>>
>>> <style> myeheaders: th { padding-right: 2em} ; 
>>>
>>>
>>> {{extend 'layout.html'}}
>>> This is the default/sorted.html template
>>> {{=SQLTABLE(rows, truncate=30, headers = {'tbl1.a':'Ayy', 
>>> 'tbl1.b':'Bee', 'tbl1.c':'Cee', 'tbl1.d':'Dee'}, 
>>> columns=['tbl1.a', 'tbl1.b', 'tbl1.c', 'tbl1.d'], 
>>> _class="myeheaders")}}
>>>
>>>
>>> but I don't have this right, do I?
>>>
>>> /dps
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: table headers with style

2016-12-04 Thread Paolo Caruccio
The correct sintax for the css .class selector is

.class {
css declarations;
}

so 

 .myeheaders th { padding-right: 2em} ; 

should work.


Il giorno domenica 4 dicembre 2016 05:32:55 UTC+1, Dave S ha scritto:
>
> I'm finding that SQLTABLE, though mostly well-behaved, doesn't properly 
> take the th elements into account when sizing the table space; I'd like to 
> add padding-right to those elements, but I've forgotten how to do it.
>
> My view looks like:
>
>  myeheaders: th { padding-right: 2em} ; 
>
>
> {{extend 'layout.html'}}
> This is the default/sorted.html template
> {{=SQLTABLE(rows, truncate=30, headers = {'tbl1.a':'Ayy', 'tbl1.b':'Bee', 
> 'tbl1.c':'Cee', 'tbl1.d':'Dee'}, 
> columns=['tbl1.a', 'tbl1.b', 'tbl1.c', 'tbl1.d'], 
> _class="myeheaders")}}
>
>
> but I don't have this right, do I?
>
> /dps
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: How to solve vertical alignment too high of SQLForm read-only field

2016-12-02 Thread Paolo Caruccio
My previous answer was too short. I was in a hurry. So I want elaborate it 
more.
Martin wrote to have an alignment problem between the label and the text 
that SQLFORM generates when the field is not writable.
Web2py in this context gives to the label of not writable field the css 
class "readonly" that not to be confused with the homonym html attribute.
bootstrap gives a padding-top 7 px to the label in a horizontal form and, 
in the case of a static control, suggests

*When you need to place plain text form next to a label within at form, use 
> the .form-control-static class on a .*


Therefore, in order to align the text to its label we could wrap the text 
in a  tag (maybe using javascript) having "form-control-static" class or 
assign a top padding of 7 px to the  that is sibling of the label in 
the rendered SQLForm

label.readonly ~ div {padding-top: 7px;}

of course the previous css rule goes in an extra .css file after bootstrap 
files.



Il giorno lunedì 21 novembre 2016 16:42:54 UTC+1, Martin de Groot ha 
scritto:
>
> In a SQLForm all widget-controls of writable fields are nicely, correctly 
> vertically aligned with the preceding label.
>
> However, when one adds db.table.field.writable = False in the 
> contrller-action function the widget-control is correctly changed from an 
> input control to a read-only control, but the text of the field's value is 
> placed noticeably higher than the text of the preceding label.
>
> I have been looking into the html source code of the resulting page, to 
> see if I could figure out which style I could apply in an extra .css file 
> statement, but I cannot  find anything.
>
> I am sure many other users have observed this vertical alignment being too 
> high , especially if the text in the field is just on one line.
>
> I would very much appreciate it if anyone can suggest a solution for this. 
> Apart from making a custom form, which is a lot more work than using the 
> SQLForm generated code.
>
> Martin de Groot
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: How to solve vertical alignment too high of SQLForm read-only field

2016-12-01 Thread Paolo Caruccio
Try with
 
label.readonly~div{padding:7px;}



Il giorno lunedì 21 novembre 2016 16:42:54 UTC+1, Martin de Groot ha 
scritto:
>
> In a SQLForm all widget-controls of writable fields are nicely, correctly 
> vertically aligned with the preceding label.
>
> However, when one adds db.table.field.writable = False in the 
> contrller-action function the widget-control is correctly changed from an 
> input control to a read-only control, but the text of the field's value is 
> placed noticeably higher than the text of the preceding label.
>
> I have been looking into the html source code of the resulting page, to 
> see if I could figure out which style I could apply in an extra .css file 
> statement, but I cannot  find anything.
>
> I am sure many other users have observed this vertical alignment being too 
> high , especially if the text in the field is just on one line.
>
> I would very much appreciate it if anyone can suggest a solution for this. 
> Apart from making a custom form, which is a lot more work than using the 
> SQLForm generated code.
>
> Martin de Groot
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


Re: [web2py] Multiple connections/ databases with same app

2016-03-13 Thread Paolo Caruccio
and by replacing "poolsize" to "pool_size"? 

http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#DAL-signature


Il giorno domenica 13 marzo 2016 17:12:17 UTC+1, Shayn Raney ha scritto:
>
> Even If I rename the db's to just 'Cats' I see the same issue. 
>
>
> On Mar 13, 2016, at 4:08 AM, Paolo Caruccio  > wrote:
>
> Try to replace dash ("-") with uderscore ("_") in the variable names i.e. 
> db_cats
>  
>
> Il giorno sabato 12 marzo 2016 15:10:33 UTC+1, Shayn Raney ha scritto:
>>
>> I would like to implement something like this to use two sqlite3 
>> databases. I've tried to create the following within a new model via the 
>> web admin gui and did not see the new tables under the 'Available Databases 
>> and Tables' appadmin page.  Does the 'Available Databases and Tables' page 
>> only show the items within the 'storage.sqlite' file? 
>>
>> db-cats = DAL('sqlite://cats.sqlite', poolsize = 1)
>>
>> db-cats.define_table('names', 
>> Field('name', 'string'),
>> Field('age', 'integer'),
>> Field('account', 'integer')
>> )
>>
>> db-cats.define_table('owner', 
>> Field('fname', 'string'),
>> Field('lname', 'string'),
>> Field('phone', 'string')
>> )
>>
>>
>>
>>
>> On Wednesday, January 2, 2013 at 9:05:27 AM UTC-8, Alec Taylor wrote:
>>>
>>>
>>>
>>> On Wed, Jan 2, 2013 at 10:53 PM, Simon Ashley  wrote:
>>>
>>>> Ok then, should this work?
>>>> (Version 2.3.2 (2012-12-17 15:03:30) stable, source, nightly build, 
>>>> from 12/31)
>>>>
>>>> *Connection*
>>>> db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])
>>>> db1 = DAL('mysql://root:www@localhost:3306/xxx', migrate=True, 
>>>> fake_migrate=False, check_reserved=['common','mysql'])  #www and xxx's 
>>>> have been blanked (place markers)
>>>>
>>>> *Model*
>>>> db.define_table('luPace',
>>>>   Field('Description','string', label='Pace'),
>>>>   Field('icon','string', length=100),
>>>>   Field('bgcolor','string'),
>>>>   Field('fgcolor','string'))
>>>>
>>>> db1.define_table('luStart1',
>>>>   Field('Description','string', label='Start'),
>>>>   Field('icon','string'),
>>>>   Field('bgcolor','string'),
>>>>   Field('fgcolor','string'))
>>>>
>>>> *Controller*
>>>> def pace():
>>>> tablel = SQLFORM.grid(db.luPace)
>>>> return locals()
>>>>
>>>> def start():
>>>> tablel = SQLFORM.grid(db.luStart1)
>>>> return locals()
>>>>
>>>
>>> You'll want to change the first line of that second function:
>>>
>>> tablel = SQLFORM.grid(db1.luStart1)
>>>
>>>  
>>>
>>>> Execute the following:
>>>>
>>>> *pace ..*
>>>>
>>>> as expected
>>>>
>>>>
>>>> *start *
>>>>
>>>> Traceback (most recent call last):
>>>>
>>>>  File "C:\web2py15\gluon\restricted.py", line 212, in restricted
>>>>
>>>>  exec ccode in environment
>>>>  File "C:/web2py15/applications/test1/controllers/test.py" 
>>>> <http://127.0.0.1:8000/admin/default/edit/test1/controllers/test.py>, line 
>>>> 13, in 
>>>>
>>>>  File "C:\web2py15\gluon\globals.py", line 193, in 
>>>>
>>>>  self._caller = lambda f: f()
>>>>
>>>>  File "C:/web2py15/applications/test1/controllers/test.py" 
>>>> <http://127.0.0.1:8000/admin/default/edit/test1/controllers/test.py>, line 
>>>> 9, in start
>>>>
>>>>  tablel = SQLFORM.grid(db.luStart1)
>>>>
>>>>  File "C:\web2py15\gluon\dal.py", line 7255, in __getattr__
>>>>
>>>>  return ogetattr(self, key)
>>>> AttributeError: 'DAL' object has no attribute 'luStart1'
>>>>
>>>> *luStart1* works from appadmin
>>>>
>>>>
>>>> -- 
>>>>  
>>>>  
>>>>  
>>>>
>>>
>>> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/web2py/IbBzVyeCSFg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> web2py+un...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


Re: [web2py] Multiple connections/ databases with same app

2016-03-13 Thread Paolo Caruccio
Try to replace dash ("-") with uderscore ("_") in the variable names i.e. 
db_cats
 

Il giorno sabato 12 marzo 2016 15:10:33 UTC+1, Shayn Raney ha scritto:
>
> I would like to implement something like this to use two sqlite3 
> databases. I've tried to create the following within a new model via the 
> web admin gui and did not see the new tables under the 'Available Databases 
> and Tables' appadmin page.  Does the 'Available Databases and Tables' page 
> only show the items within the 'storage.sqlite' file? 
>
> db-cats = DAL('sqlite://cats.sqlite', poolsize = 1)
>
> db-cats.define_table('names', 
> Field('name', 'string'),
> Field('age', 'integer'),
> Field('account', 'integer')
> )
>
> db-cats.define_table('owner', 
> Field('fname', 'string'),
> Field('lname', 'string'),
> Field('phone', 'string')
> )
>
>
>
>
> On Wednesday, January 2, 2013 at 9:05:27 AM UTC-8, Alec Taylor wrote:
>>
>>
>>
>> On Wed, Jan 2, 2013 at 10:53 PM, Simon Ashley  wrote:
>>
>>> Ok then, should this work?
>>> (Version 2.3.2 (2012-12-17 15:03:30) stable, source, nightly build, from 
>>> 12/31)
>>>
>>> *Connection*
>>> db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])
>>> db1 = DAL('mysql://root:www@localhost:3306/xxx', migrate=True, 
>>> fake_migrate=False, check_reserved=['common','mysql'])  #www and xxx's 
>>> have been blanked (place markers)
>>>
>>> *Model*
>>> db.define_table('luPace',
>>>   Field('Description','string', label='Pace'),
>>>   Field('icon','string', length=100),
>>>   Field('bgcolor','string'),
>>>   Field('fgcolor','string'))
>>>
>>> db1.define_table('luStart1',
>>>   Field('Description','string', label='Start'),
>>>   Field('icon','string'),
>>>   Field('bgcolor','string'),
>>>   Field('fgcolor','string'))
>>>
>>> *Controller*
>>> def pace():
>>> tablel = SQLFORM.grid(db.luPace)
>>> return locals()
>>>
>>> def start():
>>> tablel = SQLFORM.grid(db.luStart1)
>>> return locals()
>>>
>>
>> You'll want to change the first line of that second function:
>>
>> tablel = SQLFORM.grid(db1.luStart1)
>>
>>  
>>
>>> Execute the following:
>>>
>>> *pace ..*
>>>
>>> as expected
>>>
>>>
>>> *start *
>>>
>>> Traceback (most recent call last):
>>>
>>>  File "C:\web2py15\gluon\restricted.py", line 212, in restricted
>>>
>>>  exec ccode in environment
>>>  File "C:/web2py15/applications/test1/controllers/test.py" 
>>> , line 
>>> 13, in 
>>>
>>>  File "C:\web2py15\gluon\globals.py", line 193, in 
>>>
>>>  self._caller = lambda f: f()
>>>
>>>  File "C:/web2py15/applications/test1/controllers/test.py" 
>>> , line 
>>> 9, in start
>>>
>>>  tablel = SQLFORM.grid(db.luStart1)
>>>
>>>  File "C:\web2py15\gluon\dal.py", line 7255, in __getattr__
>>>
>>>  return ogetattr(self, key)
>>> AttributeError: 'DAL' object has no attribute 'luStart1'
>>>
>>> *luStart1* works from appadmin
>>>
>>>
>>> -- 
>>>  
>>>  
>>>  
>>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: checkbox with label on the left side

2016-03-07 Thread Paolo Caruccio
In my sqlforms, I solved the issue with css.

Prerequisite 1: formstyle = divs
Prerequisite 2: you have to know the id of the field outer div i.e. that 
containing the div.w2p_fl and the div.w2p_fw
 Generally it is build as tablename_fieldname__row (for 
more on this subject see 
http://www.web2py.com/books/default/chapter/29/11/#Conditional-fields-in-forms)

For example in a auth login form having formstyle = divs the field 
containing the "remember me checkbox" will be rendered:

 
 
 Ricordami (per 30 giorni)
 
 
 
 
 



So by setting in a custom css:

#auth_user_remember_me__row {
display: -ms-flexbox;
-webkit-display: flex;
display: flex;
}


#auth_user_remember_me__row .w2p_fl {
-ms-flex-order: 2;
-webkit-order: 2;
order: 2;
}


#auth_user_remember_me__row .w2p_fw {
-ms-flex-order: 1;
-webkit-order: 1;
order: 1;
}


we should have the chackbox on the left and its label on the right.

Remarks:
maybe you will need to add more rules depending on the css framework you 
use;
this will not work in IE9 and below versions;
for more info on flexbox see http://caniuse.com/#feat=flexbox

In the attached image (taken from the layout based on semantic-ui css 
framework on which I'm working in these days ) you will see the resulting 
form.



Il giorno lunedì 7 marzo 2016 19:39:55 UTC+1, Viator ha scritto:
>
> Hello dear knowers!
>
> I tried the whole day to create a form with a checkbox with its label on 
> the  left side instead of on the right side.
>
> But with no success. So far I ended up with a field as simple string and 
> the option to select 'yes' or 'no'. But in this case the confirmation does 
> not work. The dialog pops up but no matter if I chosse OK or Cancel the 
> value of the fied will be changed.
>
> I also tried to create the entire form with DIV() and styles wich worked 
> but I had to to all the design by hand. So I thought I will use 
> SQLFORM.factory which does a great job but I could not figure out how to 
> place the label of the checkbox on the left side.
>
> Please, could someone push me into the right direction?
>
> Thank you, Thorsten
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


Re: [web2py] Re: How do I select and output multiple checkboxes

2016-01-18 Thread Paolo Caruccio
web2py.css is not loaded for default. So, it's better to put my css rules 
in web2py-bootstrap3.css file (if your application is based on web2py 
scaffolding layout) or even better in a custom css files.


Il giorno lunedì 18 gennaio 2016 23:01:36 UTC+1, Ron Chatterjee ha scritto:
>
> Just a quick question Paolo,
>
> Have a tested this code? Because I tried with the same table and pasted 
> the code in web2py.css and it didn't do anything. The concept is right but 
> I believe may have an implementation error. Unless I am missing something.
>
> On Saturday, January 16, 2016 at 12:01:03 PM UTC-5, Paolo Caruccio wrote:
>>
>> The issue could be simply solved by using css.
>>
>> For example by adding the below code in your css file:
>>
>> .web2py_checkboxeswidget.horizontal {
>> display: -ms-flexbox;
>> display: -webkit-flex;
>> display: flex;
>> }
>> 
>> .web2py_checkboxeswidget.horizontal > div {
>> margin-right: 3px;
>> display: inline-block;
>> }
>>
>> and  by adding the class "horizontal" to the web2py checkboxes widget
>>
>> db.define_table('mytable',
>> Field('name', type='list:string',requires=IS_IN_SET 
>> (('True','False', 'Neither'), multiple=True),
>>   widget=lambda field, value: 
>> SQLFORM.widgets.checkboxes.widget(field, value, style='divs', label=True, 
>> _class="horizontal")))
>>
>>
>> Il giorno venerdì 15 gennaio 2016 21:16:38 UTC+1, Ron Chatterjee ha 
>> scritto:
>>>
>>> I couldn't get those plug in to work. There should be a way to render 
>>> the form horizontally. I am surprised there there isnt! Checked with Django 
>>> site. I can run that with one line  renderer=HorizontalCheckboxRenderer. 
>>> Arn't we suppose to be the best!? lol
>>>
>>>
>>>
>>> On Thursday, January 14, 2016 at 3:19:28 PM UTC-5, Richard wrote:
>>>>
>>>> There were widget plugins also for that : 
>>>> https://github.com/scubism/sqlabs
>>>>
>>>> But these are really really old, and repo not have been update since 3 
>>>> years...
>>>>
>>>> The demo site seems not available any more...
>>>>
>>>> Richard
>>>>
>>>> On Thu, Jan 14, 2016 at 3:12 PM, Ron Chatterjee  
>>>> wrote:
>>>>
>>>>> I have it like this:
>>>>>
>>>>>
>>>>> db.define_table('mytable',
>>>>> Field('name', type='list:string',requires=IS_IN_SET 
>>>>> (('True','False', 'Neither'), multiple=True),
>>>>>   widget=lambda field, value: 
>>>>> SQLFORM.widgets.checkboxes.widget(field, value, style='divs', 
>>>>> label=True)))
>>>>>
>>>>>
>>>>>
>>>>> That gives me vertical placement. But you are right. That's the way to 
>>>>> do it.
>>>>>
>>>>>  
>>>>>
>>>>> On Thursday, January 14, 2016 at 1:40:25 PM UTC-5, Richard wrote:
>>>>>>
>>>>>> Looks about style parameters of SQLFORM.widget.checkbox there is 
>>>>>> information about that if I remember... There is also _style attribute 
>>>>>> where you can use 'divs'. Make sure you read about both attributes they 
>>>>>> are 
>>>>>> differents and serve differents purposes...
>>>>>>
>>>>>> But with _style='divs' you should be able to displays everythings at 
>>>>>> you which with CSS...
>>>>>>
>>>>>> Richard
>>>>>>
>>>>>> On Thu, Jan 14, 2016 at 1:23 PM, Ron Chatterjee >>>>> > wrote:
>>>>>>
>>>>>>> It does! Thank you Richard. Do you happen to know if I want to 
>>>>>>> display the checkbox horizontally as oppose to vertically, how would I 
>>>>>>> do 
>>>>>>> that? I asked cuz if I have a table with other fields and I have 10 
>>>>>>> checkboxes to say, it will be better to present them horizontally than 
>>>>>>> vertically. Regardless, thanks for your time

Re: [web2py] Re: How do I select and output multiple checkboxes

2016-01-16 Thread Paolo Caruccio
The issue could be simply solved by using css.

For example by adding the below code in your css file:

.web2py_checkboxeswidget.horizontal {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}

.web2py_checkboxeswidget.horizontal > div {
margin-right: 3px;
display: inline-block;
}

and  by adding the class "horizontal" to the web2py checkboxes widget

db.define_table('mytable',
Field('name', type='list:string',requires=IS_IN_SET 
(('True','False', 'Neither'), multiple=True),
  widget=lambda field, value: 
SQLFORM.widgets.checkboxes.widget(field, value, style='divs', label=True, 
_class="horizontal")))


Il giorno venerdì 15 gennaio 2016 21:16:38 UTC+1, Ron Chatterjee ha scritto:
>
> I couldn't get those plug in to work. There should be a way to render the 
> form horizontally. I am surprised there there isnt! Checked with Django 
> site. I can run that with one line  renderer=HorizontalCheckboxRenderer. 
> Arn't we suppose to be the best!? lol
>
>
>
> On Thursday, January 14, 2016 at 3:19:28 PM UTC-5, Richard wrote:
>>
>> There were widget plugins also for that : 
>> https://github.com/scubism/sqlabs
>>
>> But these are really really old, and repo not have been update since 3 
>> years...
>>
>> The demo site seems not available any more...
>>
>> Richard
>>
>> On Thu, Jan 14, 2016 at 3:12 PM, Ron Chatterjee  
>> wrote:
>>
>>> I have it like this:
>>>
>>>
>>> db.define_table('mytable',
>>> Field('name', type='list:string',requires=IS_IN_SET 
>>> (('True','False', 'Neither'), multiple=True),
>>>   widget=lambda field, value: 
>>> SQLFORM.widgets.checkboxes.widget(field, value, style='divs', label=True)))
>>>
>>>
>>>
>>> That gives me vertical placement. But you are right. That's the way to 
>>> do it.
>>>
>>>  
>>>
>>> On Thursday, January 14, 2016 at 1:40:25 PM UTC-5, Richard wrote:

 Looks about style parameters of SQLFORM.widget.checkbox there is 
 information about that if I remember... There is also _style attribute 
 where you can use 'divs'. Make sure you read about both attributes they 
 are 
 differents and serve differents purposes...

 But with _style='divs' you should be able to displays everythings at 
 you which with CSS...

 Richard

 On Thu, Jan 14, 2016 at 1:23 PM, Ron Chatterjee  
 wrote:

> It does! Thank you Richard. Do you happen to know if I want to display 
> the checkbox horizontally as oppose to vertically, how would I do that? I 
> asked cuz if I have a table with other fields and I have 10 checkboxes to 
> say, it will be better to present them horizontally than vertically. 
> Regardless, thanks for your time on this. Appreciated.
>
>  
>
> On Thursday, January 14, 2016 at 12:33:52 PM UTC-5, Richard wrote:
>>
>> multiple=True in IS_IN_SET() validator should help...
>>
>> Richard
>>
>> On Thu, Jan 14, 2016 at 11:57 AM, Ron Chatterjee <
>> achatte...@gmail.com> wrote:
>>
>>> Where in the book I find this info?  
>>>
>>>
>>> On Thursday, January 14, 2016 at 11:56:51 AM UTC-5, Ron Chatterjee 
>>> wrote:

 Here is an example in picture.



 On Wednesday, January 13, 2016 at 4:23:11 PM UTC-5, Ron Chatterjee 
 wrote:
>
> *Model:*
>
> db.define_table('mytable',
> Field('name', 
> type='list:string',requires=IS_IN_SET (('True','False')),
>   widget=SQLFORM.widgets.checkboxes.widget))
>
>
> *Controller:*
>
>
> def index():
> variables = []
> form = SQLFORM(db.mytable).process()
> if form.accepted:
> #comments from that particular blog post
> variables = form.vars.name
> return dict(form = form,variables = variables )
>
>
> *View:*
>
> {{extend 'layout.html'}}
> {{=form}}
> {{=variables}}
>
>
>
> I can only output true or false. I want to select and output True 
> and False both. How?
>
>
> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> 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+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
> Resources:
> 

Re: [web2py] Re: How to add CSS classes to auth.login custom?

2014-04-18 Thread Paolo Caruccio
Maybe this could be useful 
https://groups.google.com/d/msg/web2py/xTQ9oQVu0rQ/JPUFxFnsR8MJ

Il giorno venerdì 18 aprile 2014 19:10:28 UTC+2, Chris ha scritto:
>
> That could work. Seems a bit uncouth, not to mention if jQuery isn't 
> loaded that class wouldn't be added, and also that this would attach that 
> class to every form on the page. I could hack around those things but it 
> would be just that - a hack - and I'd prefer to do things in a robust 
> manner.
>
>
> On Fri, Apr 18, 2014 at 12:27 PM, H. Das 
> > wrote:
>
>> Use jQuery:
>>
>> 
>>  $('form').attr({"class":"my-class"});
>> 
>>
>> On Wednesday, February 27, 2013 4:20:26 PM UTC-5, Chris wrote:
>>>
>>> Hello,
>>>
>>> I have a form that looks like this:
>>> {{top_login_form = auth.login(next = 
>>> page_currentPath_get(request))}}
>>> {{top_login_form.elements('form')[0]['_class'] = 
>>> 'login_form'}}
>>> {{=top_login_form.custom.begin}}
>>>
>>> Trouble is, auth.login calls SQLFORM and sets custom.begin before the 
>>> '_class' attribute takes effect, and auth.login doesn't take custom 
>>> attributes. It seems like the long term solution might be to have 
>>> custom.begin be a method - in the meantime I'm probably going to overwrite 
>>> custom.begin myself. Any suggestions?
>>>
>>> Thanks!
>>>
>>  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>
>> --- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/W1ErCdPrcIE/unsubscribe.
>>
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
>
> Adventure 
> Cow:
>  
> Facebook  | 
> Twitter 
>  

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Why does appadmin have css overflow: hidden in database results?

2014-04-14 Thread Paolo Caruccio
Now I see your POV. You are speaking about browser's scrollbars and not 
about div content area scrollbars. The "overflow:auto" setting has been 
applied to the container div of the result table for aestethic reasons 
because such div should have a width of 80% but there is a bug in the code. 
I will send a patch on web2py issue tracker.
Anyway, if you are not confortable with "overflow:auto" and since appadmin 
is a part of w2p application you can easily customize it by replacing the 
line 68 in  /views/appadmin.html with a simple "". 

Il giorno lunedì 14 aprile 2014 08:25:00 UTC+2, User ha scritto:
>
> Yes but with overflow:visible (the default css setting) there are no 
> scroll bars and if the table has enough columns then the browser will show 
> a horizontal scrollbar anyway as part of the browser window (as opposed to 
> with auto showing the scrollbars as part of the div).  With "auto" It just 
> gives the feeling of html frames which I thought most people agree are 
> annoying except in limited circumstances.
>
> For me it just seems like overflow: auto is just an annoyance with no 
> benefit, but I was wondering if there was something I was overlooking.  
>
> On Sunday, April 13, 2014 1:46:32 PM UTC-4, Paolo Caruccio wrote:
>
>> With overflow:auto the scrollbars (vertical and horizontal) are visible 
>> only when it is necessary.
>> Making scrollbars visible only when you need them is for aesthetic 
>> reasons. Indeed not all the tables have a great number of columns. 
>>
>> Il giorno domenica 13 aprile 2014 13:32:41 UTC+2, User ha scritto:
>>>
>>> Sorry you're right it's auto not hidden that was a typo.  But why not 
>>> make it visible?
>>>
>>> On Sunday, April 13, 2014 5:37:53 AM UTC-4, Paolo Caruccio wrote:
>>>>
>>>> If you mean the view "*appadmin/select/db?query=your query"* actually 
>>>> the table with the resulting rows is wrapped in a div with "
>>>> overflow:auto".
>>>> Therefore if you have more columns than the width of the browser a 
>>>> horizontal scrollbar will be shown and the table will scroll horizontally. 
>>>> The horizontal scrollbar (that is managed by browser not by web2py) is 
>>>> positioned after the last displayed row but you can scroll the table with 
>>>> arrow keys on the keyboard.
>>>> For the sake of completeness, if the div wrapper had "overflow:hidden" 
>>>> you couldn't see any scrollbar.
>>>> 
>>>>
>>>> Il giorno domenica 13 aprile 2014 03:01:35 UTC+2, User ha scritto:
>>>>>
>>>>> In appadmin, if I query a table that has more columns than the width 
>>>>> of my browser there will be a horizontal scrollbar places on the div 
>>>>> containing the database rows.  I find this annoying because in order to 
>>>>> scroll horizontally I have to go to the bottom of the search results 
>>>>> first 
>>>>> to find the horizontal scrollbar and then scroll.
>>>>>
>>>>> If the containing div had overflow: visible then I could use the 
>>>>> browser's horizontal scrollbar which is much more convenient.  My 
>>>>> question 
>>>>> is what purpose does having overflow = hidden serve in this context?
>>>>>
>>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Why does appadmin have css overflow: hidden in database results?

2014-04-13 Thread Paolo Caruccio
With overflow:auto the scrollbars (vertical and horizontal) are visible 
only when it is necessary.
Making scrollbars visible only when you need them is for aesthetic reasons. 
Indeed not all the tables have a great number of columns. 

Il giorno domenica 13 aprile 2014 13:32:41 UTC+2, User ha scritto:
>
> Sorry you're right it's auto not hidden that was a typo.  But why not make 
> it visible?
>
> On Sunday, April 13, 2014 5:37:53 AM UTC-4, Paolo Caruccio wrote:
>>
>> If you mean the view "*appadmin/select/db?query=your query"* actually 
>> the table with the resulting rows is wrapped in a div with "overflow:auto
>> ".
>> Therefore if you have more columns than the width of the browser a 
>> horizontal scrollbar will be shown and the table will scroll horizontally. 
>> The horizontal scrollbar (that is managed by browser not by web2py) is 
>> positioned after the last displayed row but you can scroll the table with 
>> arrow keys on the keyboard.
>> For the sake of completeness, if the div wrapper had "overflow:hidden" 
>> you couldn't see any scrollbar.
>> 
>>
>> Il giorno domenica 13 aprile 2014 03:01:35 UTC+2, User ha scritto:
>>>
>>> In appadmin, if I query a table that has more columns than the width of 
>>> my browser there will be a horizontal scrollbar places on the div 
>>> containing the database rows.  I find this annoying because in order to 
>>> scroll horizontally I have to go to the bottom of the search results first 
>>> to find the horizontal scrollbar and then scroll.
>>>
>>> If the containing div had overflow: visible then I could use the 
>>> browser's horizontal scrollbar which is much more convenient.  My question 
>>> is what purpose does having overflow = hidden serve in this context?
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Why does appadmin have css overflow: hidden in database results?

2014-04-13 Thread Paolo Caruccio
If you mean the view "*appadmin/select/db?query=your query"* actually the 
table with the resulting rows is wrapped in a div with "overflow:auto".
Therefore if you have more columns than the width of the browser a 
horizontal scrollbar will be shown and the table will scroll horizontally. 
The horizontal scrollbar (that is managed by browser not by web2py) is 
positioned after the last displayed row but you can scroll the table with 
arrow keys on the keyboard.
For the sake of completeness, if the div wrapper had "overflow:hidden" you 
couldn't see any scrollbar.


Il giorno domenica 13 aprile 2014 03:01:35 UTC+2, User ha scritto:
>
> In appadmin, if I query a table that has more columns than the width of my 
> browser there will be a horizontal scrollbar places on the div containing 
> the database rows.  I find this annoying because in order to scroll 
> horizontally I have to go to the bottom of the search results first to find 
> the horizontal scrollbar and then scroll.
>
> If the containing div had overflow: visible then I could use the browser's 
> horizontal scrollbar which is much more convenient.  My question is what 
> purpose does having overflow = hidden serve in this context?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Why does LINK work and STYLE doesn't?

2014-04-07 Thread Paolo Caruccio
Well, I think that style element with the src attribute in order to link an 
external stylesheet works only in XHTML2. Definitely it does not work when 
html5 doctype is applied and the current welcome app layout is in html5. 
I will open an issue, asking to correct the example in the book.

Il giorno lunedì 7 aprile 2014 02:03:53 UTC+2, scruffy...@gmail.com ha 
scritto:
>
> Hi,
>
> I'm learning web2py and just messing around... 
>
> I have a static file:  css/style.css
>
> It contains:   h1 {color: red;}
>
> When I make a simple view with an h1 block, my stylesheet gets applied if 
> I put:
>{{=LINK(_rel="stylesheet", _type="text/css", _href=URL('static', 
> 'css/style.css'))}}  in my , but not if I put:
>{{=STYLE(_src=URL('static', 'css/style.css'))}} which is similar to the 
> example given  for the STYLE helper in chapter 5 of the web2py manual. 
>  What am I missing?
>
> Thanks,
> Scruffy
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Bootstrap3 package - help to test

2014-03-16 Thread Paolo Caruccio
Hi Dmitry,

reCaptcha was not included in the package. I will use your code in the next 
version of the package.
Thank you.


Il giorno domenica 16 marzo 2014 03:12:43 UTC+1, Dmitry Rodetsky ha scritto:
>
> Ok it seems I got this thing fixed up. The problem was in the 
> bootstrap3.py module. I am including an updated version
> as an attachment. Line changes: 203, 440-442.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: how to resize an expand_one rendered content

2014-03-09 Thread Paolo Caruccio
A possible solution could be the following:

1) wrap the iframe with a div with class "w2p-video-container"
2) set your css rules by targeting div.w2p-video-container>iframe

For example:
in the view


{{=XML(expand_one('http://www.youtube.com/watch?v=7yvt2Pt6LRA',cache.ram('mycache',lambda:dict(),3600)))}}


in the css file

div.w2p-video-container>iframe {width:800px !important; height:600px !
important;}



Il giorno domenica 9 marzo 2014 02:07:03 UTC+1, sasogeek ha scritto:
>
> Can you please give an example how? I tried altering the dimensions from 
> the autolinks.py file and it didn't work, and really idk where else i can 
> apply css since i don't see the rendering code until after it's rendered... 
> what i write is {{=XML(expand_one(... , ...))}} Not sure where or how I can 
> apply css to alter the width and height of the rendered iframe element
>
>
> On Thursday, 6 March 2014 13:54:29 UTC, Massimo Di Pierro wrote:
>>
>> You have to use CSS.
>>
>> On Wednesday, 5 March 2014 19:57:05 UTC-6, Samuel Sowah wrote:
>>>
>>> How can I resize the youtube or vimeo embed or google doc viewer 
>>> whenever i call expand_one() on a url?
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Complex css layout -- is web2py the right choice?

2014-03-08 Thread Paolo Caruccio
About the javascript issue, if the script is in a view

 "{{=URL('static', 'images/slide01.jpg')}}": 'bottom center'

should work.
Instead, if the 'settings' variable is in an external javascript file and 
assuming that the javascript file is in the static/js folder 

"../static/images/slide01.jpg": 'bottom center'

should work but please test it.


Il giorno sabato 8 marzo 2014 21:46:05 UTC+1, Austin Taylor ha scritto:
>
> Thanks Paolo! I used firebug to check which css forms were pulling through 
> and Calendar.css and web2py.css were being shown. However, when I started 
> editing the proper custom_layout.html the other css files came through. It 
> was a complete mistake on my end.
>
>
>
> On Saturday, March 8, 2014 3:26:04 PM UTC-5, Paolo Caruccio wrote:
>>
>> The following files are useful only if your template is based on 
>> bootstrap 2 (like the web2py scaffolding template):
>>
>>  - css/bootstrap.min.css
>>  - css/bootstrap-responsive.min.css
>>  - css/web2py_bootstrap.css
>>
>> otherwise you should omit them.
>>
>> What do you mean with "Only web2py.css and calendar.css work" ? Are you 
>> able to see if the browser gives errors by using its developers tools?
>> If you are not able then you could read:
>> for chrome https://developers.google.com/chrome-developer-tools/
>> for firefox https://developer.mozilla.org/en-US/docs/Tools
>> Anyway the simplest and trivial check is to verify if all the files are 
>> in the static/css folder.
>>
>> Il giorno sabato 8 marzo 2014 20:31:03 UTC+1, Austin Taylor ha scritto:
>>>
>>> Thank you so much, Paolo!! This is wonderful! It certainly helped my 
>>> understanding. However, whenever I try to use this code: Only web2py.css 
>>> and calendar.css work.
>>>
>>> {{
>>> response.files.insert(0,URL('static','css/web2py.css'))
>>> response.files.insert(1,URL('static','css/bootstrap.min.css'))
>>> response.files.insert(2,URL('static','css/bootstrap-responsive.min.css'))
>>> response.files.insert(3,URL('static','css/web2py_bootstrap.css'))
>>> response.files.insert(4,URL('static','css/style.css'))
>>> response.files.insert(5,URL('static','css/style-desktop.css'))
>>> }}
>>>
>>> After a little troubleshooting I figured out the calendar.css was being 
>>> pulled from web2py_ajax.html
>>>
>>> Any idea on why the code above wouldn't work in the layout_custom.html? 
>>> I REALLY appreciate your help. This has made such a difference!
>>>
>>> On Saturday, March 8, 2014 9:08:29 AM UTC-5, Paolo Caruccio wrote:
>>>>
>>>> It's just a demo. The code is not tested. You should consider this only 
>>>> as a very basic reference. The filenames here reported are only 
>>>> conventional you should use yours.
>>>>
>>>> 1) put the css files of the template in static/css folder of your 
>>>> web2py application;
>>>> 2) put the js files of the template in static/js folder of your web2py 
>>>> application. Please note that jquery is already shipped with web2py (check 
>>>> web2py_ajax.html);
>>>> 3) assuming that the index.html located to http://pastebin.com/zbnWjs1v is 
>>>> the main file of the template, you should modify it in order to get 
>>>> advantage of the web2py features and save it in the views folder as 
>>>> layout_custom.html (check the layout_custom.html here attached). Please 
>>>> note the {{include}} that replaced the main content and the changes in the 
>>>>  section;
>>>> 4) create in views/default folder a file named intro.html (here 
>>>> attached) containing the main content from the index.html of the template 
>>>> and extending layout_custom.html;
>>>> 5) in controller/default.py add the following:
>>>>
>>>> def intro():
>>>> return locals()
>>>>
>>>> 6) in the browser see http://ipserver/appname/default/intro page (of 
>>>> course you have to replace ipserver and appname with real values).
>>>>
>>>> As said this is only a basic guide. You should make other adjustments 
>>>> in order to obtain a full working layout based on the template but we are 
>>>> here to help you in case of necessity.
>>>>
>>>>
>>>> Il giorno sabato 8 ma

[web2py] Re: Complex css layout -- is web2py the right choice?

2014-03-08 Thread Paolo Caruccio
The following files are useful only if your template is based on bootstrap 
2 (like the web2py scaffolding template):

 - css/bootstrap.min.css
 - css/bootstrap-responsive.min.css
 - css/web2py_bootstrap.css

otherwise you should omit them.

What do you mean with "Only web2py.css and calendar.css work" ? Are you 
able to see if the browser gives errors by using its developers tools?
If you are not able then you could read:
for chrome https://developers.google.com/chrome-developer-tools/
for firefox https://developer.mozilla.org/en-US/docs/Tools
Anyway the simplest and trivial check is to verify if all the files are in 
the static/css folder.

Il giorno sabato 8 marzo 2014 20:31:03 UTC+1, Austin Taylor ha scritto:
>
> Thank you so much, Paolo!! This is wonderful! It certainly helped my 
> understanding. However, whenever I try to use this code: Only web2py.css 
> and calendar.css work.
>
> {{
> response.files.insert(0,URL('static','css/web2py.css'))
> response.files.insert(1,URL('static','css/bootstrap.min.css'))
> response.files.insert(2,URL('static','css/bootstrap-responsive.min.css'))
> response.files.insert(3,URL('static','css/web2py_bootstrap.css'))
> response.files.insert(4,URL('static','css/style.css'))
> response.files.insert(5,URL('static','css/style-desktop.css'))
> }}
>
> After a little troubleshooting I figured out the calendar.css was being 
> pulled from web2py_ajax.html
>
> Any idea on why the code above wouldn't work in the layout_custom.html? I 
> REALLY appreciate your help. This has made such a difference!
>
> On Saturday, March 8, 2014 9:08:29 AM UTC-5, Paolo Caruccio wrote:
>>
>> It's just a demo. The code is not tested. You should consider this only 
>> as a very basic reference. The filenames here reported are only 
>> conventional you should use yours.
>>
>> 1) put the css files of the template in static/css folder of your web2py 
>> application;
>> 2) put the js files of the template in static/js folder of your web2py 
>> application. Please note that jquery is already shipped with web2py (check 
>> web2py_ajax.html);
>> 3) assuming that the index.html located to http://pastebin.com/zbnWjs1v is 
>> the main file of the template, you should modify it in order to get 
>> advantage of the web2py features and save it in the views folder as 
>> layout_custom.html (check the layout_custom.html here attached). Please 
>> note the {{include}} that replaced the main content and the changes in the 
>>  section;
>> 4) create in views/default folder a file named intro.html (here attached) 
>> containing the main content from the index.html of the template and 
>> extending layout_custom.html;
>> 5) in controller/default.py add the following:
>>
>> def intro():
>> return locals()
>>
>> 6) in the browser see http://ipserver/appname/default/intro page (of 
>> course you have to replace ipserver and appname with real values).
>>
>> As said this is only a basic guide. You should make other adjustments in 
>> order to obtain a full working layout based on the template but we are here 
>> to help you in case of necessity.
>>
>>
>> Il giorno sabato 8 marzo 2014 01:55:10 UTC+1, Austin Taylor ha scritto:
>>>
>>> Hello,
>>>
>>> I purchased this CSS template and I want to integrate web2py with it 
>>> (because I love web2py).
>>> http://www.4templates.com/website-templates/726353988-WT00926/#green
>>>
>>> It has multiple html files it references, js files, and css sheets.
>>> Index.html located here: http://pastebin.com/zbnWjs1v
>>>
>>>
>>> How would I be able to normalize this enough to where I can extend the 
>>> "layout.html" into other sheets and use all of the .js/css that comes with 
>>> it?
>>>
>>> I've tried for 2 days now and I keep running into issues. Even when I 
>>> try to just return locals() (if I put the index.html in views) it still 
>>> doesn't apply the css sheets. I've tried using 
>>> {{=URL('static','css/style.css')")}} with no luck either.
>>>
>>> Please help me find the best way to make this page normal.
>>>
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.


[web2py] Re: Complex css layout -- is web2py the right choice?

2014-03-08 Thread Paolo Caruccio
It's just a demo. The code is not tested. You should consider this only as 
a very basic reference. The filenames here reported are only conventional 
you should use yours.

1) put the css files of the template in static/css folder of your web2py 
application;
2) put the js files of the template in static/js folder of your web2py 
application. Please note that jquery is already shipped with web2py (check 
web2py_ajax.html);
3) assuming that the index.html located to http://pastebin.com/zbnWjs1v is 
the main file of the template, you should modify it in order to get 
advantage of the web2py features and save it in the views folder as 
layout_custom.html (check the layout_custom.html here attached). Please 
note the {{include}} that replaced the main content and the changes in the 
 section;
4) create in views/default folder a file named intro.html (here attached) 
containing the main content from the index.html of the template and 
extending layout_custom.html;
5) in controller/default.py add the following:

def intro():
return locals()

6) in the browser see http://ipserver/appname/default/intro page (of course 
you have to replace ipserver and appname with real values).

As said this is only a basic guide. You should make other adjustments in 
order to obtain a full working layout based on the template but we are here 
to help you in case of necessity.


Il giorno sabato 8 marzo 2014 01:55:10 UTC+1, Austin Taylor ha scritto:
>
> Hello,
>
> I purchased this CSS template and I want to integrate web2py with it 
> (because I love web2py).
> http://www.4templates.com/website-templates/726353988-WT00926/#green
>
> It has multiple html files it references, js files, and css sheets.
> Index.html located here: http://pastebin.com/zbnWjs1v
>
>
> How would I be able to normalize this enough to where I can extend the 
> "layout.html" into other sheets and use all of the .js/css that comes with 
> it?
>
> I've tried for 2 days now and I keep running into issues. Even when I try 
> to just return locals() (if I put the index.html in views) it still doesn't 
> apply the css sheets. I've tried using {{=URL('static','css/style.css')")}} 
> with no luck either.
>
> Please help me find the best way to make this page normal.
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/d/optout.
Title:  












Untitled Project






Dropdown

Lorem ipsum dolor
Magna phasellus
Etiam dolore nisl

Phasellus consequat

Lorem ipsum dolor
Phasellus consequat
Magna phasellus
Etiam dolore nisl


Veroeros feugiat


Left Sidebar
Right Sidebar
No Sidebar















Magna feugiat lorem ipsum dolor gravida
Nulla justo magna veroeros tempus









{{include}}










lorem ipsum dolor sit amet

Aenean vel justo nulla, at gravida elit. In hac habitasse platea dictumst. Quisque gravida commodo volutpat. Vivamus blandit risus in urna venena

[web2py] Re: Using ZURB Foundation?

2014-02-27 Thread Paolo Caruccio
It will be ready in few days. I'm doing the final checks.


Il giorno giovedì 27 febbraio 2014 21:23:41 UTC+1, Timo Bahner ha scritto:
>
> How is your foundation package coming along?
>
> Timo
>
> On Thursday, December 26, 2013 6:15:56 AM UTC+1, Timo Bahner wrote:
>>
>> Hi. Is it possible to use ZURB Foundation for frontend design with web2py?
>>
>> Thanks & Merry Christmas.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: CSS table width not limited as wished

2014-02-26 Thread Paolo Caruccio
I'm glad to hear this but please keep in mind that the modify you made will 
change the width of all elements with "text" and "password" type attribute 
as well as select elements.
Therefore if you will be able to target only the interested elements it 
will be better. For example:

table#t1 [type="text"], table#t1 [type="password"], table#t1 select {
  width: auto !important;
}

should also work but only for the elements children of the table with 
id="t1".

Moreover, I suggest you to don't modify web2py files. In the specific case 
you should create your css file and reference it in the layout.html as last 
css file. 

Il giorno mercoledì 26 febbraio 2014 20:39:08 UTC+1, Dominique ha scritto:
>
> Fantastic !
> Now that works fine !
> I changed the line 33 of web2py.css as you advised.
>
> Thank you very much Paolo !
> Dominique
>
> Le mercredi 26 février 2014 20:09:36 UTC+1, Paolo Caruccio a écrit :
>>
>> Generally speaking the issue is due to a rule in web2py.css (
>> https://github.com/web2py/web2py/blob/master/applications/welcome/static/css/web2py.css#L33
>> ):
>>
>> [type="text"], [type="password"], select {
>>   margin-right: 5px; width: 300px;
>> }
>>
>> You should override this rule in your css (increasing the specificity).
>> There are several ways to accomplish this goal. One is that in my 
>> previous post.
>> Another, more general and therefore less controllable, is:
>>
>> [type="text"], [type="password"], select {
>>   width: auto !important;
>> }
>>
>>
>> Il giorno mercoledì 26 febbraio 2014 18:04:08 UTC+1, Dominique ha scritto:
>>>
>>> Thank you Paolo.
>>> It works perfectly on the test model.
>>>
>>> But not on my app, for whatever reason...
>>> I'll investigate that later...
>>>
>>> Anyway thank you very much
>>> Dominique
>>>
>>> Le mardi 25 février 2014 20:01:56 UTC+1, Paolo Caruccio a écrit :
>>>>
>>>> Please try with:
>>>>
>>>> table#t1 input{width:auto;}
>>>>
>>>>
>>>> Il giorno martedì 25 febbraio 2014 18:45:31 UTC+1, Dominique ha scritto:
>>>>>
>>>>> Unfortunately, no ...
>>>>>
>>>>> Le mardi 25 février 2014 18:29:38 UTC+1, Massimo Di Pierro a écrit :
>>>>>>
>>>>>> I think the problem may be the size of the INPUT. Try add this in 
>>>>>> style
>>>>>>
>>>>>> input { width: 50px; } 
>>>>>>
>>>>>>  
>>>>>>
>>>>>> On Tuesday, 25 February 2014 10:49:07 UTC-6, Dominique wrote:
>>>>>>>
>>>>>>> Hello Massino,
>>>>>>>
>>>>>>> Thank you so much for spending some of your time for me. I 
>>>>>>> appreciate.
>>>>>>>
>>>>>>> The following codes will show you my problem:
>>>>>>> In the controller:
>>>>>>>
>>>>>>>> def form_test():
>>>>>>>> form = FORM(TABLE(TR(FIELDSET('This is a test for Field 1:  ', 
>>>>>>>> INPUT(_name='f1', id='f1')),
>>>>>>>>  FIELDSET('This is a test for Field 2:  ', 
>>>>>>>> INPUT(_name='f2', id='f2')),
>>>>>>>>  FIELDSET('This is a test for Field 3:  ', 
>>>>>>>> INPUT(_name='f3', id='f3')),
>>>>>>>>  FIELDSET('This is a test for Field 4:  ', 
>>>>>>>> INPUT(_name='f4', id='f4')),
>>>>>>>>  FIELDSET('This is a test for Field 3:  ', 
>>>>>>>> INPUT(_name='f5', id='f5'))
>>>>>>>>  ), _id='t1'))
>>>>>>>> return dict(form=form)
>>>>>>>>
>>>>>>>
>>>>>>> In the view:
>>>>>>>
>>>>>>>> {{extend 'layout.html'}}
>>>>>>>> 
>>>>>>>> table  {  font-size: 12px; max-width:80%}
>>>>>>>> td{font-weight:bold;vertical-align:top;}
>>>>>>>> fieldset {width:25%; border: groove}
>>>>>>>> 
>>>>>>>> {{=form}}
>>>>>>>>
>>>>>>>> What I get and what I want are shown in the attached images: I want 
>>>>>>> all the fields to appear on screen without scrollbars.
>>>>>>> Note that the image "what I want" is just the code (form + css 
>>>>>>> script) copied in notepad and opened in firefox. 
>>>>>>>
>>>>>>> The table css properties I add in my script seem not to be taken 
>>>>>>> into account in web2py.
>>>>>>> The point is that I don't know which web2py file I need to modify 
>>>>>>> (and where).
>>>>>>>
>>>>>>> I hope it's clearer ;)
>>>>>>>
>>>>>>> Thank you for your help
>>>>>>> Dominique
>>>>>>>
>>>>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: CSS table width not limited as wished

2014-02-26 Thread Paolo Caruccio
Generally speaking the issue is due to a rule in web2py.css 
(https://github.com/web2py/web2py/blob/master/applications/welcome/static/css/web2py.css#L33):

[type="text"], [type="password"], select {
  margin-right: 5px; width: 300px;
}

You should override this rule in your css (increasing the specificity).
There are several ways to accomplish this goal. One is that in my previous 
post.
Another, more general and therefore less controllable, is:

[type="text"], [type="password"], select {
  width: auto !important;
}


Il giorno mercoledì 26 febbraio 2014 18:04:08 UTC+1, Dominique ha scritto:
>
> Thank you Paolo.
> It works perfectly on the test model.
>
> But not on my app, for whatever reason...
> I'll investigate that later...
>
> Anyway thank you very much
> Dominique
>
> Le mardi 25 février 2014 20:01:56 UTC+1, Paolo Caruccio a écrit :
>>
>> Please try with:
>>
>> table#t1 input{width:auto;}
>>
>>
>> Il giorno martedì 25 febbraio 2014 18:45:31 UTC+1, Dominique ha scritto:
>>>
>>> Unfortunately, no ...
>>>
>>> Le mardi 25 février 2014 18:29:38 UTC+1, Massimo Di Pierro a écrit :
>>>>
>>>> I think the problem may be the size of the INPUT. Try add this in style
>>>>
>>>> input { width: 50px; } 
>>>>
>>>>  
>>>>
>>>> On Tuesday, 25 February 2014 10:49:07 UTC-6, Dominique wrote:
>>>>>
>>>>> Hello Massino,
>>>>>
>>>>> Thank you so much for spending some of your time for me. I appreciate.
>>>>>
>>>>> The following codes will show you my problem:
>>>>> In the controller:
>>>>>
>>>>>> def form_test():
>>>>>> form = FORM(TABLE(TR(FIELDSET('This is a test for Field 1:  ', 
>>>>>> INPUT(_name='f1', id='f1')),
>>>>>>  FIELDSET('This is a test for Field 2:  ', 
>>>>>> INPUT(_name='f2', id='f2')),
>>>>>>  FIELDSET('This is a test for Field 3:  ', 
>>>>>> INPUT(_name='f3', id='f3')),
>>>>>>  FIELDSET('This is a test for Field 4:  ', 
>>>>>> INPUT(_name='f4', id='f4')),
>>>>>>  FIELDSET('This is a test for Field 3:  ', 
>>>>>> INPUT(_name='f5', id='f5'))
>>>>>>  ), _id='t1'))
>>>>>> return dict(form=form)
>>>>>>
>>>>>
>>>>> In the view:
>>>>>
>>>>>> {{extend 'layout.html'}}
>>>>>> 
>>>>>> table  {  font-size: 12px; max-width:80%}
>>>>>> td{font-weight:bold;vertical-align:top;}
>>>>>> fieldset {width:25%; border: groove}
>>>>>> 
>>>>>> {{=form}}
>>>>>>
>>>>>> What I get and what I want are shown in the attached images: I want 
>>>>> all the fields to appear on screen without scrollbars.
>>>>> Note that the image "what I want" is just the code (form + css script) 
>>>>> copied in notepad and opened in firefox. 
>>>>>
>>>>> The table css properties I add in my script seem not to be taken into 
>>>>> account in web2py.
>>>>> The point is that I don't know which web2py file I need to modify (and 
>>>>> where).
>>>>>
>>>>> I hope it's clearer ;)
>>>>>
>>>>> Thank you for your help
>>>>> Dominique
>>>>>
>>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: CSS table width not limited as wished

2014-02-25 Thread Paolo Caruccio
Please try with:

table#t1 input{width:auto;}


Il giorno martedì 25 febbraio 2014 18:45:31 UTC+1, Dominique ha scritto:
>
> Unfortunately, no ...
>
> Le mardi 25 février 2014 18:29:38 UTC+1, Massimo Di Pierro a écrit :
>>
>> I think the problem may be the size of the INPUT. Try add this in style
>>
>> input { width: 50px; } 
>>
>>  
>>
>> On Tuesday, 25 February 2014 10:49:07 UTC-6, Dominique wrote:
>>>
>>> Hello Massino,
>>>
>>> Thank you so much for spending some of your time for me. I appreciate.
>>>
>>> The following codes will show you my problem:
>>> In the controller:
>>>
 def form_test():
 form = FORM(TABLE(TR(FIELDSET('This is a test for Field 1:  ', 
 INPUT(_name='f1', id='f1')),
  FIELDSET('This is a test for Field 2:  ', 
 INPUT(_name='f2', id='f2')),
  FIELDSET('This is a test for Field 3:  ', 
 INPUT(_name='f3', id='f3')),
  FIELDSET('This is a test for Field 4:  ', 
 INPUT(_name='f4', id='f4')),
  FIELDSET('This is a test for Field 3:  ', 
 INPUT(_name='f5', id='f5'))
  ), _id='t1'))
 return dict(form=form)

>>>
>>> In the view:
>>>
 {{extend 'layout.html'}}
 
 table  {  font-size: 12px; max-width:80%}
 td{font-weight:bold;vertical-align:top;}
 fieldset {width:25%; border: groove}
 
 {{=form}}

 What I get and what I want are shown in the attached images: I want all 
>>> the fields to appear on screen without scrollbars.
>>> Note that the image "what I want" is just the code (form + css script) 
>>> copied in notepad and opened in firefox. 
>>>
>>> The table css properties I add in my script seem not to be taken into 
>>> account in web2py.
>>> The point is that I don't know which web2py file I need to modify (and 
>>> where).
>>>
>>> I hope it's clearer ;)
>>>
>>> Thank you for your help
>>> Dominique
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Strange artifact

2014-02-07 Thread Paolo Caruccio
Please pack a post a w2p app with the only code for grid. I will test it in 
IE10. I can't install IE11 on windows8.
Maybe the issue is related to css rules applied to that DOM element but 
without code I'm not able to help you.


Il giorno venerdì 7 febbraio 2014 05:16:10 UTC+1, horridohobbyist ha 
scritto:
>
> Really? Nobody knows? Nobody cares?
>
>
> On Wednesday, 5 February 2014 20:53:13 UTC-5, horridohobbyist wrote:
>>
>> Sorry, the artifact appears in SQLFORM.grid, regardless of pagination.
>>
>> Does *anyone* know what's going on??
>>
>>
>> On Wednesday, 5 February 2014 10:57:30 UTC-5, horridohobbyist wrote:
>>>
>>> I'm using SQLFORM.grid with pagination. In Chrome, Firefox, and Safari, 
>>> the bottom of the grid looks like this:
>>>
>>>
>>> 
>>>
>>> But in Internet Explorer 11 (and presumably earlier versions of IE), the 
>>> bottom of the grid looks like this:
>>>
>>>
>>> 
>>>
>>> What's that strange artifact just above the pagination bar?? And why 
>>> does it only show up in the IE browser?
>>>
>>> Thanks.
>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: remove the tags of SQLFORM.grid?

2014-01-26 Thread Paolo Caruccio
In HTML4 specification (
http://www.w3.org/TR/html401/struct/tables.html#edef-COL) the *col* element 
is empty and for HTML5 (http://www.w3.org/TR/html5/syntax.html#void-elements) 
it is void. This means that the element hasn't the end tag. Therefore +1 
for the patch that Anthony has proposed. 

For the sake of completeness:

 is valid in html5 and xhtml but not in html4

while

   is valid in html5 and html4 but not in xhtml


Il giorno domenica 26 gennaio 2014 16:53:46 UTC+1, Anthony ha scritto:
>
> No, I mean:
>
> 
>
> with no closing tag.
>
> On Sunday, January 26, 2014 10:46:45 AM UTC-5, Thomas Wimmer wrote:
>>
>>
>>
>> Am Sonntag, 26. Januar 2014 16:34:48 UTC+1 schrieb Anthony:
>>>
>>> That's probably the best way for now, but we should fix that.
>>>
>>> Would the tags validate if written as ? That would be a much 
>>> easier fix.
>>>
>>> Anthony
>>>
>>
>> No, this brings up:
>>
>>> Table column 10 established by element col has no cells beginning in it.
>>> …http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Bootstrap 3 custom checkbox widget

2014-01-23 Thread Paolo Caruccio
What about

return DIV(TAG[''](*opts, **attr))



Il giorno giovedì 23 gennaio 2014 19:45:20 UTC+1, Annet ha scritto:
>
> I have the following custom checkboxes widget:
>
>
> def bs3checkboxeswidget(field, value, **attributes):
>
> if isinstance(value, (list, tuple)):
> values = [str(v) for v in value]
> else:
> values = [str(value)]
>
> attr = OptionsWidget._attributes(field, {}, **attributes)
> attr['_class'] = attr.get('_class', 'web2py_checkboxeswidget')
>
> requires = field.requires
> if not isinstance(requires, (list, tuple)):
> requires = [requires]
> if requires and hasattr(requires[0], 'options'):
> options = requires[0].options()
> else:
> raise SyntaxError('widget cannot determine options of %s'
>   % field)
>
> options = [(k, v) for k, v in options if k != '']
> opts = []
>
> for k, v in options:
> if k in values:
> r_value = k
> else:
> r_value = []
> opts.append(LABEL(v, INPUT(_type='checkbox',
>_id='%s%s' % (field.name, k),
>_name=field.name,
>requires=attr.get('requires', None),
>hideerror=True, _value=k,
>value=r_value),
>  _for='%s%s' % (field.name, k)))
>
> if opts:
> opts.append(
> INPUT(requires=attr.get('requires', None),
>   _style="display:none;",
>   _disabled="disabled",
>   _name=field.name,
>   hideerror=False))
>
> return TAG[''](*opts, **attr)
>
>
> It generates:
>
> 
> opening_hours
> 
> 
> 
> event_list
> 
> 
> 
> timetable
> 
> 
>
> I want this to be enclosed by a div
>
> 
> 
> opening_hours
> 
> 
> 
> event_list
> 
> 
> 
> timetable
> 
> 
> 
>
> How do I code this?
>
>
> Kind regards,
>
> Annet
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Static form control in case of read only field

2014-01-20 Thread Paolo Caruccio
Annet,
thank you for your comments.
About the checkboxes and radio controls please note that the package works 
since Version 2.8.2-stable+timestamp.2013.12.17.16.49.17 of web2py. In the 
previous versions the related widget code in gluon/sqlhtml.py was different.
For the other suggestions, I found the solution and I will update the 
package as soon as possible.


Il giorno lunedì 20 gennaio 2014 18:56:38 UTC+1, Annet ha scritto:
>
> Hi Paolo,
>
> Thanks for your reply. I added the following lines of code to my bootstra3 
> function
>
> if isinstance(controls, basestring):
> # string
> controls = P(controls, _class='form-control-static')
>
> elif isinstance(controls, INPUT):
> if controls['_type'] not in ['file', 'checkbox', 'radio']:
> controls.add_class('form-control')
> if controls['_type'] == 'submit':
> # flag submit button
> _submit = True
> controls['_class'] = 'btn btn-primary'
> elif controls['_type'] == 'file':
> controls['_class'] = 'input-file'
>
> elif isinstance(controls, SPAN):
> # static text
> controls = P(controls[0])
> controls.add_class('form-control-static')
>
> But that did not add the  element.
>
> I had a look at your bootstrap3 package, and was impressed. The reason I 
> am not using it it that I only 
> need a view adjustments to SQLFORM, hence my own attempt at a bootstrap3 
> function.
>
> I would like to make a comment:
> In the insert_person and update_person form the gender and spoken_language 
> radios and checkboxes 
> aren't rendered the bootstrap way.
>
> And two things I would have done differently:
> Put the flash elsewhere, in my browser it's blocking the tests menu items.
> In the navigation examples I would have put the nav pills and nav stacked
> examples beneath each under.
>
> I am running web2py 2.7.4 on Mac OS X Lion Server in Firefox 26.0
>
>
> Kind regards,
>
> Annet
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Static form control in case of read only field

2014-01-20 Thread Paolo Caruccio
Hi Annet,

in your bootstrap3  function, you should check if "controls" is an instance 
of string, number or  SPAN and change the controls layout as you want.

For more details you could see the "build_row" function in the attached 
module (search for "form-control-static").

If you are interested you could test my bootstrap3 package posted in 
https://groups.google.com/d/msg/web2py/oSABtjmnYM0/DxJUyj6c3uoJ that 
includes the above module.


Il giorno lunedì 20 gennaio 2014 09:41:44 UTC+1, Annet ha scritto:
>
> Hi Anthony,
>
> Thanks for your reply.
>
> I have a table named register:
>
> db.define_table('register',
> Field('nodeID', 'reference node', writable=False, readable=False),
> Field('interfaceCategoryID', 'reference interface_category', 
> writable=False, readable=False),
> ...
> migrate=False)
>
>
> In the register function I have the following lines of code:
>
> form=SQLFORM(db.register, labels=dict(agreedTaC='', agreedDirectDebit=''), 
> separator='', formstyle=bootstrap3)
>
>
> bootstrap3 is a function in a module:
>
> def bootstrap3(form, fields):
> form.add_class('form-horizontal')
> parent = FIELDSET()
> for id, label, controls, help in fields:
> if not help:
> _help = ''
> else:
> # wrappers
> _help = SPAN(help, _class='help-block')
> # embed _help into _controls
> _controls = DIV(controls, _help, _class='col-sm-6 controls')
> # submit unflag by default
> _submit = False
>
> if isinstance(controls, INPUT):
> if controls['_type'] not in ['file', 'checkbox', 'radio']:
> controls.add_class('form-control')
> if controls['_type'] == 'submit':
> # flag submit button
> _submit = True
> controls['_class'] = 'btn btn-primary'
> if controls['_type'] == 'file':
> controls['_class'] = 'input-file'
>
> # For password fields, which are wrapped in a CAT object.
> if isinstance(controls, CAT) and isinstance(controls[0], INPUT):
> controls[0].add_class('form-control')
>
> if isinstance(controls, SELECT):
> controls.add_class('form-control')
>
> if isinstance(controls, TEXTAREA):
> controls.add_class('form-control')
>
> if isinstance(label, LABEL):
> label['_class'] = 'col-sm-4 control-label'
>
> if _submit:
> # submit button has unwrapped label and controls, different 
> class
> parent.append(DIV(label, controls, _class='col-sm-offset-4 
> col-sm-6 form-actions', _id=id))
> # unflag submit (possible side effect)
> _submit = False
> else:
> # unwrapped label
> parent.append(DIV(label, _controls, _class='form-group', 
> _id=id))
> return parent
>
> The problem is that in a read only field its contents is aligned to the 
> top i.e it has no top
> padding. I first solved the problem by adding a selector to my css file 
> based on the
> label's id and the div's class. But, as I said I have more read only 
> fields, so I ended up
> with a selector for every read only field. That's why I am looking for a 
> more generic
> solution.
>
> I hope I provided you with enough information to help me solve the problem.
>
>
> Kind regards,
>
> Annet
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
Developed by Paolo Caruccio ( paolo.carucci...@gmail.com )
Released under web2py license
version 1 rev.20131030

Description
---
This package applies to some standard elements of web2py the bootstrap3 theme.
Current version covers: the auth navbar, the menus and SQLFORM
Supported version of bootstrap framework: 3.0.2+
Working since Version 2.8.2-stable+timestamp.2013.12.17.16.49.17 of web

[web2py] Re: Change color of a button

2014-01-19 Thread Paolo Caruccio
web2py assigns the class "btn" to the form input[type="submit"] 
(seehttps://github.com/web2py/web2py/blob/master/applications/welcome/static/js/web2py.js#L79)
 
so the button style is controlled by bootstrap css that adds a 
background-image. 
A simple workaround could be:
 
def x():
return dict(i=FORM(INPUT(_type="submit", _style=
"background-color:yellow;background-image:none;")),
j=INPUT(_type="submit", _style="background-color:yellow"))


Il giorno domenica 19 gennaio 2014 11:01:27 UTC+1, mweissen ha scritto:
>
> I wanted to change the color of a button.
> If there is a button without a form it works as excepted, but a button 
> inside a FORM does not change:
>
> def x():
> return dict(i=FORM(INPUT(_type="submit", 
> _style="background-color:yellow")),
> j=INPUT(_type="submit", _style="background-color:yellow"))
>
> The first button keeps its standard color, the second one is yellow.
>
> It's in the css-files, but I could not find it.
> Any hints?
> Regards, Martin
>
>
>  

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: db modul creating question types

2014-01-10 Thread Paolo Caruccio
My suggestion:

First we change the 'question' table definition as follows

db.define_table('question',
Field('survey', db.survey),
Field('title', length=200),
Field('created', 'datetime', default=request.now, writable=False),
Field('question_type', 'string', default='text'),
Field('choices', 'text', default='')
)

After, in the view where is the form to build the question, we advice the 
user that the options (in the textarea) should be separated with commas if 
question type is in [radio, checkboxes, select].
So we will not parse the textarea content when the question is saved in 
database, but we will have to parse the question choices field in the 
controller that manages the survey.
For example (warning: code not optimized and tested, it is only a proof of 
concept):

def display_questions():
question_id = request.args(0)
question_selected = db(db.question.id==question_id).select().first()
question_type = question_selected.question_type
question_choices = question_selected.choices
question_title = question_selected.title
if question_type in ['radio', 'checkboxes', 'select']:
choices = [c.strip() for c in question_choices.split(',')]
if question_type == 'radio':
widget = SQLFORM.widgets.radio.widget
elif question_type == 'checkboxes':
widget = SQLFORM.widgets.checkboxes.widget
elif question_type == 'select':
widget = SQLFORM.widgets.options.widget
else:
widget = SQLFORM.widgets.string.widget
form = SQLFORM.factory(Field('question',
 label=question_title,
 widget=widget,
 requires=IS_IN_SET(choices)))
else:
form = SQLFORM.factory(Field('question',
 label=question_title,
 widget=SQLFORM.widgets.text.widget,
 requires=IS_NOT_EMPTY()))
if form.process().accepted:
... save the answer in database
else:
... display error message ...


return dict(form=form)

I hope that this help you to find the right solution.

Il giorno venerdì 10 gennaio 2014 14:42:55 UTC+1, Timo Bahner ha scritto:
>
> I'm trying to do something like this:
>
> TEXT = 'text'
> RADIO = 'radio'
> SELECT = 'select'
>
> QUESTION_TYPES = (
> (TEXT, 'text'),
> (RADIO, 'radio'),
> (SELECT, 'checkboxes'),)
>
> def get_choice():
> choices = choices.split(',')
> choices_list = []
> for c in choices:
> c = c.strip()
> choices_list.append((c,c))
> choices_tuple = tuple(choices_list)
> return choices_tuple
>
> db.define_table('survey',
> Field('name', unique=True),
> Field('created', 'datetime', default=request.now, writable=False),
> Field('is_active', 'boolean', default=False))
>
> db.survey.name.requires = IS_NOT_IN_DB(db, db.survey.name)
>
> db.define_table('question',
> Field('survey', db.survey),
> Field('title', length=200),
> Field('created', 'datetime', default=request.now, writable=False),
> Field('question_type', default='text', widget=SQLFORM.widgets.radio.
> widget),
> Field('choices', 'text', default=get_choice())
> )
>
> db.question.survey.requires = IS_IN_DB(db, db.survey.id)
> db.question.question_type.requires = IS_IN_SET(QUESTION_TYPES)Enter code 
> here...
>
> Now I need somehow to call get_choice() from db.question.choice to split 
> radio and checkbox answers.
>
> Again: what I'm trying to accomplish is to set up a survey. I want to 
> create a set of questions with appadmin which can include radio, checkboxes 
> or text answers.
>
> P.S. I'm fairly new to python :)
>
> P.P.S. Or maybe I can leave it like this (but remove get_choice() from 
> db.py), split radio and checkbox answers with a comma and creat a split 
> function in controller. How's that? Complicated?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] styling widget divs

2014-01-07 Thread Paolo Caruccio

Patch:

https://code.google.com/p/web2py/issues/detail?id=1845




Il giorno martedì 7 gennaio 2014 09:15:50 UTC+1, Massimo Di Pierro ha 
scritto:
>
> Is there a patch for this? I'd take it.
>
> On Monday, 6 January 2014 15:27:59 UTC-6, Richard wrote:
>>
>> Ok, seems like a easy one, why not just commit the change on github?
>>
>> :)
>>
>> Richard
>>
>>
>> On Mon, Jan 6, 2014 at 4:22 PM, Paolo Caruccio wrote:
>>
>>> That was the solution I proposed.
>>>
>>> Il giorno lunedì 6 gennaio 2014 22:10:04 UTC+1, Richard ha scritto:
>>>>
>>>> Could the CAT just be replaced by another DIV?
>>>>
>>>> Richard
>>>>
>>>>
>>>> On Mon, Jan 6, 2014 at 3:56 PM, Paolo Caruccio 
>>>> wrote:
>>>>
>>>>> The radiowidget function returns https://github.com/
>>>>> web2py/web2py/blob/master/gluon/sqlhtml.py#L384
>>>>>
>>>>> parent(*opts, **attr)
>>>>>
>>>>> so the kargs solution of Richard works but not when style is 'divs' 
>>>>> because the parent is 'CAT' https://github.com/
>>>>> web2py/web2py/blob/master/gluon/sqlhtml.py#L364 and http
>>>>> s://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L366
>>>>>
>>>>> The same happens for the checkboxeswidget.
>>>>>
>>>>> Some time ago I opened an issue on this matter (
>>>>> https://code.google.com/p/web2py/issues/detail?id=1821) but only the 
>>>>> first problem was corrected. 
>>>>> Maybe we should open another issue ticket. What do you think?
>>>>>
>>>>>
>>>>> Il giorno lunedì 6 gennaio 2014 20:27:15 UTC+1, Richard ha scritto:
>>>>>>
>>>>>> Or you will have to create a custom widget... You can grab the 
>>>>>> radio.widget in /gluon/sqlhtml.py ans search for RadioWidget class...
>>>>>>
>>>>>> You can turn it into a method with the help of the book.
>>>>>>
>>>>>> But the kargs above should work as far as I can see look at the code 
>>>>>> of the RadioWidget...
>>>>>>
>>>>>> Richard
>>>>>>
>>>>>>
>>>>>> On Mon, Jan 6, 2014 at 2:24 PM, Richard Vézina >>>>> > wrote:
>>>>>>
>>>>>>> You can try this :
>>>>>>>
>>>>>>> **{'_class': 'radio'}
>>>>>>>
>>>>>>> As a kargs...
>>>>>>>
>>>>>>> Richard
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Jan 6, 2014 at 1:53 PM, Annet wrote:
>>>>>>>
>>>>>>>> I have the following field definition in a table:
>>>>>>>>
>>>>>>>> Field('title', length=8, requires=IS_IN_SET(['Mr', 'Mrs'. 'Ms']), 
>>>>>>>> widget=lambda k,v: SQLFORM.widgets.radio.widget(k, v, 
>>>>>>>> style='divs')),
>>>>>>>>
>>>>>>>> I would like to style the radio widget, but adding _class='radio' 
>>>>>>>> to the widget function does not add a class attribute to the divs.
>>>>>>>> Is there a way to add this class?
>>>>>>>>
>>>>>>>> Kind regards.
>>>>>>>>
>>>>>>>> Annet
>>>>>>>>
>>>>>>>> -- 
>>>>>>>> Resources:
>>>>>>>> - http://web2py.com
>>>>>>>> - http://web2py.com/book (Documentation)
>>>>>>>> - http://github.com/web2py/web2py (Source code)
>>>>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>>>>> --- 
>>>>>>>> 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+un...@googlegroups.com.
>>>>>>>>
>>>>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>  -- 
>>>>> Resources:
>>>>> - http://web2py.com
>>>>> - http://web2py.com/book (Documentation)
>>>>> - http://github.com/web2py/web2py (Source code)
>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>> --- 
>>>>> 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+un...@googlegroups.com.
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>
>>>>
>>>>  -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> 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+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] styling widget divs

2014-01-06 Thread Paolo Caruccio
That was the solution I proposed.

Il giorno lunedì 6 gennaio 2014 22:10:04 UTC+1, Richard ha scritto:
>
> Could the CAT just be replaced by another DIV?
>
> Richard
>
>
> On Mon, Jan 6, 2014 at 3:56 PM, Paolo Caruccio 
> 
> > wrote:
>
>> The radiowidget function returns 
>> https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L384
>>
>> parent(*opts, **attr)
>>
>> so the kargs solution of Richard works but not when style is 'divs' 
>> because the parent is 'CAT' 
>> https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L364 and 
>> https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L366
>>
>> The same happens for the checkboxeswidget.
>>
>> Some time ago I opened an issue on this matter (
>> https://code.google.com/p/web2py/issues/detail?id=1821) but only the 
>> first problem was corrected. 
>> Maybe we should open another issue ticket. What do you think?
>>
>>
>> Il giorno lunedì 6 gennaio 2014 20:27:15 UTC+1, Richard ha scritto:
>>>
>>> Or you will have to create a custom widget... You can grab the 
>>> radio.widget in /gluon/sqlhtml.py ans search for RadioWidget class...
>>>
>>> You can turn it into a method with the help of the book.
>>>
>>> But the kargs above should work as far as I can see look at the code of 
>>> the RadioWidget...
>>>
>>> Richard
>>>
>>>
>>> On Mon, Jan 6, 2014 at 2:24 PM, Richard Vézina wrote:
>>>
>>>> You can try this :
>>>>
>>>> **{'_class': 'radio'}
>>>>
>>>> As a kargs...
>>>>
>>>> Richard
>>>>
>>>>
>>>> On Mon, Jan 6, 2014 at 1:53 PM, Annet  wrote:
>>>>
>>>>> I have the following field definition in a table:
>>>>>
>>>>> Field('title', length=8, requires=IS_IN_SET(['Mr', 'Mrs'. 'Ms']), 
>>>>> widget=lambda k,v: SQLFORM.widgets.radio.widget(k, v, style='divs')),
>>>>>
>>>>> I would like to style the radio widget, but adding _class='radio' to 
>>>>> the widget function does not add a class attribute to the divs.
>>>>> Is there a way to add this class?
>>>>>
>>>>> Kind regards.
>>>>>
>>>>> Annet
>>>>>
>>>>> -- 
>>>>> Resources:
>>>>> - http://web2py.com
>>>>> - http://web2py.com/book (Documentation)
>>>>> - http://github.com/web2py/web2py (Source code)
>>>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>>>> --- 
>>>>> 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+un...@googlegroups.com.
>>>>>
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>
>>>>
>>>>
>>>  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] styling widget divs

2014-01-06 Thread Paolo Caruccio
The radiowidget function returns 
https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L384

parent(*opts, **attr)

so the kargs solution of Richard works but not when style is 'divs' because 
the parent is 'CAT' 
https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L364 and 
https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py#L366

The same happens for the checkboxeswidget.

Some time ago I opened an issue on this matter (
https://code.google.com/p/web2py/issues/detail?id=1821) but only the first 
problem was corrected. 
Maybe we should open another issue ticket. What do you think?


Il giorno lunedì 6 gennaio 2014 20:27:15 UTC+1, Richard ha scritto:
>
> Or you will have to create a custom widget... You can grab the 
> radio.widget in /gluon/sqlhtml.py ans search for RadioWidget class...
>
> You can turn it into a method with the help of the book.
>
> But the kargs above should work as far as I can see look at the code of 
> the RadioWidget...
>
> Richard
>
>
> On Mon, Jan 6, 2014 at 2:24 PM, Richard Vézina 
> 
> > wrote:
>
>> You can try this :
>>
>> **{'_class': 'radio'}
>>
>> As a kargs...
>>
>> Richard
>>
>>
>> On Mon, Jan 6, 2014 at 1:53 PM, Annet 
>> > wrote:
>>
>>> I have the following field definition in a table:
>>>
>>> Field('title', length=8, requires=IS_IN_SET(['Mr', 'Mrs'. 'Ms']), 
>>> widget=lambda k,v: SQLFORM.widgets.radio.widget(k, v, style='divs')),
>>>
>>> I would like to style the radio widget, but adding _class='radio' to the 
>>> widget function does not add a class attribute to the divs.
>>> Is there a way to add this class?
>>>
>>> Kind regards.
>>>
>>> Annet
>>>
>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> 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+un...@googlegroups.com .
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Happy New Year everybody!

2014-01-01 Thread Paolo Caruccio
Happy 2014 to all.

Il giorno mercoledì 1 gennaio 2014 23:06:30 UTC+1, Massimo Di Pierro ha 
scritto:
>
> Happy new year everybody,
>
> some good news:
> 1) python is growing popularity
>
> https://sites.google.com/site/pydatalog/pypl/python-blog/pythonisthelanguageoftheyear
> 2) there will be a web2py tutorial at PyCon. I will tell you more asap!
> 3) the web2py community is still growing and in 2013 I saw more and more 
> high quality programs built with web2py.
>
> Massimo
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: db modul creating question types

2013-12-30 Thread Paolo Caruccio
If you want more "questions" with different types in the same form you 
could be interested to read this discussion

https://groups.google.com/forum/#!topic/web2py/FAvjWNUiC3Y



Il giorno lunedì 30 dicembre 2013 18:01:04 UTC+1, Paolo Caruccio ha scritto:
>
>
> # radio
> Field('question_type', widget=SQLFORM.widgets.radio.widget, requires=
> IS_IN_SET(['option A','option B'])
>
> #checkboxes
> Field('question_type', widget=SQLFORM.widgets.checkboxes.widget, requires=
> IS_IN_SET(['option A','option B','option C'])
>
> #textarea
> Field('question_type', 'text')
>
> #text input
> Field('question_type') or Field('question_type', 'string')
>
>
> And dinamically:
>
> Field ('question_type')
>
> and in your controller:
>
> db.question.question_type.widget = SQLFORM.widgets.checkboxes.widget
> db.question.question_type.requires=IS_IN_SET(['Option A','Option 
> B','Option 
> C'])
> form = SQLFORM()
>
> I'm sorry for modifing my post but the return key of my keyboard is become 
> crazy.
> 
>
> Il giorno lunedì 30 dicembre 2013 17:15:30 UTC+1, Timo Bahner ha scritto:
>>
>> Hi. How do I define question_types (ie text, radio, checkbox) in a table?
>>
>> db.define_table('question',
>> Field('title'),
>> Field('question_type', ??? ))
>>
>> Do I list them somewhere or do I create a field for all three options? 
>>
>> I want to be able to choose the question type while creating a question.
>>
>> Thanks.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: db modul creating question types

2013-12-30 Thread Paolo Caruccio

# radio
Field('question_type', widget=SQLFORM.widgets.radio.widget, requires=
IS_IN_SET(['option A','option B'])

#checkboxes
Field('question_type', widget=SQLFORM.widgets.checkboxes.widget, requires=
IS_IN_SET(['option A','option B','option C'])

#textarea
Field('question_type', 'text')

#text input
Field('question_type') or Field('question_type', 'string')




Il giorno lunedì 30 dicembre 2013 17:15:30 UTC+1, Timo Bahner ha scritto:
>
> Hi. How do I define question_types (ie text, radio, checkbox) in a table?
>
> db.define_table('question',
> Field('title'),
> Field('question_type', ??? ))
>
> Do I list them somewhere or do I create a field for all three options? 
>
> I want to be able to choose the question type while creating a question.
>
> Thanks.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Calendar widget in a custom form?

2013-12-30 Thread Paolo Caruccio
Please try to add to the INPUT the class "date":

form=FORM(TABLE(...TR("Admission Date: ",INPUT(_class='date',_name=
'adm_date',widget=SQLFORM.widgets.date.widget,requires=IS_DATE()))...



Il giorno lunedì 30 dicembre 2013 09:48:06 UTC+1, Keith Planer ha scritto:
>
> After adding some input validation I've realized that the calendar widget 
> is not popping up. Is there anything I need to add to the controller or 
> elsewhere?
>
> form=FORM(TABLE(...TR("Admission Date: ",INPUT(_name='adm_date',widget=
> SQLFORM.widgets.date.widget,requires=IS_DATE()))...
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Using ZURB Foundation?

2013-12-26 Thread Paolo Caruccio
Yes, it is.
For certain aspects, indeed, it is simpler to implement than bootstrap3 
(for example the multilevel menu).
To start, you should build a scaffolding layout.html based on Foundation 
classes and put the Foundation files (normalize.css, foundation.css, 
foundation.min.js) in the static folder of your application. You need also 
to include web2py.js or better web2py_ajax.html. Here attached an example 
of layout inspired by that one in the  welcome app. However you should 
customize the navbar.
In this days I'm working on a package in order to make simpler the Zurb 
foundation 5 usage in a web2py app like the bootstrap3 one (
https://groups.google.com/d/msg/web2py/oSABtjmnYM0/DxJUyj6c3uoJ). The only 
problem I saw, and not yet I solved, is that Foundation 5 breaks the 
calendar's style.

Merry Xmas you too.


Il giorno giovedì 26 dicembre 2013 06:15:56 UTC+1, Timo Bahner ha scritto:
>
> Hi. Is it possible to use ZURB Foundation for frontend design with web2py?
>
> Thanks & Merry Christmas.
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.
Title: {{=response.title or request.application}}






{{=response.flash or ''}}




{{=response.logo or ''}}


Menu




{{='auth' in globals() and auth.navbar(mode="bare") or ''}}

{{if response.menu:}}
{{=MENU(response.menu, _class='left', li_class='has-dropdown not-click', ul_class='dropdown')}}
{{pass}}





{{if response.title:}}
{{=response.title}}
{{=response.subtitle or ''}}

{{pass}}




{{if left_sidebar_enabled:}}


{{block left_sidebar}}
{{end left_sidebar}}

{{pass}}


{{include}}

{{if right_sidebar_enabled:}}


{{block right_sidebar}}
{{end right_sidebar}}

{{pass}}


{{block footer}}





{{=T('Copyright')}} © {{=request.now.year}}


{{=T('Powered by')}} {{=A('web2py', _href=URL('http://www.web2py.com/'))}}




  {{end footer}}



{{block page_js}} {{end page_js}}

{{if response.google_analytics_id:}}


{{pass}}




[web2py] Re: help-block in Bootstrap forms

2013-12-13 Thread Paolo Caruccio
Thank you Niphlod. I see what you mean. I'll try to convert my code in 
order to build a custom formstyle. However, I'll share my code with the 
web2py users group: maybe it could be useful to someone. 
About the menu, I have in my mind a simple change to the MENU helper that 
should semplify its customization client side (jquery and css) but I have 
to investigate more on this.
Anyway, the menu complexity is due to lack of support for multilevel 
submenus. If we need a single level menu there's no need to modify the 
web2py code. 
For the sake of completeness, Foundation framework supports the multilevel 
menu, but its css breaks the web2py calendar css. 
It seems that every css framework has its own Achilles' Heel.  


Il giorno venerdì 13 dicembre 2013 20:33:40 UTC+1, Niphlod ha scritto:
>
> IMHO there's no point on having web2py serializing by default a structure 
> (response.menu) to a string (the html markup) and then reparse it back to a 
> structure (elements) to move a few pieces back and forth and then 
> reserializing those pieces back to html markup. It's just a waste of cpu.
>
> The way to go NEEDS to be modules with overrides, not server-side DOM 
> manipulations...
> I agree that right now you can only act on the MENU() function, but a way 
> must be figured out to avoid serverside DOM parsing or we'll soon face an 
> untouchable MENU() that can't accomodate for new features 'cause there are 
> lots of code expecting a fixed html markup.
> Same goes for forms and widgets: fortunately we have already a formstyle 
> that takes a callback, but I don't see why noone is coming up with a new 
> set of widgets that override the default one composing the html elements 
> the way they are supposed to be in the first place
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: help-block in Bootstrap forms

2013-12-13 Thread Paolo Caruccio
Well we could convert the menu on client side but I found several ugly 
rendering issues.
And why we should avoid server-side dom? I think that it is an interesting 
web2py feature. 

However since your opinion is important for me, do you think the following 
function might have a bad impact server-side?

def menu():
# get the current menu
current_menu = current.response.menu
# set the new menu
menu = MENU(current_menu,
   _class='nav navbar-nav',
   li_class='dropdown',
   ul_class='dropdown-menu')
# add here any menu customization
menu = menu.serialize(menu.data)
dropdowns = menu.elements('ul.dropdown-menu')
for dropdown in dropdowns:
toggle = dropdown.parent
if toggle.parent['_class'] == 'nav navbar-nav':
toggle['_data-w2pmenulevel'] = "l0"
toggle.element('a',
   replace=lambda t: A(t[0], ' ',
   SPAN('', _class="caret"),
   _href=t['_href'],
   _class='dropdown-toggle',
   **{'_data-toggle': 'dropdown'
}))
else:
toggle['_class'] = toggle['_class'].replace('dropdown',
'dropdown-submenu')


return menu

And in the layout.html:

{{if response.menu:}}
{{=bs3.menu()}}
{{pass}}

Thank you in advance for your feedback.




Il giorno venerdì 13 dicembre 2013 17:22:35 UTC+1, Niphlod ha scritto:
>
> is the endgame really let response.menu generate a structure than is 
> converted every time server-side ?
> Shouldn't we avoid server-side dom at all costs ?
>
> On Friday, December 13, 2013 3:21:28 PM UTC+1, Paolo Caruccio wrote:
>>
>> Thank you LightDot.
>> In the next few days I'll send to your private email the files for 
>> bootstrap3 and foundation5 so you will able to check my code and yours.
>> My bootstrap 3 code supports multilevel (2, 3 and so on) menu also. Both 
>> bs3 and f5 manage the errors in form (see attached image) and the auth 
>> navbar is easily customizable by the user. There are other small features 
>> too. Of course they are responsive and should work also in mobile machines. 
>> But more important thing is that by making small changes to it,  the code 
>> can be applied also to other framework and therefore we will isolate this 
>> matters from web2py core. The package for each framework  is constitued by 
>> a python module, custom css file and a custom js file  in addition to the 
>> framework files obviously.
>> I hope this will be the first step to the web2py theming.
>>
>>
>> Il giorno venerdì 13 dicembre 2013 11:54:21 UTC+1, LightDot ha scritto:
>>>
>>> That's excellent! I just started converting the welcome app to bs3 
>>> yesterday and got as far as converting and tweaking the html and adding 2nd 
>>> level submenu support. Foundation 5 was the next on my list.
>>>
>>> It seems that you've gotten further along so I'll wait for your code and 
>>> help out once it's published. Drop me a note directly if you could use any 
>>> help before that.
>>>
>>> Regards
>>>
>>>
>>> On Thursday, December 12, 2013 11:25:34 PM UTC+1, Paolo Caruccio wrote:
>>>>
>>>> In this days I'm finishing an external module (based on DOM server-side 
>>>> manipulation) that converts web2py elements (at the moment: the auth 
>>>> navbar, the menu and SQLform) to bootstrap3. It is my intention make this 
>>>> module easy to extend to other frameworks also. Bootstrap3 and Foundation5 
>>>> are almost ready and I'm working on "ink sapo framework" just to try if 
>>>> it's possible the porting to something different. 
>>>> I'm posting the code and examples on this group before xmas for testing 
>>>> and feedback purposes. Some screenshots here attached.
>>>>
>>>>
>>>> Il giorno giovedì 12 dicembre 2013 22:32:32 UTC+1, Massimo Di Pierro ha 
>>>> scritto:
>>>>>
>>>>> Can you please open a ticket about this so it does not get lost? We 
>>>>> need to port welcome to bootstrap 3 asap.
>>>>>
>>>>> On Thursday, 12 December 2013 12:08:15 UTC-6, Annet wrote:
>&

[web2py] Re: Hide url when printing page with links

2013-12-11 Thread Paolo Caruccio
Some previous discussions on this argument maybe help you:

https://groups.google.com/d/msg/web2py/z_vjoBM9WlU/FLw7MCQIViMJ

https://groups.google.com/d/msg/web2py/5NN7NrEIsRA/--BYce1AeNwJ


Il giorno mercoledì 11 dicembre 2013 16:17:13 UTC+1, Ramos ha scritto:
>
> hello i have a page with a smartgrid
>
> See 1.jpg
>
> when i print it i see the url of the links
>
> see 2.jpg
>
> How do i avoid printing urls under links?
>
> Thank you
>
> António
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] reference field or add if not in db

2013-12-10 Thread Paolo Caruccio
If you define the referenced table before the table having the 
list:reference field the form widget should be a multiple dropbox (see 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer?search=list#list:,-and-contains
 )

Example from the book:

>>> db.define_table('tag',Field('name'),format='%(name)s')
>>> db.define_table('product',
Field('name'),
Field('tags','list:reference tag'))



Il giorno martedì 10 dicembre 2013 01:19:32 UTC+1, Jesse Ferguson ha 
scritto:
>
> This has worked wonderfully on all my fields except now i cant figure out 
>> how to fix one field widget...
>>   Its a List reference its showing like this...
>
>
> 
>
> I want to be able to add more like it is now (plus and minus next to 
> input) however i would like it to be a drop down of referenced items... for 
> the life of me i cannot figure out how to have both.
>
>
>
>
>  
>
>> On Mon, Dec 9, 2013 at 12:16 PM, Jesse Ferguson  wrote:
>>
>>> Is there a way to do this using a autocomplete field? would i put the 
>>> logic in a custom validator? or is there a easier better way?
>>>  
>>> -- 
>>> Resources:
>>> - http://web2py.com
>>> - http://web2py.com/book (Documentation)
>>> - http://github.com/web2py/web2py (Source code)
>>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>>> --- 
>>> 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+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] hyperlink address when page print with browser seems coming form boostrap

2013-12-04 Thread Paolo Caruccio
Bootstrap has:

https://github.com/twbs/bootstrap/blob/master/dist/css/bootstrap.css#L228

so by the suggested rules we remove the link from the content.

Il giorno mercoledì 4 dicembre 2013 22:07:10 UTC+1, Richard ha scritto:
>
> Yes Paolo, it works great...
>
> Many thanks for this...
>
> I am curious where is it from though...
>
> :)
>
> Richard
>
>
> On Wed, Dec 4, 2013 at 4:01 PM, Paolo Caruccio 
> 
> > wrote:
>
>> Maybe this helps 
>> https://groups.google.com/d/msg/web2py/z_vjoBM9WlU/FLw7MCQIViMJ
>>
>>
>> Il giorno mercoledì 4 dicembre 2013 21:44:04 UTC+1, Richard ha scritto:
>>
>>> Hello,
>>>
>>> I try to print some pages today and found that there is a hyperlink 
>>> address that appear beside each link of the page even image, etc.
>>>
>>> I think it coming from Bootstrap right?
>>>
>>> How to shut this behavoir off!! Is there an easy way...
>>>
>>> I found this pretty annoying because it busted all the design of the 
>>> page and make the printed page ununderstandable.
>>>
>>> Thanks
>>>
>>> Richard
>>>
>>  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] hyperlink address when page print with browser seems coming form boostrap

2013-12-04 Thread Paolo Caruccio
Maybe this helps 
https://groups.google.com/d/msg/web2py/z_vjoBM9WlU/FLw7MCQIViMJ


Il giorno mercoledì 4 dicembre 2013 21:44:04 UTC+1, Richard ha scritto:
>
> Hello,
>
> I try to print some pages today and found that there is a hyperlink 
> address that appear beside each link of the page even image, etc.
>
> I think it coming from Bootstrap right?
>
> How to shut this behavoir off!! Is there an easy way...
>
> I found this pretty annoying because it busted all the design of the page 
> and make the printed page ununderstandable.
>
> Thanks
>
> Richard
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Files toggle sidebar pop-up on initial page load

2013-11-27 Thread Paolo Caruccio
patch issued
https://code.google.com/p/web2py/issues/detail?id=1792

Please note that I can't attach the patched file in issue tracker app since 
it gives me the following message:

Issue attachment storage quota exceeded.

Anyway you'll find the patched file here attached.



Il giorno mercoledì 27 novembre 2013 05:54:10 UTC+1, Massimo Di Pierro ha 
scritto:
>
> I find it annoying too. Perhaps the default behavior should be for it to 
> stay closed.
>
> On Tuesday, 26 November 2013 21:16:13 UTC-6, Bogdan Nechita wrote:
>>
>> Hello, 
>>
>> In the admin web2py OOB application, when you edit a file, the "Files 
>> Toggle" sidebar pops up every time on initial page load.
>> Does anyone know if there is a setting/code change I could make to stop 
>> the sidebar from popping up?
>>
>> I looked through the js code that loads with the edit page but couldn't 
>> find the line that sets this behaviour (I suspected a toggle on the 
>> "#files" div).
>>
>>
>> 
>>
>> Thanks,
>>
>> Bogdan Nechita
>>
>>
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.
{{extend 'layout.html'}}

{{
  def shortcut(combo, description):
return XML('%s%s' % (combo, description))
  def listfiles(app, dir, regexp='.*\.py$'):
  files = sorted(
 listdir(apath('%(app)s/%(dir)s/' % {'app':app, 'dir':dir}, r=request), regexp))
  files = [x.replace(os.path.sep, '/') for x in files if not x.endswith('.bak')]
  return files

  def editfile(path,file,vars={}):
  args=(path,file) if 'app' in vars else (app,path,file)
  url = "" args=args, vars=vars)
  return A(file, _class='editor_filelink', _href=url, _style='word-wrap: nowrap;')
}}
{{cm=URL('static%s' % (response.static_version and '/_' + response.static_version  or ''),'codemirror')}}
{{js_url=URL('static%s' % (response.static_version and '/_' + response.static_version  or ''),'js')}}
{{css_url=URL('static%s' % (response.static_version and '/_' + response.static_version  or ''),'css')}}





{{if editor_settings['editor'] != 'default':}}{{pass}}





























{{block sectionclass}}edit{{end}}




  Files toggle


-
A
+


  {{=button(URL('design',args=request.vars.app if request.vars.app else request.args[0], anchor=request.vars.id), T('back'))}}
  {{#if request.args[1]=='models':}}
  {{=T('online designer')}}
  {{#pass}}
  {{=T('docs')}}
  









{{dirs=[{'name':'models', 'reg':'.*\.py$'},
{'name':'controllers', 'reg':'.*\.py$'},
{'name':'views', 'reg':'[\w/\-]+(\.\w+)+$'},
{'name':'modules', 'reg':'.*\.py$'}, ]}}
{{auto_complete_list=[]}}
{{for dir in dirs:}}
{{=dir['name']}}


{{for f in listfiles(app, dir['name'], regexp=dir['reg'] ):}}
{{id="%s__" % dir['name'] + f.replace('.','__')}}
{{current_file = request.args(len(request.args) - 1)}}

{{a_tag=editfile(dir['name'], f, dict(id=id))}}
{{=a_tag}}
{{auto_complete_list.append({'value':f, 'tokens':f.split('/'), 'a_tag':a_tag})}}

{{pass}}


{{pass}}


















[web2py] Re: requires=IS_IN_SET translation

2013-11-16 Thread Paolo Caruccio
The IS_IN_SET validator allows to list the options as a dictionary (
http://web2py.com/books/default/chapter/29/07/forms-and-validators?search=IS_IN_SET
)

Therefore, for an example, you could do:

def index(): 
   options = {'Apple':T('Apple'),'Banana':T('Banana'),'Cherry':T('Cherry')}
   form=SQLFORM.factory(Field('fruit',requires=IS_IN_SET(options,zero=None
)))
   if form.accepts(request, session):
   selected = options[form.vars.fruit]
   saved = form.vars.fruit
   response.flash='selected %s in drop down list, saved %s in db' %(
selected, saved)
   return dict(form=form)



Il giorno sabato 16 novembre 2013 01:41:26 UTC+1, 黄祥 ha scritto:
>
> yes, can, but be carefull if you have the conditional logic to check value 
> of that field and your site support multilanguage.
> e.g.
> db.supplier.gender.requires = IS_IN_SET([T('Male'), T('Female')])
>
> if you have a conditional logic to check the value of that field, and your 
> site support multilanguage, i suggest you better not translate it. because 
> let say, you have the value Male and Female, when the user use the language 
> not in english and then submit it, and then you use it for check if 
> db.supplier.gender == T('Male) for example. and the value in database is 
> the translated of the value, then the logic is always false because the 
> value in database is in translated language.
>
> best regards,
> stifan
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: How is the current menu styled to be horizontal?

2013-11-14 Thread Paolo Caruccio
Maybe but actually I didn't deeply test the code. It was only a demo in 
order to explain the concept.

Anyway please try:

div.nav ul, #navbar, #navbar ul {margin:0; padding:0; list-style:none; 
white-space:nowrap; text-align:left; padding:1px 1px 0 1px; 
background:#eee; z-index:500px;} 

and let me know if works.


Il giorno giovedì 14 novembre 2013 19:05:25 UTC+1, JoeCodeswell ha scritto:
>
> Dear Paolo,
>
> Your post has gotten me *very close* to what i want to achieve. However, 
> when i hover over a "root" menu item and then down over the sub-menu items, 
> the hand cursor disappears when the list is long enough to be shown over a 
> rendered page element like an . Any ideas how to fix this? Is it a z 
> index thing?
>
> Thanks again, Paolo.
>
> Love and peace,
>
> Joe 
>
> On Tuesday, November 12, 2013 7:30:17 AM UTC-8, JoeCodeswell wrote:
>>
>> Dear Paolo,
>>
>> Thanks for the GREAT DETAILED reply. You indeed sensed the meaning of my 
>> original question which was related to my post - web2py "Components" for 
>> layout.html and other HTML pages [ not derived from 
>> layout.html]<https://groups.google.com/forum/#!topic/web2py/3NmrocjbwzM>
>>
>> I will do some experiments and report back.
>>
>> Thanks again, Paolo.
>>
>> Love and peace,
>>
>> Joe
>>
>> On Monday, November 11, 2013 4:53:18 PM UTC-8, Paolo Caruccio wrote:
>>>
>>> Currently the default layout.html is based on bootstrap framework (see 
>>> http://getbootstrap.com/2.3.2/index.html)
>>>
>>> As far as I know the minimum dependencies required from web2py for any 
>>> layout are:
>>> - web2py.css
>>> - web2py_ajax.html (which in turn refers to web2py.js and jquery)
>>>
>>> However, in order to render horizontally the menu without bootstrap or 
>>> any other html/css framework, you must apply your own css rules, since the 
>>> above mentioned two files are not useful for this.
>>> For example, assuming that you would keep the current html template, 
>>> after you removed from it any reference to bootstrap framework, you should 
>>> add just before  tag:
>>>
>>> 
>>>   .navbar-inner .container:before, .navbar-inner .container:after {
>>> display: table;line-height: 0;content: "";}
>>>   .navbar-inner .container:after {clear:both;}
>>>   a.brand, div.nav {float:left;}
>>>   div.nav ul, #navbar, #navbar ul {margin:0; padding:0; 
>>> list-style:none; white-space:nowrap; text-align:left; padding:1px 1px 0 
>>> 1px; background:#eee;}
>>>   div.nav li, #navbar li {margin:0; padding:0; 
>>> list-style:none;display:inline;}
>>>   div.nav ul ul {position:absolute; left:-px;}
>>>   #navbar ul {position:absolute; right:0; top:-px;}
>>>   div.nav ul.nav>li, #navbar>li 
>>> {display:inline-block;position:relative;}
>>>   div.nav a, #navbar a {display:block; color:#000; line-height:22px; 
>>> text-decoration:none; padding:0 20px 0 10px;} 
>>>   div.nav li a:hover, #navbar li a:hover {background-color:#09c; 
>>> color:#fff;} 
>>>   div.nav li:hover > a, #navbar li:hover > a {background-color:#09c; 
>>> color:#fff;}
>>>   div.nav ul li:hover > ul {left:100%; margin-top:-23px; margin-left:-
>>> 1px;}
>>>   div.nav ul.nav>li:hover > ul {left:0; margin-top:-1px; margin-left:-
>>> 1px;}
>>>   #navbar>li:hover > ul {top:23px; margin-top:-1px; margin-right:-1px;}
>>> 
>>>
>>> That will render a very simple horizontal multilevel menu. Of course 
>>> there are many other ways to accomplish the same result.
>>>
>>>
>>> Il giorno lunedì 11 novembre 2013 20:12:11 UTC+1, JoeCodeswell ha 
>>> scritto:
>>>>
>>>> Dear Web2py forum,
>>>>
>>>> I can't find superfish.css in the application structure anymore. I 
>>>> think i remember that web2py went through a menu overhaul. 
>>>>
>>>> Can someone please tell me the *minimum dependencies *for the new 
>>>> menus to be rendered horizontally?
>>>>
>>>> Thanks in advance.
>>>>
>>>> Love and peace,
>>>>
>>>> Joe
>>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: How is the current menu styled to be horizontal?

2013-11-11 Thread Paolo Caruccio
Currently the default layout.html is based on bootstrap framework (see 
http://getbootstrap.com/2.3.2/index.html)

As far as I know the minimum dependencies required from web2py for any 
layout are:
- web2py.css
- web2py_ajax.html (which in turn refers to web2py.js and jquery)

However, in order to render horizontally the menu without bootstrap or any 
other html/css framework, you must apply your own css rules, since the 
above mentioned two files are not useful for this.
For example, assuming that you would keep the current html template, after 
you removed from it any reference to bootstrap framework, you should add 
just before  tag:


  .navbar-inner .container:before, .navbar-inner .container:after {display:table
;line-height: 0;content: "";}
  .navbar-inner .container:after {clear:both;}
  a.brand, div.nav {float:left;}
  div.nav ul, #navbar, #navbar ul {margin:0; padding:0; list-style:none; 
white-space:nowrap; text-align:left; padding:1px 1px 0 1px; 
background:#eee;}
  div.nav li, #navbar li {margin:0; padding:0; 
list-style:none;display:inline;}
  div.nav ul ul {position:absolute; left:-px;}
  #navbar ul {position:absolute; right:0; top:-px;}
  div.nav ul.nav>li, #navbar>li {display:inline-block;position:relative;}
  div.nav a, #navbar a {display:block; color:#000; line-height:22px; 
text-decoration:none; padding:0 20px 0 10px;} 
  div.nav li a:hover, #navbar li a:hover {background-color:#09c; 
color:#fff;} 
  div.nav li:hover > a, #navbar li:hover > a {background-color:#09c; 
color:#fff;}
  div.nav ul li:hover > ul {left:100%; margin-top:-23px; margin-left:-1px;}
  div.nav ul.nav>li:hover > ul {left:0; margin-top:-1px; margin-left:-1px;}
  #navbar>li:hover > ul {top:23px; margin-top:-1px; margin-right:-1px;}


That will render a very simple horizontal multilevel menu. Of course there 
are many other ways to accomplish the same result.


Il giorno lunedì 11 novembre 2013 20:12:11 UTC+1, JoeCodeswell ha scritto:
>
> Dear Web2py forum,
>
> I can't find superfish.css in the application structure anymore. I think i 
> remember that web2py went through a menu overhaul. 
>
> Can someone please tell me the *minimum dependencies *for the new menus 
> to be rendered horizontally?
>
> Thanks in advance.
>
> Love and peace,
>
> Joe
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Re: Documentation of the date time picker from dynarch, version 1.0

2013-11-04 Thread Paolo Caruccio
maybe here 

http://sourceforge.net/projects/jscalendar/


Il giorno domenica 3 novembre 2013 23:30:19 UTC+1, mweissen ha scritto:
>
> Thank you - this will help!
> By the way: is there any full description for this program?
>
>
>
> 2013/11/3 Paolo Caruccio >
>
>> In order to translate the text in the calendar you could adapt the 
>> attached calendar-en.js.As an example you will find here also attached 
>> calendar-it.js (italian translation)
>> Put the translation file in application/static/js folder.
>> In layout.html after (I would suggest just before  tag)
>>
>> {{include 'web2py_ajax.html'}}
>>
>> write
>>
>> 
>>
>> of course you have to replace calendar-it.js with the name of your 
>> translation file.
>>
>> If you would like apply the translation file according to browser 
>> language you could write in layout.html :
>>
>> {{calang = T.accepted_language or 'en'
>> response.files.append(URL('static','js/calendar-%s.js' % calang))
>> }}
>>
>> just before
>>
>> {{include 'web2py_ajax.html'}}
>>
>> In this case if the translation file doesn't exist then will be applied 
>> the english translation.
>> Anyway, calendar-en.js is not necessary because calendar.js contains 
>> already the english terms.
>>  
>>
>>
>> Il giorno domenica 3 novembre 2013 20:02:39 UTC+1, mweissen ha scritto:
>>
>>> datetime uses the Dynarch date Time Picker version 1.0
>>> But the website 
>>> www.dynarch.com/projects/**calendar<http://www.dynarch.com/projects/calendar>is
>>>  down - does anybody know where to find the documenation for version 1.0?
>>>
>>> I want to translate the names of the months,...
>>>
>>> Regards Martin
>>>
>>  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: SQLFORM factory field width is less than the text on IE8, works fine on FF

2013-10-31 Thread Paolo Caruccio
By applying Server-side DOM and parsing (
http://web2py.com/books/default/chapter/29/05/the-views?search=DOM#parent-and-siblings)
 
you could use:

 my_select = form.element('select[name=TestField]')
 my_select_parent = my_select.parent
 my_select_parent['_style'] ='width:400px;'



Il giorno giovedì 31 ottobre 2013 04:54:51 UTC+1, Sarbjit ha scritto:
>
>
> Thanks for reply.
>
> Well, this issue that I am observing is not specific to my system only, I 
> tried it on two other systems in IE8 and all of them were having the same 
> issue.
>
> Anyways, I was able to get the exact width in IE, if I added a width of 
> 400px to TD element containing the SELECT. So, I modified the web2py.css 
> and added width for TD.w2p_fw and it resolved the issue. 
>
> One question is :
>
> What If I had to modify the style using my controller i.e I want to modify 
> the style for the element using controller only and not modifying the css 
> file. What should be the code for the same.
>
>
> -Sarbjit
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: SQLFORM factory field width is less than the text on IE8, works fine on FF

2013-10-30 Thread Paolo Caruccio
Unfortunately I can't repeat your issue. In my enviroment all works fine 
(see attached images).





Are you able to access to the developer tools of IE (F12 key)? Do you know 
how use them? 
If no, please read before the "Debugging HTML and CSS" in 
http://msdn.microsoft.com/en-us/library/dd565628(v=vs.85).aspx
If yes, please check the css applied to SELECT element in the page and post 
here a screenshot of right pane.


Il giorno mercoledì 30 ottobre 2013 15:59:53 UTC+1, Sarbjit ha scritto:
>
> Sorry, I didn;t noticed that the pictures were not visible, I have 
> uploaded them again. I have tried cleaning the cache of IE and reloaded the 
> page, but I am getting the same results. Do I need to try something else?
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: SQLFORM factory field width is less than the text on IE8, works fine on FF

2013-10-30 Thread Paolo Caruccio
I followed your istructions but the width of the select control is the same 
in both the browsers IE8 and FF (300px according to line 32 of web2py.css 
in car_sales/static/css folder)

Please try to change the value in the above mentioned css rule, clean the 
browsers cache, reload the page and see if it works.

Furthermore 

form.element('select[name=TestField]')['_style']='width:400px;'

should work also.

Anyway I don't see the images in your post.

Il giorno mercoledì 30 ottobre 2013 11:56:31 UTC+1, Sarbjit ha scritto:
>
> Hi,
>
> You can use the car appliance available in web2py appliances (github) to 
> show this issue (
> https://github.com/mdipierro/web2py-appliances/tree/master/CarSales).
>
> *In Controller, add a function as :-*
> def testform():
> form = SQLFORM.factory(
> Field('TestField', requires=IS_IN_SET(['Test Subfield1 to be 
> selected','Test Subfield1 to be selected'],zero=T('Select 
> Subfield'),error_message='Select Subfield')))
> if form.process().accepted:
> response.flash = 'Thanks for the feedback'
> elif form.errors:
> response.flash = 'Error submitting feedback'
> return dict(form=form)  
> *
> Views (testform.html)*
> {{extend 'layout.html'}}
> {{=form}}
>
> *Results:*
>
> Firefox :
>
>
>
> Internet Explorer :
>
>
>
> Can some one please explain, why is this behavior and how can this be 
> fixed. I tried adding the below statement to controller, but it didn't 
> fixed the problem. Also, I have tried playing with the css without any 
> success :(
>
> form.element('select[name=TestField]')['_style']='width400px'
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: how to add a style to form tags

2013-10-28 Thread Paolo Caruccio
Perhaps this still works

https://groups.google.com/d/msg/web2py/DyspJUl_IMM/njKjq9mEb_0J

Replace 

form['_class'] = "form-horizontal"

with

form['_style'] = "display:inline;"



Il giorno lunedì 28 ottobre 2013 22:00:20 UTC+1, arche...@gmail.com ha 
scritto:
>
>
> I was wondering how to put a style on a form tag.
> {{login_form.custom.begin['_style']="display:inline"}} fails with 
> error ('XML' object does not support item 
> assignment)
>
> Thank you in advance!
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: drop down for grid or smart grid search fields

2013-10-25 Thread Paolo Caruccio
It's not necessary modify the code in gluon.
You could replace the text input in the query panel. For example:

1) in db.py we define our table

db.define_table('contact',
   Field('name'),
   Field('phone'))

2) in default.py we define our controller to create the grid

def contacts():
grid=SQLFORM.grid(db.contact, user_signature=False)
table_name = 'contact'
field_name = 'phone'
element_id = 'w2p_value_%s-%s' % (table_name, field_name)
custom_select = SELECT('', 'value1', 'value2', 'value3', _id=element_id)
grid.element('input',_id=element_id, replace=custom_select)
return locals()

3) we create our view default/contacts.html

{{extend 'layout.html'}}
Manage My Contacts
{{=grid}}

The code in step2 should put you on the right way.

Il giorno venerdì 25 ottobre 2013 13:57:21 UTC+2, Sarbjit ha scritto:
>
> I was looking at the code in gucon.sqlform
>
> elif (field.type.startswith('reference ') or
>   field.type.startswith('list:reference ')) and \
>   hasattr(field.requires,'options'):
> value_input = SELECT(
> *[OPTION(v, _value=k)
>   for k,v in field.requires.options()],
>  **dict(_id=_id))
> elif field.type == 'integer' or \
> field.type.startswith('reference ') or \
> field.type.startswith('list:integer') or \
> field.type.startswith('list:reference '):
> value_input = 
> SQLFORM.widgets.integer.widget(field,field.default,_id=_id)
> else:
> value_input = INPUT(
> _type='text', _id=_id, _class=field.type)
>
>
> Can this be enhanced to view Selection Dropdown with the values for all 
> the fields. I have not much experience in web2py, so can some one please 
> suggest a change here.
>
> On Wednesday, October 23, 2013 9:01:23 AM UTC+5:30, Sarbjit wrote:
>>
>> Can someone please help.
>>
>> On Tuesday, October 22, 2013 4:39:00 PM UTC+5:30, Sarbjit wrote:
>>>
>>> I am using GRID for displaying my database results. I want to use search 
>>> feature provided by GRID/SMARTGRID where users can build queries and get 
>>> the results. I want to have a drop down field populated with the values 
>>> defined in the database for the fields which are defined as strings in 
>>> database.
>>>
>>> In my case, some fields needs to have exact match and are used very 
>>> frequent for searching the records. Since it is very difficult to fill in 
>>> the exact name every time you are searching the records using that field, I 
>>> want that for few fields, it should present a drop down.
>>>
>>> Can some one please suggest me on how on to do this.
>>>
>>> Thanks
>>> Sarbjit
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Bootstrap's nav-collapse

2013-10-24 Thread Paolo Caruccio
In order to clarify my previous post if you replace the line 83 in 
layout.html with



and remove inline css style from line 76, the nav will collapse normally 
also on desktop.

Said that, in order to generate dinamically a menu I would do in this way 
(pseudo code to explain a conceptual idea):

def menu_builder():
menu = []
for each whq\calendar in query result: 
submenu = []
for each function in whq\calendar controller:
submenu.append(('function_name', None, URL('controller', 
'function')))
 menu.append(('controller_name', None, '#', submenu))
return menu

So you could make

response.menu =menu_builder()

and use MENU helper as usually.


Il giorno giovedì 24 ottobre 2013 15:45:46 UTC+2, Annet ha scritto:
>
> Hi Paolo,
>
> Thanks for you reply. At the moment I am not using Web2py's menu helper. 
> My menu's are retrieved from a database and I have been struggling 
> to get them into the right structure:
>
> I have a table nav which contains all menu items and a table nodenav which 
> combines nodes with navs, when I query the database for a menu
> it returns for example this:
>
> 9;"whq";"whoWeAre"
> 9;"whq";"whatWeDo"
> 9;"whq";"howWeWork"
> 9;"whq";"whereWeAre"
> 9;"calendar";"openingHours"
> 9;"calendar";"eventList"
> 9;"calendar";"timetable"
> 9;"calendar";"courseTable"
>
> Where 9 is the nodeID, whq and calendar are the controllers and whoWeAre 
> etc are the functions, I haven't figured out
> yet how to get this in a menu with whq and calendar as menu item and the 
> functions in drop downs. In that case I
> could make use of web2py's is_mobile feature.
>
> This may be the best option.
>
> Best,
>
> Annet
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Bootstrap's nav-collapse

2013-10-24 Thread Paolo Caruccio
If you are using the layout.html that comes with web2py, please pay 
attention that the normal collapsing behaviour of bootstrap is bypassed: 
the collapsed menu is only on mobile devices not on PC.

So, if it's the case, please check 
https://github.com/web2py/web2py/blob/master/applications/welcome/views/layout.html#L74
 



Il giorno giovedì 24 ottobre 2013 14:40:35 UTC+2, Annet ha scritto:
>
> Thanks for your reply.
>
> What exactly is the problem? Does the downloaded bootstrap behave 
>> differently than you expect it to?
>>
>
> In the views with a maximum width of 658px and 760px I added this to the 
> layout extending the outer layout.
>
> 
>   {{if width:}}
>   .container {max-width: 760px;}
>   {{else:}}
>   .container {max-width: 658px;}
>   {{pass}}
> 
>
> In these views I always want the menu to be collapsed. In the other views 
> extending the outer layout I want the default bootstrap
> behaviour:
>
> 
>
> I am looking for a way to achieve this, so far I end up with the default 
> Bootstrap behaviour.
>
>  
>
>> The bootstrap-responsive.min.css file is missing simply because the 
>> customized version includes everything in the basic .css file, it's not an 
>> error.
>>
>  
> Thanks, I did not know that.
>
>
> Best,
>
> Annet
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Bootstrap 2.2.2 / 2.3.2

2013-10-21 Thread Paolo Caruccio
twbs versions after the 2.2.2 up to 2.3.2 did not introduce significant 
changes. Version 3.0, instead, is a revolution. We can say that is a 
different framework. Consequently, although it is easy to create a layout 
based on twbs 3.0, it is complicated to adjust some components that are 
pre-built in web2py such as forms and grids to name the main ones.
In a previous 
discussionNiphlod
 and Anthony had suggested to create a file in gluon/contrib.
Personally, I started to write some code in a module but it's at an early 
stage. I do not know if anyone else is working on this.

Il giorno lunedì 21 ottobre 2013 21:58:06 UTC+2, Niphlod ha scritto:
>
> Need to change all widgets to pass to bootstrap3. I remember someone 
> working on itbut of course it's keeping for himself :-P
>
> Before doing that (pass to 3), we should figure out:
> - something to set all methods for formstyle to be homogeneous among all 
> the app
> - a contrib "way" to make module for formstyles and widgets
>
> Passing from 2.2.2 to 2.3.2 is harmless, at least for my apps.
>
> On Monday, October 21, 2013 9:29:38 PM UTC+2, Massimo Di Pierro wrote:
>>
>> If somebody sends me a git pull request, I will apply it but shouldn't we 
>> jump to bootstrap 3?
>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: anchor ends up under black menu bar

2013-10-16 Thread Paolo Caruccio
A classic solution applied in such cases is to assign a css class (named 
for example 'hashlinked') to the target element. The related css rule is 
the following:

.hashlinked:before { 
  display: block; 
  content: " "; 
  height: 40px; /* the height of the element that hides the target */

  visibility: hidden;
}

Put the above snippet in your custom css file or in the 

[web2py] Re: Blank screen from app/admin/edit button

2013-10-12 Thread Paolo Caruccio
just sent a 
patch<https://code.google.com/p/web2py/issues/detail?id=1716&start=100>on issue 
tracker.

Il giorno sabato 12 ottobre 2013 02:07:40 UTC+2, Dave S ha scritto:
>
>
>
> On Friday, October 11, 2013 12:02:55 PM UTC-7, Paolo Caruccio wrote:
>>
>> Thank you Dave S for testing my code.
>> I reproduced the issue in my enviroment: windows8 and opera 12.16. Then I 
>> searched for a solution and the issue is gone away by applying the posted 
>> code. In summary I have only added to original function:
>>
>> contentType: 'application/json',
>> cache: false,
>>
>> I had to clear the whole browser cache selecting settings | Delete 
>> Private Data,,, from the menu in Opera in order to obtain a succesful 
>> result.
>>
>
> Yes, using the settings to clear the cache seems make your changes 
> effective for me.   (I missed the Delete Private Data line of the outer 
> menu, and went into the Preferences all the way to the cache clearing 
> button.)   Not only does editing work properly immediately afterwards, but 
> in subsequent browser restarts.
>
> Thanks for your help.
>
> /dps
>
>
>
>> Il giorno venerdì 11 ottobre 2013 20:17:12 UTC+2, Dave S ha scritto:
>>>
>>> On Thursday, October 10, 2013 12:49:10 PM UTC-7, Paolo Caruccio wrote:
>>>>
>>>> Maybe the issue is due to bad ajax caching in opera. 
>>>>
>>>> @Dave S
>>>> Please replace the function "load_file(url)" in 
>>>> "admin/static/js/ajax_editors_js" file with:
>>>>
>>>
>>>
>>> Short answer:  I still got a blank page within the nav-bar, a simple F5 
>>> filled it in.  I'll try again later, in case it's a 2-step cleanup.
>>>
>>> Details:  I stopped the server (^C in the window with the web2py 
>>> console), used an external editor to rename the old function and paste the 
>>> candidate version in.  Restarted tje server, went to the admin app's page 
>>> of the target application's files, and selected one with the "edit" button. 
>>>  Left slider, nav-bar, and footer appeared, but no file contents until I 
>>> refreshed.   I will exit Opera in a bit, and the restart and recheck the 
>>> results.
>>>
>>> /dps
>>>
>>> function load_file(url) {
>>>>   jQuery.ajax({
>>>> type: "GET",
>>>> contentType: 'application/json',
>>>> cache: false,
>>>> dataType: 'json',
>>>> url: url,
>>>> timeout: 1000,
>>>> success: function (json) {
>>>>   if(typeof (json['plain_html']) !== undefined) {
>>>> console.log(json['id']);
>>>> if(jQuery('#' + json['id']).length === 0 || json['force'] === 
>>>> true) {
>>>>   // Create a tab and put the code in it
>>>>   var tab_header = '>>> data-toggle="tab">' + json['filename'] + '>>> class="close">×';
>>>>   var tab_body = '' + json['plain_html'] + '';
>>>>   if(json['force'] === false) {
>>>> jQuery('#filesTab').append(jQuery(tab_header));
>>>> jQuery('#myTabContent').append(jQuery(tab_body));
>>>>   } else {
>>>> jQuery('#' + json['id']).html(jQuery(tab_body));
>>>>   }
>>>> }
>>>> jQuery("a[href='#" + json['id'] + "']").click();
>>>>   }
>>>> },
>>>> error: function (x) {
>>>>   on_error();
>>>> }
>>>>   });
>>>> }
>>>>
>>>> and report if the issue is solved. In the latter case we will submit a 
>>>> patch on issue tracker.
>>>>
>>>> Il giorno mercoledì 9 ottobre 2013 22:53:35 UTC+2, Dave S ha scritto:
>>>>>
>>>>> On Wednesday, October 9, 2013 1:34:11 PM UTC-7, Niphlod wrote:
>>>>>>
>>>>>> does it happen only on opera? if yes, what build on what os ?
>>>>>>
>>>>>
>>>>> Seems to happen on Firefox 18 on Fedora 16, but the CTRL-F5 works 
>>>>> without requiring an F5 after.
>>>>>
>>>>> Oper

[web2py] Re: Blank screen from app/admin/edit button

2013-10-11 Thread Paolo Caruccio
Thank you Dave S for testing my code.
I reproduced the issue in my enviroment: windows8 and opera 12.16. Then I 
searched for a solution and the issue is gone away by applying the posted 
code. In summary I have only added to original function:

contentType: 'application/json',
cache: false,

I had to clear the whole browser cache selecting settings | Delete Private 
Data,,, from the menu in Opera in order to obtain a succesful result.


Il giorno venerdì 11 ottobre 2013 20:17:12 UTC+2, Dave S ha scritto:
>
> On Thursday, October 10, 2013 12:49:10 PM UTC-7, Paolo Caruccio wrote:
>>
>> Maybe the issue is due to bad ajax caching in opera. 
>>
>> @Dave S
>> Please replace the function "load_file(url)" in 
>> "admin/static/js/ajax_editors_js" file with:
>>
>
>
> Short answer:  I still got a blank page within the nav-bar, a simple F5 
> filled it in.  I'll try again later, in case it's a 2-step cleanup.
>
> Details:  I stopped the server (^C in the window with the web2py console), 
> used an external editor to rename the old function and paste the candidate 
> version in.  Restarted tje server, went to the admin app's page of the 
> target application's files, and selected one with the "edit" button.  Left 
> slider, nav-bar, and footer appeared, but no file contents until I 
> refreshed.   I will exit Opera in a bit, and the restart and recheck the 
> results.
>
> /dps
>
> function load_file(url) {
>>   jQuery.ajax({
>> type: "GET",
>> contentType: 'application/json',
>> cache: false,
>> dataType: 'json',
>> url: url,
>> timeout: 1000,
>> success: function (json) {
>>   if(typeof (json['plain_html']) !== undefined) {
>> console.log(json['id']);
>> if(jQuery('#' + json['id']).length === 0 || json['force'] === 
>> true) {
>>   // Create a tab and put the code in it
>>   var tab_header = '> data-toggle="tab">' + json['filename'] + '> class="close">×';
>>   var tab_body = '' + json['plain_html'] + '';
>>   if(json['force'] === false) {
>> jQuery('#filesTab').append(jQuery(tab_header));
>> jQuery('#myTabContent').append(jQuery(tab_body));
>>   } else {
>> jQuery('#' + json['id']).html(jQuery(tab_body));
>>   }
>> }
>> jQuery("a[href='#" + json['id'] + "']").click();
>>   }
>> },
>> error: function (x) {
>>   on_error();
>> }
>>   });
>> }
>>
>> and report if the issue is solved. In the latter case we will submit a 
>> patch on issue tracker.
>>
>> Il giorno mercoledì 9 ottobre 2013 22:53:35 UTC+2, Dave S ha scritto:
>>>
>>> On Wednesday, October 9, 2013 1:34:11 PM UTC-7, Niphlod wrote:
>>>>
>>>> does it happen only on opera? if yes, what build on what os ?
>>>>
>>>
>>> Seems to happen on Firefox 18 on Fedora 16, but the CTRL-F5 works 
>>> without requiring an F5 after.
>>>
>>> Opera is 12.16 Build 1860 , and it describes the OS as i686, 
>>> 3.6.10-2.fc16.i686.PAE
>>>
>>> Those are the two browsers local to the server; I may try remote access 
>>> later.
>>>
>>> /dps
>>>
>>>
>>> On Wednesday, October 9, 2013 10:20:49 PM UTC+2, Dave S wrote:
>>>>>
>>>>> On Tuesday, October 8, 2013 11:23:31 AM UTC-7, Niphlod wrote:
>>>>>>
>>>>>> On Tuesday, October 8, 2013 7:36:45 PM UTC+2, Dave S wrote:
>>>>>>>
>>>>>>> On Monday, October 7, 2013 11:45:14 PM UTC-7, Niphlod wrote:
>>>>>>>>
>>>>>>>> I think you just need to ctrl+f5 reloading the cache of the 
>>>>>>>> browser. If anyone isn't able to edit files through the admin app, it 
>>>>>>>> would 
>>>>>>>> rain hell on web2py's developers :P
>>>>>>>>
>>>>>>>>
>>>>>>> You are right again, sir.  Thank goodness for people who know what 
>>>>>>> they are doing (and usually, what we are doing, too).
>>>>>>>
>>>>>>> /dps
>>>>>>>
>>>>>>>
>>>>>> If it was a bug, it was a hell of one big bug. I mean, it **could** 
>>>>>> happen that a release is made turning some feature on or off, but being 
>>>>>> unable to edit files was too big to pass unnoticed. 
>>>>>>
>>>>>
>>>>> Hmmm, each time I go to edit for the first time after restarting the 
>>>>> browser, I need to do CTRL-F5, usually followed by an F5 to load the CSS. 
>>>>>  Is this an Opera issue, a setting in the browser cache, or are the 
>>>>> default 
>>>>> headers encouraging this behavior?
>>>>>
>>>>> /dps
>>>>>  
>>>>>
>>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Blank screen from app/admin/edit button

2013-10-10 Thread Paolo Caruccio
Maybe the issue is due to bad ajax caching in opera. 

@Dave S
Please replace the function "load_file(url)" in 
"admin/static/js/ajax_editors_js" file with:

function load_file(url) {
  jQuery.ajax({
type: "GET",
contentType: 'application/json',
cache: false,
dataType: 'json',
url: url,
timeout: 1000,
success: function (json) {
  if(typeof (json['plain_html']) !== undefined) {
console.log(json['id']);
if(jQuery('#' + json['id']).length === 0 || json['force'] === true) 
{
  // Create a tab and put the code in it
  var tab_header = '' + json['filename'] + '×';
  var tab_body = '' + json['plain_html'] + '';
  if(json['force'] === false) {
jQuery('#filesTab').append(jQuery(tab_header));
jQuery('#myTabContent').append(jQuery(tab_body));
  } else {
jQuery('#' + json['id']).html(jQuery(tab_body));
  }
}
jQuery("a[href='#" + json['id'] + "']").click();
  }
},
error: function (x) {
  on_error();
}
  });
}

and report if the issue is solved. In the latter case we will submit a 
patch on issue tracker.

Il giorno mercoledì 9 ottobre 2013 22:53:35 UTC+2, Dave S ha scritto:
>
> On Wednesday, October 9, 2013 1:34:11 PM UTC-7, Niphlod wrote:
>>
>> does it happen only on opera? if yes, what build on what os ?
>>
>
> Seems to happen on Firefox 18 on Fedora 16, but the CTRL-F5 works without 
> requiring an F5 after.
>
> Opera is 12.16 Build 1860 , and it describes the OS as i686, 
> 3.6.10-2.fc16.i686.PAE
>
> Those are the two browsers local to the server; I may try remote access 
> later.
>
> /dps
>
>
> On Wednesday, October 9, 2013 10:20:49 PM UTC+2, Dave S wrote:
>>>
>>> On Tuesday, October 8, 2013 11:23:31 AM UTC-7, Niphlod wrote:

 On Tuesday, October 8, 2013 7:36:45 PM UTC+2, Dave S wrote:
>
> On Monday, October 7, 2013 11:45:14 PM UTC-7, Niphlod wrote:
>>
>> I think you just need to ctrl+f5 reloading the cache of the browser. 
>> If anyone isn't able to edit files through the admin app, it would rain 
>> hell on web2py's developers :P
>>
>>
> You are right again, sir.  Thank goodness for people who know what 
> they are doing (and usually, what we are doing, too).
>
> /dps
>
>
 If it was a bug, it was a hell of one big bug. I mean, it **could** 
 happen that a release is made turning some feature on or off, but being 
 unable to edit files was too big to pass unnoticed. 

>>>
>>> Hmmm, each time I go to edit for the first time after restarting the 
>>> browser, I need to do CTRL-F5, usually followed by an F5 to load the CSS. 
>>>  Is this an Opera issue, a setting in the browser cache, or are the default 
>>> headers encouraging this behavior?
>>>
>>> /dps
>>>  
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Custom Style of a textarea.

2013-10-05 Thread Paolo Caruccio
By using server-side DOM and parsing ( see the book 
http://www.web2py.com/books/default/chapter/29/05/the-views?search=DOM#Server-side-DOM-and-parsing
 ) 
you could collect all textareas and after make a loop on the collection to 
change the css class. For example in your controller

all_textareas = the_form.elements('textarea.text')

for a_textarea in all_textareas:
a_textarea['_class'] = "myclass"



Il giorno venerdì 4 ottobre 2013 19:14:33 UTC+2, Francisco García ha 
scritto:
>
> Hello all,
>
> I am loading a form from a database table, with CRUD or SQLFORM (It is the 
> same for me).
> This form contains text fields and textarea fields between others.
>
> Now, I need to change in the views the class of all textareas,  from class
> ="text"  to class="myclass"
> How can I do this from controllers or views?   (I can't edit any css file).
>
> I am trying with form.custom.widget  but I can't change it.
> I'm not sure if it is something simple, or it is impossible to do this way.
>
>
> Thank you in advance.
> Regards,
> Francisco
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Print-friendly css for SQLTABLE?

2013-10-04 Thread Paolo Caruccio
  @media print {
a[href]:after {
  content:"";
   }
  }

The above code should hide all the links within anchor tags in the printed 
page. Please put the rule at the bottom of your custom css file or wrap it 
in a 

[web2py] Re: Change SQLFORM.grid Submit button label

2013-10-03 Thread Paolo Caruccio

if grid.create_form or grid.update_form:
o = grid.element(_type='submit', _value='%s' % T('Submit'))
o['_value'] = T("Compare Selected")


Il giorno giovedì 3 ottobre 2013 19:38:23 UTC+2, P T ha scritto:
>
> Thanks Massimo, but that didn't work. I resorted to using the following 
> jQuery in the view:
>
> 
>  $('input[type="submit"][value="Submit"]').attr('value', 'Compare 
> Selected');;
> 
>
> May be there is an equivalent expression in Web2Py.
>
> Thanks,
> PT
>
>
>
> On Thursday, October 3, 2013 8:19:57 AM UTC-5, Massimo Di Pierro wrote:
>>
>> if grid.create_form or grid.update_form: grid.element(_type='submit')[
>> '_value'] = T("something")
>>
>> On Wednesday, 2 October 2013 23:15:07 UTC-5, P T wrote:
>>>
>>> Hello All,
>>>
>>>
>>> I want change the label of Submit button in the SQLFORm.grid. I found 
>>> two solutions in the forum and both seems to be not working. 
>>>
>>> The first solution given here Changing SQLFORM.grid submit label from 
>>> python without 
>>> javascript?
>>>   
>>> is 
>>>
>>> grid.element(_type='submit')['_value'] = T("something")
>>>
>>> But, the above code is changing the label of the "Search" button. 
>>>
>>> The second solution given here SQLFORM.RID 
>>> Selectable
>>>  is
>>>
>>> grid.element('.web2py_table input[type=submit]')['_value'] = T(
>>> 'something')
>>>
>>> This indeed changes the label of the Submit button but break the 
>>> functionality of other buttons such as Edit, View and Delete and issues a 
>>> ticket. 
>>>
>>> What I am doing wrong? By the way I am using the latest version 
>>> 2.6.4-stable+timestamp.2013.09.22.17.43.26 on Windows 7 and here is the 
>>> controller function:
>>>
>>> def listscenarios():
>>>query = (db.scenario.created_by == auth.user.id)  
>>>grid = SQLFORM.grid(query, 
>>>links = [lambda row: A(I('',_class="icon-picture")+' Results',_class
>>> ='btn', _href=URL("default","calculate", args=[row.id], user_signature=
>>> True, hash_vars=True))],
>>>selectable=lambda ids: compare(ids), csv=False, 
>>>fields=[db.scenario.id, db.scenario.name, db.scenario.description, 
>>>db.scenario.avg_mass, db.scenario.cell_type, db.scenario.
>>> tap_charge, db.scenario.first_cycle, db.scenario.reverse_cycle],
>>>oncreate=scenario_create)
>>>
>>>
>>> ##   grid.element('.web2py_table input[type=submit]')['_value'] = 
>>> T('Something') ## this causes problems with View and Edit buttons
>>> ##   grid.element(_type='submit')['_value'] = T("something") ## this 
>>> chnages the label of the Search button?
>>>grid.element('.web2py_counter', replace=None) 
>>>
>>>
>>>return dict(grid=grid)
>>>
>>>
>>>
>>> Thanks,
>>> PT
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: .ics file name

2013-10-03 Thread Paolo Caruccio
maybe not related to your issue but anyway interesting to read

http://greenbytes.de/tech/tc2231/#inlwithasciifilenamepdf
http://greenbytes.de/tech/webdav/rfc6266.html


Il giorno lunedì 30 settembre 2013 09:45:47 UTC+2, Annet ha scritto:
>
> In my application I include the name of an organization in a .ics file 
> name. Sometimes the name includes
> characters that render an invalid file name, is there a way to prevent 
> this form happening.
>
> This is the code in the controller:
>
>  def downloadVevent():
> name=None
> nodeID=int(request.args(0))
> response.view='download/vEvent.ics'
> node=retrieve_node(db, nodeID)
> if node:
> name=node.name
> else:
> redirect(URL('addressbook', 'router'))
> row=db(db.eventList.id==int(request.args(1))).select().first()
> vevent=response.render(name=name, row=row)
> return vevent.replace('\n\n', '\n')
>
>
> This is the code for the file name:
>
> {{response.headers['Content-Disposition'] = 
> 'attachment;filename=event_%s_%s.ics' % (IS_SLUG()(name)[0], 
> row.startDate.strftime("%d-%m-%Y"))}}
>
>
> Kind regards,
>
> Annet
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: pie.htc and web2py

2013-10-01 Thread Paolo Caruccio
According to pie istructions
*
*

> *this path is relative to the HTML file being viewed, not the CSS file it 
> is called from.* 


if you put the pie folder in the static one, the related css rule will be

.with-rounded-corners {behavior: url('../static/pie/PIE.htc') }


Il giorno martedì 1 ottobre 2013 15:31:14 UTC+2, Bilal El ha scritto:
>
> Hello,
>
> I'm working on a project for users using ie7. And I want to user 
> border-radius (for rounded corner in CSS) but it's not compatible ie.
> I wanted to use pie.htc, but I can't get it integrated to web2py.
>
> Do you have any idea how I can use it?
> Thanks a lot for your support!
>
> Bilal
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: web2py Italy

2013-09-27 Thread Paolo Caruccio
Ben fatto!

Il giorno venerdì 27 settembre 2013 10:37:23 UTC+2, Gael Princivalle ha 
scritto:
>
> Hi.
>
> For web2py users that speak Italian, I've create the web2py-it group. It 
> could be a complementary tool for the Italian web2py community.
> https://groups.google.com/forum/?fromgroups#!forum/web2py-it
>
> Ciao !
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] request.url with scheme

2013-09-26 Thread Paolo Caruccio
what about


{{='%s://%s%s'%(request.env.wsgi_url_scheme,request.env.http_host,request.url)}}


?

Il giorno giovedì 26 settembre 2013 15:30:02 UTC+2, Richard ha scritto:
>
> The only one that seems to do the job is this one : 
> request.env.http_referer
> But it only work in case the user clic on a link. If he copy and paste a 
> link it didn't work... Maybe it requires that I combine different 
> request.env.SOMETHING, didn't found the proper ingredients until now :)
>
> Richard
>
>
> On Wed, Sep 25, 2013 at 6:11 PM, Niphlod  >wrote:
>
>> check also request.env . holds all the pieces, although scheme=True and 
>> host=True usually cut the deal.
>>
>>
>> On Wednesday, September 25, 2013 8:46:00 PM UTC+2, Richard wrote:
>>>
>>> Hello,
>>>
>>> I want to grab the actual url not just relative, request.url give me the 
>>> relative url. I thought of this :
>>>
>>> {{=T('To reproduce this report copy this link :')}}
>>> {{=URL(**request.url, scheme=True)}}
>>>
>>> But request.url already have app include and controller that get 
>>> duplicated by scheme=True...
>>>
>>> It maybe a bad idea... But it could be usefull to have 
>>> URL(url='http://...', scheme=True)
>>>
>>> So, I can retrieve the complete url like this : URL(url=request.url, 
>>> scheme=True)
>>>
>>> Or, maybe simpler : request.url_with_scheme
>>>
>>> I work around, like this :
>>>
>>> URL(c=request.controller, args=request.args, vars=request.vars, 
>>> scheme=True)
>>>
>>> Thanks
>>>
>>> Richard
>>>
>>  -- 
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> --- 
>> 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+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: How to see the SQL that is generated?

2013-09-07 Thread Paolo Caruccio
http://www.web2py.com/book/default/chapter/06#_lastsql

Il giorno sabato 7 settembre 2013 16:43:50 UTC+2, arche...@gmail.com ha 
scritto:
>
> I was wondering, how would I go about checking the SQL statement that is 
> generated from the DAL argument? 
>

-- 

--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Adding files casually

2013-08-30 Thread Paolo Caruccio
from the book http://web2py.com/book/default/chapter/04#URL

For the reasons mentioned above, you should always use the URL function to 
generate URLs of static files for your applications. Static files are 
stored in the application's static subfolder (that's where they go when 
uploaded using the administrative interface). web2py provides a virtual 
'static' controller whose job is to retrieve files from the static subfolder, 
determine their content-type, and stream the file to the client. The 
following example generates the URL for the static file "image.png":

URL('static', 'image.png')

is mapped into

/[application]/static/image.png

If the static file is in a subfolder within the static folder, you can 
include the subfolder(s) as part of the filename. For example, to generate:

/[application]/static/images/icons/arrow.png

one should use:

URL('static', 'images/icons/arrow.png')


Il giorno venerdì 30 agosto 2013 21:29:28 UTC+2, wiel ha scritto:
>
>
> I tried to add a bulk of .js files to my static folder without using the 
> admin interface. the files  are not showing up in the admin interface and a 
> couple of these files are giving a 404 not found error. how can I remedy 
> this?
>
> here is a sample of the view file. I placed the .js files in a sub folder
>
> 
>  "{{=URL('static/jQuery-File-Upload','js/jquery.iframe-transport.js')}}"
> >
> 
>  "{{=URL('static/jQuery-File-Upload','js/jquery.fileupload.js')}}"
> >
> 
>  "{{=URL('static/jQuery-File-Upload','js/jquery.fileupload-fp.js')}}"
> >
> 
>  "{{=URL('static/jQuery-File-Upload','js/jquery.fileupload-ui.js')}}"
> >
> 
> 
>

-- 

--- 
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 options, visit https://groups.google.com/groups/opt_out.


[web2py] Re: Logged in dropdown links

2013-08-29 Thread Paolo Caruccio
Now in trunk, the auth navbar has a "bare" mode that should simplify its 
customization. For details please see 
https://github.com/web2py/web2py/pull/186

Il giorno mercoledì 28 agosto 2013 20:19:28 UTC+2, dirman ha scritto:
>
> is it posible to add another link to the logged in dropdown in adding to 
> the profile,password and logout links?
>

-- 

--- 
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 options, visit https://groups.google.com/groups/opt_out.


  1   2   3   4   >