Re: [web2py] Re: query and fields involved

2014-12-12 Thread Massimiliano
Thank you very much Antony!


On Thu, Dec 11, 2014 at 5:01 PM, Anthony abasta...@gmail.com wrote:

 Maybe something like this:

 def query_fields(query):
 from gluon.dal import Query
 fields = []
 for element in (query.first, query.second):
 if isinstance(element, Field):
 fields.append(element)
 elif isinstance(element, Query):
 fields.extend(query_fields(element))
 return fields

 The above will return a list of field objects. You could instead have it
 return a list of field names (either using field.name, which returns only
 the field name, or using str(field), which returns 'tablename.fieldname'
 format), or directly check for the existence of a particular field.

 Note, when checking for a field match, don't do something like:

 db.mytable.myfield in list_of_field_objects

 or:

 any(db.mytable.myfield == field for field in list_of_field_objects)

 In both cases, the comparison operator will result in a Query object
 (because of the ==), which will always yield True. Instead, use is or
 compare the field names/string representations:

 any(db.mytable.myfield is field for field in list_of_field_objects)

 or:

 any(str(db.mytable.myfield) == str(field) for field in
 list_of_field_objects)

 Anthony


 On Thursday, December 11, 2014 9:51:44 AM UTC-5, Massimiliano wrote:

 Is there a way to know if a field is involved in a query inspecting the
 query object?

 Thank you
 --
 Massimiliano

  --
 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.




-- 
Massimiliano

-- 
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: Electronic voting anybody?

2014-12-12 Thread Jacinto Parga
Yes, it works but not with https://... (i have to remove the 's'), and only 
with the browser address: http://www.youtube.com/watch?v=LBvDcz0yHZg

It doesnt' work with the share youtube link: http://youtu.be/LBvDcz0yHZg

Thanks!

