[web2py] Re: How to save the last login datetime

2017-09-07 Thread Sandro Costa
Thank you very much Anthony.

On Tuesday, September 5, 2017 at 6:38:05 PM UTC+1, Anthony wrote:
>
> All logins (and other Auth events) are stored in the db.auth_events table. 
> But if you want to store just the most recent login in the db.auth_user 
> table itself, you can do so using a callback, which can be set up via 
> auth.settings.login_onaccept 
> 
> .
>
> Anthony
>
> On Tuesday, September 5, 2017 at 11:59:15 AM UTC-4, Sandro Costa wrote:
>>
>>
>> I've altered the auth_user model to have some new fields that I need.
>>
>> I'm asking for help to know what I should do to save the date where a 
>> registered user last logged in. Should I change the login function or is 
>> there any way for me to save information in the db after the login.
>>
>> 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/d/optout.


Re: [web2py] Re: dumb question about sessions server used to store tables in order to avoid hits to db

2017-09-07 Thread Chinh Dang
Can we purge only a subset of sessions?

On Sep 7, 2017 5:17 PM, "Anthony"  wrote:

> On Thursday, September 7, 2017 at 1:18:10 PM UTC-4, Alex Glaros wrote:
>>
>> is it theoretically possible to leverage redis as a sessions store so
>> that web2py session can hold many of the things normally kept on the db?
>>
>> For example, could you store things like email-contacts and high-use
>> lookup tables usually accessed as tables on the db, but now in session vars
>> in order to reduce hits to the db?  (Db would only be accessed if there was
>> any change to the tables represented by session vars.)
>>
>
> Keep in mind that the session is specific to each user, so you would only
> want to store data unique to each user. If you simply want to cache common
> database queries (that are not user specific), you can use the web2py cache
> system (including the DAL functionality to cache selects
> ).
> You can use Redis for caching as well as for sessions:
> http://web2py.com/books/default/chapter/29/13/deployment-recipes#Caching-
> with-Redis.
>
> 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.
>

-- 
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: dumb question about sessions server used to store tables in order to avoid hits to db

2017-09-07 Thread Anthony
On Thursday, September 7, 2017 at 1:18:10 PM UTC-4, Alex Glaros wrote:
>
> is it theoretically possible to leverage redis as a sessions store so that 
> web2py session can hold many of the things normally kept on the db?
>
> For example, could you store things like email-contacts and high-use 
> lookup tables usually accessed as tables on the db, but now in session vars 
> in order to reduce hits to the db?  (Db would only be accessed if there was 
> any change to the tables represented by session vars.)
>

Keep in mind that the session is specific to each user, so you would only 
want to store data unique to each user. If you simply want to cache common 
database queries (that are not user specific), you can use the web2py cache 
system (including the DAL functionality to cache selects 
).
 
You can use Redis for caching as well as for sessions: 
http://web2py.com/books/default/chapter/29/13/deployment-recipes#Caching-with-Redis.

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: SQLFORM.grid selectable with multiple buttons behaves strange

2017-09-07 Thread A3

After researching the forum and other locations I found the following 
"solution":
the raise HTTP(200) seems to break the running submit code. As suggested 
elsewhere the download should be invoked on another page. So first redirect 
and than start the download.

 I replaced: 
 selectable = [('Download selected PDFs as ZIP',lambda row : 
mapping_multiple(row)), 
   ('Download selected as EXCEL',lambda 
row : mapping_multiple_excel(row))
  ]
