[web2py] Re: Apache on Windows + many applications

2015-07-06 Thread Niphlod
BTW: why don't you just serve web2py behind iis ? No weird exceptions, 
easier to debug, better performances, lesser resources, etc etc. Come on, 
it's not 2001 anymore!

On Friday, July 3, 2015 at 1:44:10 PM UTC+2, Dmitry Ermolaev wrote:

 https://7pay.in/ - worked
 http://7pay.in/ - error

 in rockets server all OK

 in Apache - errors ((

 pickle with Apache rise error


-- 
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 to insert data in data base by xml file

2015-07-06 Thread Johann Spies
On 3 July 2015 at 23:43, Anthony abasta...@gmail.com wrote:

 All of the effort will be in parsing the XML, so you should check the
 documentation of the various XML libraries and ask questions in their
 forums (or on Stack Overflow). The details will depend on the structure of
 your XML. Ultimately, you want to loop over the records in the XML, and for
 each record, build a dictionary where the keys are the DAL table field
 names and the values are the record values you want to insert. Once you
 have such a dictionary, the DAL insert for a single record is simple:

 db.mytable.insert(**record_dictionary)


Another approach is to import the XML-data directly into a PostgreSQL table
with and id (primary key) field and another field with the type XML.  This
can be queried using XPATH-like syntax in PostgreSQL (from web2py using
exexutesql) and if you want to import that into 'normal' tables, this can
be done within PostgreSQL using the above-mentioned xpath-based queries.

Both ways have a learning curve if you are not used to parsing XML-data.

Regards
Johann

-- 
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: Redirect to a URL with POST Method

2015-07-06 Thread Leonel Câmara
Does the gateway allow cross domain requests?

-- 
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: Semantic 2.0

2015-07-06 Thread Richard Vézina
Semantic include so much goodies!!

:)

Richard

On Fri, Jul 3, 2015 at 12:03 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 We cannot make the layout name a variable because it would break bytecode
 compilation. If you make a semantic scaffolding app I would like to see it.
 We can make a site where multiple apps are posted.


 On Thursday, 2 July 2015 06:48:36 UTC-5, 黄祥 wrote:

 have a plan to use semantic for web2py scaffolding app? perhaps,
 something like
 private/appconfig.ini
 [layout]
 css = bootstrap3
 ;css = bootstrap
 ;css = semantic

 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.


-- 
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: google play

2015-07-06 Thread Dave S


On Monday, July 6, 2015 at 8:27:08 AM UTC-7, Massimo Di Pierro wrote:

 No but if you find out let us know. :-)

 On Monday, 6 July 2015 10:22:21 UTC-5, eric cuver wrote:


 hi everybody anyone know how I can create a mobile application on google 
 play with web2py as web2pyslices


Is that Google Play as the store (application distribution), or Google Play 
as the engine (application environment)?

I've seen a few examples of mobile apps in this group, but Web2Py's device 
detection and view mapping seem to be the key parts of that.  I haven't 
tried any of them yet.

/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: Scheduling and/or multiprocessing

2015-07-06 Thread Massimo Di Pierro
It should be fine as long as the process calling multiprocess waits for the 
spawned process.
There may be issue with the database connection maintained by the process. 
Try it and let us know.

On Monday, 6 July 2015 10:22:10 UTC-5, Phillip wrote:

 It is my understanding that if only multiprocessing is used to spawn 
 processes, the processes are at risk of being killed (depending on their 
 time lapse).


 Are there any reasons Web2py's scheduler would have problems scheduling a 
 python script that uses multiprocessing?


 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.


Re: [web2py] Re: How to insert data in data base by xml file

2015-07-06 Thread Dave S


On Monday, July 6, 2015 at 8:22:11 AM UTC-7, Sai Harsh Tondomker wrote:

 Thanks for reply.
 Could you please give me one example and where I can get enough matter to 
 write the code.