El martes, 18 de septiembre de 2012 14:42:39 UTC+2, Massimo Di Pierro 
escribió:

 None of them.

 auth.wiki() support the newer MARKMIN which uses the 
 gluon.contrib.autonlinks module which supports the OEMBED protocol.

 You just add a link to the original youtube video and it will contact the 
 youtube oembed service to ask for the best way to embed it.

 {{from gluon.contrib.autolinks import expand_one}}
 *{{=MARKMIN(... http://www.youtube.com/x1w8hKTJ2Co 
 http://www.youtube.com/embed/x1w8hKTJ2Co  ..., autolinks=lambda link: 
 expand_one(link,{}) )}}*

 Massimo


 On Monday, 17 September 2012 23:45:10 UTC-5, apps in tables wrote:

 Thank you for deciding to add the option.

 Please, let me understand. 
 Is adding the plugin_wiki to the voting application, will make

 *{{=MARKMIN(embed:http://www.youtube.com/embed/x1w8hKTJ2Co 
 http://www.youtube.com/embed/x1w8hKTJ2Co  )}}*

 or 

 *{{=plugin_wiki.widget('youtube',code='* *x1w8hKTJ2Co * *')}}*

 possible (understandable) in cleditor?

  

 Ashraf 



-- 
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: migrate and fake_migrate

2014-12-12 Thread Niphlod
nope, can't reproduce the issue. Something very weird is going on on your 
development system.

-- 
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 on a dedicated server

2014-12-12 Thread Paulo
Hi

I think it must be a bad configuration of the virtualhosts in the Apache 
conf file, maybe a problem with AliasMatch part. I had similar problems in 
the past when trying to tune it and configure. There are a some scripts in 
the net and in the web2py manual with examples (but the majority is for 
Linux). If it helps, I'll paste the last lines of one of my conf files 
running in Apache with mod_wsgi (but I recommend nginx + uwsgi + CentOS, I 
have both servers running for different projects, and the last is easier to 
maintain and very stable):

Note: this Apache is running on windows server (for linux, you need to 
change some diretories, in web2py manual there are good examples for linux)
Note2: Don't forget to copy the handlers ro the root directory of web2py
Note3: I have 2 different domains running in this server, one with web2py 
and other with PHP, the last block of virtualhost is related to the PHP 
part (I omitted the sserver domain for security reasons), I'll paste the 
full block of code I have in the last lines of the conf file:

#web2py
NameVirtualHost *:80
NameVirtualHost *:443

#WEB2PY virtualhosts

VirtualHost *:80
WSGIScriptAlias / D:/web2py/wsgihandler.py

Directory D:/web2py
AllowOverride None
Order Allow,Deny
Deny from all
Files wsgihandler.py
Allow from all
/Files
/Directory

AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
D:/web2py/applications/$1/static/$2
Directory D:/web2py/applications/*/static/
Order Allow,Deny
Allow from all
/Directory

Location /admin
Deny from all
/Location

LocationMatch ^/([^/]+)/appadmin
Deny from all
/LocationMatch
/VirtualHost

VirtualHost *:443
SSLEngine On
SSLCertificateFile conf/ssl/myserver.crt
SSLCertificateKeyFile conf/ssl/myserver.pem

WSGIScriptAlias / D:/web2py/wsgihandler.py

Directory D:/web2py
AllowOverride None
Order Allow,Deny
Deny from all
Files wsgihandler.py
Allow from all
/Files
/Directory

AliasMatch ^/([^/]+)/static/(?:_[\d]+.[\d]+.[\d]+/)?(.*) 
D:/web2py/applications/$1/static/$2
Directory D:/web2py/applications/*/static/
Order Allow,Deny
Allow from all
/Directory

LogFormat %h %l %u %t \%r\ %s %b common
CustomLog logs/access.log common
/VirtualHost


#htdocs CEHUM
VirtualHost *:80
  DocumentRoot D:/htdocs_php
  ServerName www..com

Directory D:/htdocs_php
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
/Directory
/VirtualHost

Hope it helps.
Regards

Quinta-feira, 11 de Dezembro de 2014 19:53:04 UTC, Gael Princivalle 
escreveu:

 Hello all.

 One of my customers have took a 11 dedicated server and want to install 
 inside web2py.
 I've got only a web2py Webfaction experience so I don't know exactly how 
 can I help him.
 He have install web2py in a apache2 mod_wsgi.
 The welcome application run but don't find css files:
 The requested URL /admin/static/_2.9.11/css/bootstrap-responsive.min.css 
 was not found on this server.

 Someone have some suggestions ?

 Thanks, regards.


-- 
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: jquery ui dialog icon

2014-12-12 Thread José Eloy
Thanks Derek for your suggestion.

Finally I've resolved this mistery! Only I had to put the lines:

link rel=stylesheet href={{=URL('static', 'jquery-ui-1.11.2.custom/
jquery-ui.css')}} type=text/css media=all/
script src={{=URL('static', 
'jquery-ui-1.11.2.custom/jquery-ui.min.js')}} 
type=text/javascript/script 

below to: 

  script src={{=URL('static','js/bootstrap.min.js')}}/script
  script src={{=URL('static','js/web2py_bootstrap.js')}}/script

These lines are near the end of layout.html.

The icon and the theme are now displayed correctly.

-- 
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: jquery ui theming

2014-12-12 Thread José Eloy
Thanks Wewe for your answer.

I'm very novice with bootstrap, but I'd like to learn it.

Finally I've resolved this mistery. Only I put the lines:

link rel=stylesheet href={{=URL('static', 'jquery-ui-1.11.2.custom/
jquery-ui.css')}} type=text/css media=all/
script src={{=URL('static', 
'jquery-ui-1.11.2.custom/jquery-ui.min.js')}} 
type=text/javascript/script 

below to: 

  script src={{=URL('static','js/
bootstrap.min.js')}}/script
  script src={{=URL('static','js/web2py_bootstrap.js')}}/script

These lines are near the end of layout.html.

The X icon and the theme are now displayed correctly.

-- 
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] Simple dropdown animated menu

2014-12-12 Thread Jordan Ladora
I have a table of links that I would like to have more compactly stored in 
a dropdown menu. I tried a js script from a book in my views to try and get 
a menu that drops down on mouser hover, like the default response.menu in 
menu.py, but I'm not getting the animation, similar to calling the MENU 
helper and seeing a static, fully expanded menu. 

Can someone please point me to a snippet or a resource that has something 
that is at all similar to this?

TIA,
jl

-- 
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: Electronic voting anybody?

2014-12-12 Thread Alex Glaros
am looking for already-created online demo

will this be working (https://tests.web2py.com/evote/default/index) or does 
anyone have a packed self-contained windows/sqlLite version they could 
email me?

thanks

Alex Glaros

-- 
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.