by:
selectable = [('Download selected PDFs as ZIP',lambda row 
:redirect(URL('default', 'downloading',

   vars=dict(ids=row, 

 message = 'zipped PDF files',

 target='make_pdf_zip',
  ('Download selected as EXCEL', lambda row 
:redirect(URL('default', 'downloading',

   vars=dict(ids=row, 

 message = 'excel',

 target='make_excel', ]

add a controller function and view

def downloading():
ids = request.vars['ids']
target = request.vars['target']
if ids<>None and ids<>'' and len(ids)<>0:
return dict(message=T("Downloading reports"), ids=ids, 
target=target)
return dict(message=T("Nothing to download"), ids=None, target='')

The view downloading.html
{{extend 'layout.html'}}
Downloading
{{=message}}
$(function() {
   {{if ids<>None:}}

window.location.replace("{{=URL('default',target,vars=dict(ids=ids))}}");
   {{pass}}
window.setTimeout(function(){
window.history.back();
}, 2000);
  });



and two target functions: 
def make_excel():
ids = request.vars['ids']
etc. make the excel file etc.
raise HTTP(200, buff.getvalue(), **response.headers)

def make_zip_pdf():
   ids = request.vars['ids']
   etc. make the pdfs and zip'm etc.
   raise HTTP(200, buff.getvalue(), **response.headers)

After clicking the appropriate button a new page is shown with the message 
and the file is downloaded. After 2 seconds the previous page is shown.

Not really elegant but it works.  

anybody in for suggestions?

-- 
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: dumb question about sessions server used to store tables in order to avoid hits to db

2017-09-07 Thread Alex Glaros
sounds great!

-- 
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: dumb question about sessions server used to store tables in order to avoid hits to db

2017-09-07 Thread Leonel Câmara
It's not just theoretically possible web2py supports it:

http://www.web2py.com/books/default/chapter/29/13/deployment-recipes?search=redis#Sessions-in-Redis

It can improve performance significantly. 

-- 
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: Best practice regarding applications

2017-09-07 Thread Chinh Dang
You may also want to consider the availability of your applications. By
having all your apps on a single server and if the server is down, all your
apps will also be impacted. Unless, you have high availability built in at
the server level, i.e. cluster.

On Sep 7, 2017 7:00 AM, "Najtsirk"  wrote:

> Thanks!
>
> On Saturday, 2 September 2017 06:16:17 UTC+2, Massimo Di Pierro wrote:
>>
>> It is fine to have one web2py and as many domains as you need. It should
>> not affect performance provided you take advantage of the cores you have.
>> That means you want to make sure you use nginx+uwsgi or gevent or gunicorn
>> and have about one process per core.
>>
>> On Friday, 1 September 2017 05:17:42 UTC-5, Najtsirk wrote:
>>>
>>> Hello,
>>>
>>> after a long years of active use of web2py it came to me that probably I
>>> am not doing it as it should! :)
>>>
>>> So within one web2py i have several applications and each one is
>>> acctualy a separate site ona a different domain. Is this best pracitce or
>>> should i have one web2py instance for every site and applications are just
>>> functional subsections of the particular site?
>>>
>>> What is the performance impact of one way over the other (if any)?
>>>
>>> Thanks for your answers.
>>>
>>> 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.
>

-- 
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] dumb question about sessions server used to store tables in order to avoid hits to db

2017-09-07 Thread Alex Glaros
is it theoretically possible to leverage redis as a sessions store so that 
web2py session can hold many of the things normally kept on the db?

For example, could you store things like email-contacts and high-use lookup 
tables usually accessed as tables on the db, but now in session vars in 
order to reduce hits to the db?  (Db would only be accessed if there was 
any change to the tables represented by session vars.)

Would this improve performance?

My conceptual understanding could be so far off that this question doesn't 
make sense...

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.


Re: [web2py] Re: logging

2017-09-07 Thread Richard Vézina
Hello Lars,

Did you read that :
https://github.com/web2py/web2py/blob/0d646fa5e7c731cb5c392adf6a885351e77e4903/examples/logging.example.conf

I am looking at logging rigth now a new module and I do my research...

Setting global logger might be one of the main reason of your issue as I
guess you are shadowing web2py internal loggin activity???

Richard

On Thu, Aug 31, 2017 at 7:47 AM, Lars  wrote:

> The code needs to be in model not in modules.
>
> Could anyone explain why ?
>
>
>
> On Thursday, August 31, 2017 at 12:38:32 PM UTC+2, Lars wrote:
>>
>> Hi,
>>
>> I have this code in dlogging.py in the modules folder of my app :
>>
>> import logging
>> import logging.handlers
>>
>>
>> def get_configured_logger(name):
>> global logger
>> logger = logging.getLogger(name)
>> if len(logger.handlers) == 0:
>> fh = logging.FileHandler(os.path.join('/'.join(os.path.realpath(_
>> _file__).split('/')[:-3]),
>>  'logs/system.log'))
>> formatter = logging.Formatter('%(asctime)s - %(levelname)s
>> %(message)s')
>> fh.setFormatter(formatter)
>> logger.addHandler(fh)
>> logger.setLevel(logging.DEBUG)
>> return logger
>>
>> logger = get_configured_logger('web2py.app.system')
>>
>> I don't understand why it works in the shell but not from web2py from
>> inside a module class (with from dloggig import logger). Could anybody
>> figure why ?
>>
>> Thanks
>>
>> w2p : 2.15.3 py : 3.5.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/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: how to save controller vars into a field?

2017-09-07 Thread Anthony
On Thursday, September 7, 2017 at 3:34:08 AM UTC-4, pbreit wrote:
>
> Are you trying to store the URL of the page the user is currently on?
>
> I think you just want to store the URL. There's not just one variable as 
> far as I could tell. So you might have to build it like:
>
> bookmark = "%s://%s%s" % (request.env.wsgi_url_scheme, request.env.
> remote_addr, request.env.request_uri)
>

Note, you probably want request.env.web2py_original_uri rather than 
request.env.request_uri (the former is the actual incoming requested URL, 
whereas the latter is the full web2py URL after rewrite).

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: how to save controller vars into a field?

2017-09-07 Thread Alex Glaros
It worked!  Thanks Pbreit

on my desktop, it skiped the port part of the address 8000 so had to add to 
use w2p URL format:  bookmark = request.get_vars.bookmark.rsplit('/', 1)[-1]

-- 
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 save controller vars into a field?

2017-09-07 Thread Anthony

>
> VIEW THAT CAPTURES CURRENT PAGE VARS
>
> {{import json}} <-- side question: Why "import json" only works in 
> view and not controller?
>

Not sure what you mean. The json module is part of the standard library and 
can be imported from anywhere.
 

> {{=A('Add this page or manage bookmarks', _href=URL('default', 
> 'manage_menu_favorites', vars=dict(specificURL = request.url, 
> saved_menu_vars =  json.dumps(request.get_vars))), _class='btn btn-warning 
> btn-lg', 
> _style='font-size:120%;float:left;padding:10px;margin:10px;text-transform: 
> capitalize;')}}
>

At this point, what exactly is in request.get_vars (note, request.get_vars 
contains the variables in the query string of the URL, so this would be the 
query string of the current page)? Why do you want users to go to a new 
page whose URL includes a JSON representation of the query string from the 
previous page?

If users have a set of saved bookmarks, it does not make sense to keep all 
the bookmarks in the query string of the URL (i.e., request.get_vars). It 
makes more sense to store the bookmarks in the db and load them into the 
session as needed.

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.


Re: [web2py] How can you remove the text "Export" from a grid??

2017-09-07 Thread Anthony
Can you show your code, a screenshot, and explain exactly what you are 
trying to achieve. If I do SQLFORM.grid(..., csv=False), I see no export 
links.

Anthony

On Thursday, September 7, 2017 at 7:42:38 AM UTC-4, Andrea Fae' wrote:
>
> Yes
>
> Il 07 set 2017 1:41 PM, "黄祥"  ha scritto:
>
>> had you tried :
>> csv = False
>>
>> 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 a topic in the 
>> Google Groups "web2py-users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/web2py/df2TbGtB65Y/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] left join and common_filter

2017-09-07 Thread Marvi Benedet
Hello,

I'm writing a multi-tenant app.
All tables have a domain field which is used to distinguish beetween
different organizations.
They all have a "common_filter = lambda query:
db..domain==session.domain" parameter.

All is working fine, except when I'm trying to use a left join query,
in this case the filter seems not to work correctly, infact the query
return *all records, regardless the common_filter.*

The columns where the filter is applied have a "strange behavoiur", values
are present for the "right" records, but they assume the "none" value for
records that would normally be filtred.

I tried to inspect the sql generated and I obtain something like this:

SELECT `servizi`.`id`, `servizi`.`domain`, `servizi`.`id_servizio`,
`servizi`.`tipo_servizio` , `ivrs`.`id`, `ivrs`.`domain`, `ivrs`.`name`
FROM `ivrs` LEFT JOIN `servizi` ON (((`servizi`.`id_servizio` =
`ivrs`.`id`) AND (`servizi`.`tipo_servizio` = 'ivrs')) AND
(`servizi`.`domain` = 5)) ORDER BY `ivrs`.`name`;

this how the query is created:

ivrs=db().select(db.servizi.ALL, db.ivrs.ALL,
left=db.servizi.on((db.servizi.id_servizio ==
db.ivrs.id)&(db.servizi.tipo_servizio
== 'ivrs')),orderby=db.ivrs.name)


obv, this leads to problems, as users can see records that they are not
allowed to.
Is this the expected behaviour or is it a "bug"? is there a way to do a
left join mantaining the common_filter functionality?

I found a workaround: if I modify the query as follow:

ivrs=db(db.ivrs.domain==session.domain).select(..)

I get the right records, but this is not how common filter is supposed to
work.

Thanks,

Marvi

-- 
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] How can you remove the text "Export" from a grid??

2017-09-07 Thread andfae
Yes

Il 07 set 2017 1:41 PM, "黄祥"  ha scritto:

> had you tried :
> csv = False
>
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/df2TbGtB65Y/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.


Re: [web2py] How can you remove the text "Export" from a grid??

2017-09-07 Thread 黄祥
had you tried :
csv = False

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.


Re: [web2py] How can you remove the text "Export" from a grid??

2017-09-07 Thread andfae
No...I just tested both

Il 07 set 2017 1:06 PM, "Martin Weissenboeck"  ha
scritto:

> I think grid(exportklasses=None) or grid(
> exportclasses=dict(xml=false, csv=False,, html=False, tsv=False) should do
> the job. I have not tried it.
>
> From the book:
>
>
>
>- exportclasses takes a dictionary of tuples: by default it's defined
>as
>
> 1
> 2
> 3
> 4
> 5
> 6
>
> csv_with_hidden_cols=(ExporterCSV, 'CSV (hidden cols)'),csv=(ExporterCSV, 
> 'CSV'),xml=(ExporterXML, 'XML'),html=(ExporterHTML, 
> 'HTML'),tsv_with_hidden_cols=(ExporterTSV, 'TSV (Excel compatible, hidden 
> cols)'),tsv=(ExporterTSV, 'TSV (Excel compatible)'))
>
> ExporterCSV, ExporterXML, ExporterHTML and ExporterTSV are all defined in
> gluon/sqlhtml.py. Take a look at those for creating your own exporter. If
> you pass a dict like dict(xml=False, html=False) you will disable the xml
> and html export formats.
>
> 2017-09-07 12:54 GMT+02:00 Andrea Fae' :
>
>> I don't want any export and I dont' want the text "export" in the bottom
>> of the grid...
>>
>> --
>> 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.
>>
>
>
>
> ​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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/web2py/df2TbGtB65Y/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.


Re: [web2py] How can you remove the text "Export" from a grid??

2017-09-07 Thread Martin Weissenboeck
I think grid(exportklasses=None) or grid(
exportclasses=dict(xml=false, csv=False,, html=False, tsv=False) should do
the job. I have not tried it.

>From the book:



   - exportclasses takes a dictionary of tuples: by default it's defined as

1
2
3
4
5
6

csv_with_hidden_cols=(ExporterCSV, 'CSV (hidden
cols)'),csv=(ExporterCSV, 'CSV'),xml=(ExporterXML,
'XML'),html=(ExporterHTML, 'HTML'),tsv_with_hidden_cols=(ExporterTSV,
'TSV (Excel compatible, hidden cols)'),tsv=(ExporterTSV, 'TSV (Excel
compatible)'))

ExporterCSV, ExporterXML, ExporterHTML and ExporterTSV are all defined in
gluon/sqlhtml.py. Take a look at those for creating your own exporter. If
you pass a dict like dict(xml=False, html=False) you will disable the xml
and html export formats.

2017-09-07 12:54 GMT+02:00 Andrea Fae' :

> I don't want any export and I dont' want the text "export" in the bottom
> of the grid...
>
> --
> 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.
>



​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/d/optout.


[web2py] Re: Best practice regarding applications

2017-09-07 Thread Najtsirk
Thanks!

On Saturday, 2 September 2017 06:16:17 UTC+2, Massimo Di Pierro wrote:
>
> It is fine to have one web2py and as many domains as you need. It should 
> not affect performance provided you take advantage of the cores you have. 
> That means you want to make sure you use nginx+uwsgi or gevent or gunicorn 
> and have about one process per core.
>
> On Friday, 1 September 2017 05:17:42 UTC-5, Najtsirk wrote:
>>
>> Hello,
>>
>> after a long years of active use of web2py it came to me that probably I 
>> am not doing it as it should! :)
>>
>> So within one web2py i have several applications and each one is acctualy 
>> a separate site ona a different domain. Is this best pracitce or should i 
>> have one web2py instance for every site and applications are just 
>> functional subsections of the particular site?
>>
>> What is the performance impact of one way over the other (if any)?
>>
>> Thanks for your answers.
>>
>> 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.


[web2py] How can you remove the text "Export" from a grid??

2017-09-07 Thread Andrea Fae'
I don't want any export and I dont' want the text "export" in the bottom of 
the grid...

-- 
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] Delete EXPORT button from SQLFORM.grid

2017-09-07 Thread Andrea Fae'
I need the same!


Il giorno venerdì 5 maggio 2017 09:30:56 UTC+2, Yebach ha scritto:
>
> How can you also remove the text "Export" ??
>
> If I set all classes to False the text stays, if I remove export classes 
> from signature it displays all
>
> On Wednesday, August 15, 2012 at 12:41:28 PM UTC+2, Jan Rozhon wrote:
>>
>> Silly me didnt notice this option. Thx 
>>
>> Dne středa, 15. srpna 2012 11:43:46 UTC+2 Johann Spies napsal(a):
>>>
>>> On 15 August 2012 11:31, Jan Rozhon  wrote:
>>>


 did someone solve how to remove the export button from the 
 SQLform.grid? 

>>>
>>> Use the option: csv = False when you define the grid.
>>>
>>> Regards
>>> Johann 
>>>
>>> -- 
>>> Because experiencing your loyal love is better than life itself, 
>>> my lips will praise you.  (Psalm 63: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/d/optout.


[web2py] Re: web2py 2.15.4 is OUT

2017-09-07 Thread pbreit
To update can i just do a `git pull` or do I need to do something like `git 
pull --recurse-submodules`

-- 
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 save controller vars into a field?

2017-09-07 Thread pbreit
Are you trying to store the URL of the page the user is currently on?

I think you just want to store the URL. There's not just one variable as 
far as I could tell. So you might have to build it like:

bookmark = "%s://%s%s" % (request.env.wsgi_url_scheme, request.env.
remote_addr, request.env.request_uri)

Kind of ugly. I'm surprised there isn't an env variable of the current 
URL/URI.

http://www.web2py.com/books/default/chapter/29/04/the-core#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.