Here's a little fragment of stuff I'm doing (not with Web2Py) using 
Beautiful Soup:


  f = codecs.open(path/myfilename,
 encoding=ISO8859-1, mode=r)
  soup = BeautifulSoup(f)
 
  for x in soup.find_all(td, class_=element-title):
 if not x.contents[0]:
   print blowing up on %s % x.name
 while not isinstance(x.contents[0], NavigableString):
   x = x.contents[0]


Note that I'm actually parsing HTML (element-title shows up in TD 
nodes), but the general approach is the same.  If you go with Beautiful 
Soup, I think you'll find their tutorial is quite easy to follow.  After 
all, I was able to follow it, and come up with the above.  The code that 
follows this is essentially taking apart the text string I find in my 
target node, so most of the rest of my code is Python string ops 
(x.split(), etc).

I'm not familiar with the other suggestions, except that I think Beautiful 
Soup builds on lxml.

/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: Invalid literal for init with base 64

2015-07-06 Thread Dave S


On Monday, July 6, 2015 at 8:22:21 AM UTC-7, Alessio Varalta wrote:

 Hi, i use a sqlite database and i use SQLFORM for save my dateThe 
 problem is that have a table with two Field that have date type and when i 
 use SQLFORM and save this date, I have a error when i try to retrieve the 
 date and i have a error when i use appadmin for see my database and the 
 error is:

 Invalid literal for init with base 64


This looks like you have a non-date validator on what you think is a date 
field.  Could you show the relevant lines from your model file (db.py, or 
its siblings)?

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


Re: [web2py] Re: Semantic 2.0

2015-07-06 Thread JorgeH
I am open to use both.

On Monday, July 6, 2015 at 10:21:55 AM UTC-5, Massimo Di Pierro wrote:

 I am the one who proposed moving to semantic a year ago but the 
 overwhelming majority here wanted bootstrap. :-(

 On Monday, 6 July 2015 09:11:10 UTC-5, Richard wrote:

 Semantic include so much goodies!!

 :)

 Richard

 On Fri, Jul 3, 2015 at 12:03 PM, Massimo Di Pierro massimo@gmail.com 
 javascript: wrote:

 We cannot make the layout name a variable because it would break 
 bytecode compilation. If you make a semantic scaffolding app I would like 
 to see it. We can make a site where multiple apps are posted.


 On Thursday, 2 July 2015 06:48:36 UTC-5, 黄祥 wrote:

 have a plan to use semantic for web2py scaffolding app? perhaps, 
 something like
 private/appconfig.ini
 [layout]
 css = bootstrap3
 ;css = bootstrap
 ;css = semantic

 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+un...@googlegroups.com javascript:.
 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] Webfaction and SMTP

2015-07-06 Thread Dave S


On Saturday, July 4, 2015 at 4:45:24 AM UTC-7, reddyreddy wrote:

 Hi
  Iam uing the same settings as yours in db.py. But I got the following 
 error.

 Error 10060: A connection attempt failed.


You're using Windows?  Which version?  Are you using the bundled Rocket 
server, Apache, or IIS?

/dps

 

 I wrote the code to send email in script.


 ## in file /app/private/mail_queue.py
 import time
 while True:
 rows = db(db.queue.status=='pending').select()
 for row in rows:
 if mail.send(to=row.email,
 subject=row.subject,
 message=row.message):
 row.update_record(status='sent')
 else:
 row.update_record(status='failed')
 db.commit()
 time.sleep(60) # check every minute








 On Monday, October 10, 2011 at 8:41:12 AM UTC-5, Vasile Ermicioi wrote:

 in db.py

 mail.settings.server = 'smtp.webfaction.com'  
 mail.settings.sender = 'some email of yours'
 mail.settings.login = 'user:pwd'  # your webfaction name and 
 password, you may change the password for mailboxes from webfaction panel


 then from controllers

 mail.send(to=['y...@whatever.com'], subject='Web2py email', 
 message='Sent with Web2py!')

 just tested and works



-- 
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: format field from m:1 table

2015-07-06 Thread 黄祥
please try (not tested)

db.define_table('company', 
Field('name'), 
Field('region', 'reference region'), 
format = lambda r: '%s - %s' % (r.name, r.region.name) )

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] format field from m:1 table

2015-07-06 Thread Mirek Zvolský
Imagine we have table structure like
product - company - region

Is there a way to have format for company based on region, so I can see 
region while selecting product?
db('company', *fields, format=%(company.name)s, %(region.name)s)

I think this is not directly possible
and I have some idea how to implement it
but I want listen first, if you use such something and what for trick do 
you use to achieve this.

Best regards, Mirek

-- 
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: crash - session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL) on 2.9.11

2015-07-06 Thread Dmitry Ermolaev
This error in sessions and then raise in pickle

пятница, 3 июля 2015 г., 23:50:25 UTC+3 пользователь Dmitry Ermolaev 
написал:

 I continue tests...

 Any request with some PORT (for example http://mydom:PORT) after 
 restarting Apache will take this PORT as success but all others PORTS as 
 error

 for example
 if first request is http://my_domain:90
 than app request wirt PORT != 90 - raise error!

 пятница, 3 июля 2015 г., 22:29:43 UTC+3 пользователь Dmitry Ermolaev 
 написал:

 in 2.11 error:

 Traceback (most recent call last):
   File C:\web2py-m\gluon\main.py, line 436, in wsgibase
 session.connect(request, response)
   File C:\web2py-m\gluon\globals.py, line 960, in connect
 session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL)
   File C:\web2py-m\gluon\storage.py, line 56, in lambda
 __getnewargs__ = lambda self: getattr(dict,self).__getnewargs__(self)
 TypeError: getattr(): attribute name must be string


 I identified this error:
 If server has HTTP and HTTPS requests.When Apache was restarted or 
 reloaded then: First request will be successful and its schema will be 
 successful but another schema will raise this error 

  for examle: 1. After restarting Apache if first request to server was a 
 http://mydomain/... then all request with HTTP schema will be successful 
 but all request with HTTPS will be raise this error 2. After restarting 
 Apache if first request to server was a https://mydomain/... then all 
 request with HTTPS schema will be successful but all request with HTTP will 
 be raise this error 

 Apache config:
 #
 VirtualHost *:80

 RewriteEngine On
 RewriteCond %{HTTPS} off
 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

 /VirtualHost
 
 VirtualHost *:443

   ServerName 7pay.in
   ServerAlias www.7pay.in
 DocumentRootC:/web2py-m
 SSLEngine   on
 Directory C:/web2py-m
 AllowOverride All
 Order allow,deny
 allow from all
 /Directory
 Location /
 Order deny,allow
 Allow from all
 /Location
 WSGIScriptAlias  / C:/web2py-m/wsgihandler.py


 SSLCertificateFile  conf/NameCheap.com/7pay_in.crt
 SSLCertificateKeyFile conf/NameCheap.com/7pay-server.key
 SSLCertificateChainFile conf/NameCheap.com/7pay_in.ca-bundle

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

 ###
 VirtualHost *:80

 ServerName  erm.cash
 ServerAlias www.erm.cash
 ServerAlias ipo-polza.ru
 ServerAlias www.ipo-polza.ru
 ServerAlias XN--80AAXIDK7E.XN--80ASEHDB
 ServerAlias www.XN--80AAXIDK7E.XN--80ASEHDB

   DocumentRootC:/web2py-m
 Directory C:/web2py-m
 AllowOverride All
 Order allow,deny
 allow from all
 /Directory
 Location /
 Order deny,allow
 Allow from all
 /Location
 WSGIScriptAlias  / C:/web2py-m/wsgihandler.py

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

 /VirtualHost


 HELP !




-- 
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: prettydate ago is not translated

2015-07-06 Thread Selman Kocael
you must look up the %d weeks ago, %d hours ago, %d months ago phrases.
not just ago. because i think item that be translated is T(%d days
ago). not T(ago). i don't know its detail.

 In addition I can only find '%d weeks ago': '%d uge siden', in my language
 file.


this translate  used to be work. didn't it?

2015-07-05 1:49 GMT+03:00 icodk i...@alpiron.com:

 There are two issues here, the first is that 'ago' it is NOT in my
 language file and if you look in  gluon/tools.py you will see that
 suffix = ' ago ' and NOT  suffix = T(' ago') . Anyway this is in my
  gluon/tools.py file.
 OK I replaced  it with:  suffix = T(' ago') .which should be part of the
 web2py in the first place or I am missing something.

 The second issue is that even if I replaced it as above I still can't find
 'ago' in my language file. In addition I can only find '%d weeks ago':
 '%d uge siden', in my language file. Nothing else from prettydate
 function in my language file.
 What am I doing wrong ?
 Thanks





 On Saturday, July 4, 2015 at 1:45:24 PM UTC+2, icodk wrote:

 Is there any reason why the 'ago' is not translate in
 prettydate  (gluon/tools.py) ?

 *suffix = ' ago'* instead of:
 *suffix = ** T( ago)*

 In Danish that will be translated to: 'siden'
 Also I can't find the other strings in my language file
 T('1 year' + suffix)
 T('1 month' + suffix)
 etc.

 I can only find:
 %d weeks ago




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




-- 
Selman Kocael
İsabet Yayınları

-- 
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: common_filter

2015-07-06 Thread Paolo Amboni
Now it makes much more sense for me, i'm coming from PHP programming!!!
Thanks.

Il giorno venerdì 3 luglio 2015 23:38:00 UTC+2, Anthony ha scritto:

 A lambda function is just an anonymous function (i.e., one you define in 
 place without naming it). The common_filter does not have to be a lambda 
 function -- it can be any callable object that takes a single argument and 
 returns a Query object. So, you could do:

 def my_common_filter(query):
 return db.blog_post.is_public == True
 db.blog_post._common_filter = my_common_filter

 When the common filter function is called, the current query will be 
 passed to it. In the above example, that query argument is ignored, but in 
 theory, you could inspect that query argument and have the return value 
 depend on it somehow. The final query will end up being a conjunction of 
 the original query and the return value of the common filter function.

 Also, note that the argument of the common filter function (whether a 
 lambda function or otherwise) does not have to be query -- that is just a 
 convention to remind you that the original query will be passed into the 
 function. You can name that argument whatever you want.

 Anthony

 On Friday, July 3, 2015 at 12:00:22 PM UTC-4, Paolo Amboni wrote:

 Can someone translate the expression

 db.blog_post._common_filter = *lambda query:* db.blog_post.is_public == 
 True

 *without the use of lambda function?*

 I'm trying to understand how to set up common filter in controller but 
 lambda function always confuse me.

 *So, for now, the only way to set the filter is to copy the code without 
 understanding 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: smartgrid - display linked_tables link as a dropdown button instead

2015-07-06 Thread info
Hello,

I have 7 actions per row so it would be great to have actions dropdown.
Please find attached patch for bootstrap theme.
for Version 2.11.2-stable+timestamp.2015.05.30.16.33.24



On Thursday, January 17, 2013 at 11:14:59 PM UTC+2, Jim S wrote:

 I have a number of smartgrids built where the number of linked tables is 
 pushing the other edit/delete buttons off the right of the page.  I'm 
 wondering if there is a simple way that I've missed where you can put your 
 linked_table links into a dropdown button of different 'actions' you could 
 perform on the row.  Seems like this should be easy with the fancy twitter 
 bootstrap buttons available.  Also, can I override the default buttons 
 (display/edit/delete) with some twitter bootstrap buttons?

 Should this be an enhancement request?


-- 
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.
--- a/gluon/sqlhtml.py
+++ b/gluon/sqlhtml.py
@@ -1967,7 +1967,8 @@ class SQLFORM(FORM):
  cache_count=None,
  client_side_delete=False,
  ignore_common_filters=None,
- auto_pagination=True):
+ auto_pagination=True,
+ dropdownactions=False):
 
 formstyle = formstyle or current.response.formstyle
 
@@ -2755,6 +2756,21 @@ class SQLFORM(FORM):
 callback=url(args=['delete', tablename, id]),
 noconfirm=noconfirm,
 delete='tr'))
+
+if dropdownactions:
+from gluon import BUTTON
+row_buttons = DIV(
+BUTTON(T('Action'), SPAN(_class=caret),
+   _class=btn dropdown-toggle,
+   _href=#,
+   **{'_data-toggle': 'dropdown',
+  '_aria-expanded': 'true'}
+   ),
+UL([LI(_btn) for _btn in row_buttons],
+   _class=dropdown-menu),
+_class='dropdown'
+)
+
 if buttons_placement in ['right', 'both']:
 trcols.append(row_buttons)
 if buttons_placement in ['left', 'both']:



[web2py] Is pickling custom objects the only or best method of storage?

2015-07-06 Thread Phillip


Instead of having to frequently unpickle data, Is there a way to store 
custom objects (e.g. VirtualFields) in Web2py such that their specifics can 
be queried? If so, would not pickling decrease performance?


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: Redirect to a URL with POST Method

2015-07-06 Thread Sepehr Mohamadi
All payment gateway in Iran, Do the same!!!

On Sunday, July 5, 2015 at 2:40:19 PM UTC+4:30, Massimo Di Pierro wrote:

 This cannot be done for security reasons. If this were allowed than one 
 web page could force your browser to post a request for a bank transfer to 
 your bank making a guess that you are logged in with the bank.

 You can only do it via ajax as in the PHP assuming the domain is the same.

 Massimo

 On Sunday, 5 July 2015 05:06:59 UTC-5, Sepehr Mohamadi wrote:

 Thanks a lot Anothony,

 First I should say yes, I need to recieve data first then redirect user 
 to the gateway.

 But, I tried your solutions but non of them worked.

 Because I need the user to redirect to gateway to enter some additional 
 info on Gateway site.
 But in requests module don't redurict the user there, and just Post the 
 data to the gateway.

 Let me know if you have any idea.

 Thanks


 On Saturday, July 4, 2015 at 7:56:32 PM UTC+4:30, Anthony wrote:

 You could return a 307 redirect response, which would instruct the 
 browser to re-post the data to the new URL, but the browser will then 
 likely prompt the user to confirm they want to re-post the data. This will 
 likely be confusing to the user, so should probably be avoided.

 If you just need the data posted directly to the payment gateway, but 
 you don't need it posted to your own server at all, then all you have to do 
 is change the action attribute of the form to point to the appropriate 
 external URL. If it is a web2py form, something like:

 form = FORM(..., _action=third_party_url)

 If you need to receive the data on your server first and then have it 
 posted to the gateway, you would not use a redirect. Instead, just have the 
 form post to web2py as usual, and in the controller, send the post request 
 to the gateway using urllib2 or the requests library. web2py also includes 
 the fetch() function in gluon.tools, which uses urllib2 -- if your data are 
 in a dictionary, you would do:

 from gluon.tools import fetch
 result = fetch(external_url, data)

 You would want to check the result to make sure the post was successful.

 Anthony

 On Saturday, July 4, 2015 at 7:45:24 AM UTC-4, Sepehr Mohamadi wrote:

 Hi Everybody,

 I want to redirect navigation to an outside URL with a POST Method.

 I should send payment info to a payment gateway through a POST Method. 
 Then payment gateway again callback to web2py with results.

 I searched everywhere in the Internet, Web2py Book and this forum, but 
 could not find a clue!

 Please guide!
 Thanks,
 Sepehr



-- 
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 to insert data in data base by xml file

2015-07-06 Thread Sai Harsh Tondomker
Thanks for reply.
Could you please give me one example and where I can get enough matter to
write the code.


On Mon, Jul 6, 2015 at 1:11 PM, Johann Spies johann.sp...@gmail.com wrote:

 On 3 July 2015 at 23:43, Anthony abasta...@gmail.com wrote:

 All of the effort will be in parsing the XML, so you should check the
 documentation of the various XML libraries and ask questions in their
 forums (or on Stack Overflow). The details will depend on the structure of
 your XML. Ultimately, you want to loop over the records in the XML, and for
 each record, build a dictionary where the keys are the DAL table field
 names and the values are the record values you want to insert. Once you
 have such a dictionary, the DAL insert for a single record is simple:

 db.mytable.insert(**record_dictionary)


 Another approach is to import the XML-data directly into a PostgreSQL
 table with and id (primary key) field and another field with the type XML.
 This can be queried using XPATH-like syntax in PostgreSQL (from web2py
 using exexutesql) and if you want to import that into 'normal' tables, this
 can be done within PostgreSQL using the above-mentioned xpath-based queries.

 Both ways have a learning curve if you are not used to parsing XML-data.

 Regards
 Johann

 --
 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/ccWa_xekecQ/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 web2py+unsubscr...@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.


[web2py] Scheduling and/or multiprocessing

2015-07-06 Thread Phillip


It is my understanding that if only multiprocessing is used to spawn 
processes, the processes are at risk of being killed (depending on their 
time lapse).


Are there any reasons Web2py's scheduler would have problems scheduling a 
python script that uses multiprocessing?


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] google play

2015-07-06 Thread eric cuver

hi everybody anyone know how I can create a mobile application on google 
play with web2py as web2pyslices

-- 
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: Semantic 2.0

2015-07-06 Thread Massimo Di Pierro
I am the one who proposed moving to semantic a year ago but the 
overwhelming majority here wanted bootstrap. :-(

On Monday, 6 July 2015 09:11:10 UTC-5, Richard wrote:

 Semantic include so much goodies!!

 :)

 Richard

 On Fri, Jul 3, 2015 at 12:03 PM, Massimo Di Pierro 
 massimo.dipie...@gmail.com wrote:

 We cannot make the layout name a variable because it would break bytecode 
 compilation. If you make a semantic scaffolding app I would like to see it. 
 We can make a site where multiple apps are posted.


 On Thursday, 2 July 2015 06:48:36 UTC-5, 黄祥 wrote:

 have a plan to use semantic for web2py scaffolding app? perhaps, 
 something like
 private/appconfig.ini
 [layout]
 css = bootstrap3
 ;css = bootstrap
 ;css = semantic

 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.




-- 
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] Invalid literal for init with base 64

2015-07-06 Thread Alessio Varalta
Hi, i use a sqlite database and i use SQLFORM for save my dateThe 
problem is that have a table with two Field that have date type and when i 
use SQLFORM and save this date, I have a error when i try to retrieve the 
date and i have a error when i use appadmin for see my database and the 
error is:

Invalid literal for init with base 64

-- 
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 to insert data in data base by xml file

2015-07-06 Thread Anthony
On Monday, July 6, 2015 at 11:22:11 AM UTC-4, Sai Harsh Tondomker wrote:

 Thanks for reply.
 Could you please give me one example and where I can get enough matter to 
 write the code.


Note, this is not web2py specific.  As suggested, check the various XML 
libraries and seek help via SO or their forums. Once you have the XML 
parsed, the web2py database insert is simple.

-- 
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: google play

2015-07-06 Thread Massimo Di Pierro
No but if you find out let us know. :-)

On Monday, 6 July 2015 10:22:21 UTC-5, eric cuver wrote:


 hi everybody anyone know how I can create a mobile application on google 
 play with web2py as web2pyslices


-- 
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] new feature in trunk: mail.settings.server='logging:filename'

2015-07-06 Thread Massimo Di Pierro
For testing/debug purposes we were always able to do:

mail.settings.server='logging'

now you can do

mail.settings.server='logging:filename'

and log to a file instead of using the logger. This is not really thread 
safe but different apps can log to different files and can help testing.

-- 
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: Redirect to a URL with POST Method

2015-07-06 Thread Anthony
You will need to provide more details about the requirements. What 
instructions are provided by the gateway provider? You could post the data 
from your server and then redirect the user to the gateway site, but the 
redirect won't be via a POST request. We can't help without more details.

On Monday, July 6, 2015 at 11:22:11 AM UTC-4, Sepehr Mohamadi wrote:

 All payment gateway in Iran, Do the same!!!

 On Sunday, July 5, 2015 at 2:40:19 PM UTC+4:30, Massimo Di Pierro wrote:

 This cannot be done for security reasons. If this were allowed than one 
 web page could force your browser to post a request for a bank transfer to 
 your bank making a guess that you are logged in with the bank.

 You can only do it via ajax as in the PHP assuming the domain is the same.

 Massimo

 On Sunday, 5 July 2015 05:06:59 UTC-5, Sepehr Mohamadi wrote:

 Thanks a lot Anothony,

 First I should say yes, I need to recieve data first then redirect user 
 to the gateway.

 But, I tried your solutions but non of them worked.

 Because I need the user to redirect to gateway to enter some additional 
 info on Gateway site.
 But in requests module don't redurict the user there, and just Post the 
 data to the gateway.

 Let me know if you have any idea.

 Thanks


 On Saturday, July 4, 2015 at 7:56:32 PM UTC+4:30, Anthony wrote:

 You could return a 307 redirect response, which would instruct the 
 browser to re-post the data to the new URL, but the browser will then 
 likely prompt the user to confirm they want to re-post the data. This will 
 likely be confusing to the user, so should probably be avoided.

 If you just need the data posted directly to the payment gateway, but 
 you don't need it posted to your own server at all, then all you have to 
 do 
 is change the action attribute of the form to point to the appropriate 
 external URL. If it is a web2py form, something like:

 form = FORM(..., _action=third_party_url)

 If you need to receive the data on your server first and then have it 
 posted to the gateway, you would not use a redirect. Instead, just have 
 the 
 form post to web2py as usual, and in the controller, send the post request 
 to the gateway using urllib2 or the requests library. web2py also includes 
 the fetch() function in gluon.tools, which uses urllib2 -- if your data 
 are 
 in a dictionary, you would do:

 from gluon.tools import fetch
 result = fetch(external_url, data)

 You would want to check the result to make sure the post was successful.

 Anthony

 On Saturday, July 4, 2015 at 7:45:24 AM UTC-4, Sepehr Mohamadi wrote:

 Hi Everybody,

 I want to redirect navigation to an outside URL with a POST Method.

 I should send payment info to a payment gateway through a POST Method. 
 Then payment gateway again callback to web2py with results.

 I searched everywhere in the Internet, Web2py Book and this forum, but 
 could not find a clue!

 Please guide!
 Thanks,
 Sepehr



-- 
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: Semantic 2.0

2015-07-06 Thread Richard Vézina
I would suggest that we include both, but not pick one over another... But
having a scafold app with semantic would be greate...

Richard

On Mon, Jul 6, 2015 at 11:21 AM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 I am the one who proposed moving to semantic a year ago but the
 overwhelming majority here wanted bootstrap. :-(


 On Monday, 6 July 2015 09:11:10 UTC-5, Richard wrote:

 Semantic include so much goodies!!

 :)

 Richard

 On Fri, Jul 3, 2015 at 12:03 PM, Massimo Di Pierro 
 massimo.dipie...@gmail.com wrote:

 We cannot make the layout name a variable because it would break
 bytecode compilation. If you make a semantic scaffolding app I would like
 to see it. We can make a site where multiple apps are posted.


 On Thursday, 2 July 2015 06:48:36 UTC-5, 黄祥 wrote:

 have a plan to use semantic for web2py scaffolding app? perhaps,
 something like
 private/appconfig.ini
 [layout]
 css = bootstrap3
 ;css = bootstrap
 ;css = semantic

 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.


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


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