[web2py] two web2py servers and sessions in redis

2020-05-07 Thread Yoel Benitez Fonseca
Got the following situation: - Two applications released as lambda functions (A and B), each application in this scenary have his own web2py version, served with the same domain name behind an nginx proxy, for example A (example.com) and B (example.com/path_to_b). - i wanted that B uses A as a

[web2py] Packing application

2020-04-24 Thread Yoel Benitez Fonseca
how to programmatically package an application as in the admin app ? I mean, obtain the .w2p package ? -- Msc. Yoel Benítez Fonseca -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issue

[web2py] db.scheduler_task.enabled

2019-12-10 Thread Yoel Benitez Fonseca
what is the meaning of *db.scheduler_task.enabled* Can I use it to temporarily disable a task? -- Msc. Yoel Benítez Fonseca -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

Re: [web2py] Re: rename request hostname

2019-11-12 Thread Yoel Benitez Fonseca
H! El lun., 11 nov. 2019 a las 17:03, Dave S () escribió: > > > On Monday, November 11, 2019 at 7:12:44 AM UTC-8, Yoel Benitez Fonseca > wrote: >> >> h! >> >> Is it possible to change the hostname that comes in the form request so >> that outbound link

[web2py] rename request hostname

2019-11-11 Thread Yoel Benitez Fonseca
h! Is it possible to change the hostname that comes in the form request so that outbound links have the hostname i want? I have an app in an internal network that I want to make visible from the outside with an nginx proxy, all relative links work correctly, this would be the example of confi

[web2py] Re: permissions question

2019-10-08 Thread Yoel Benitez Fonseca
After a dive in gluon/tools.py And a lot of try and errors this is what i came up to: https://gist.github.com/ybenitezf/5e66627c668813886f9da60f67aef5e9 maybe is not the best way El viernes, 27 de septiembre de 2019, 15:55:47 (UTC-4), Yoel Benitez Fonseca escribió: > > h! &g

[web2py] permissions question

2019-09-27 Thread Yoel Benitez Fonseca
h! With `auth.accessible_query` u get the rows accessible to a user, how to do the inverse ? I want to know the users who have a given permission -- Msc. Yoel Benítez Fonseca -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source c

Re: [web2py] github vs gitlab

2019-07-23 Thread Yoel Benitez Fonseca
H! Massimo, I'am using web2py and a private gitlab for some time now in a project of my own. Technically both provide you the same features, more or less. But, we had some problems since the purchase of gitlab from google - i'm from Cuba, and when the purchase took place gitlab (the site and repo

[web2py] Re: intercepting login & logout events

2019-06-18 Thread Yoel Benitez Fonseca
missed that one El martes, 18 de junio de 2019, 2:25:18 (UTC-4), Annet escribió: > > Web2py has auth.settings I used them to solve your problem > > > auth.settings.login_onaccept = lambda form: __on_login() > auth.settings.logout_onlogout = lambda user: __on_logout() > > and then in the functions

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Yoel Benitez Fonseca
303? > Because I don't understand that part at all - I am not aware of exception > being raised, why, and how it works in the flow - could you please point me > to the direction where it's explained? > > On Monday, June 17, 2019 at 10:16:58 AM UTC-4, Yoel Benitez Fonseca wr

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Yoel Benitez Fonseca
019 at 9:44:10 AM UTC-4, Yoel Benitez Fonseca wrote: >> >> I think you can do it in the default/user function. Having in account >> that the call to auth() probably raises a HTTP exceptiong in case of a >> success. This example is only a proof of concept: >> &

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Yoel Benitez Fonseca
Got a syntax error there, sorry: El lunes, 17 de junio de 2019, 9:44:10 (UTC-4), Yoel Benitez Fonseca escribió: > > I think you can do it in the default/user function. Having in account that > the call to auth() probably raises a HTTP exceptiong in case of a success. > This examp

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Yoel Benitez Fonseca
I think you can do it in the default/user function. Having in account that the call to auth() probably raises a HTTP exceptiong in case of a success. This example is only a proof of concept: def user(): form = CAT() try: form = auth() except HTTP as e: if e.status == 3

Re: [web2py] Re: login_bare not working

2018-12-11 Thread Yoel Benitez Fonseca
probably abastardi wants: username, password = request.post_vars['username'], request.post_vars['password'] if not auth.user: auth.login_bare(username, password) What is that's for ... i can only guest... On Dec 11 2018, at 11:58 am, Anthony wrote: > > > > > > > > > What is the point of calling

Re: [web2py] Re: Current.db

2018-10-13 Thread Yoel Benitez Fonseca
On Oct 13 2018, at 9:39 am, Anthony wrote: > > Yes, but in your post, you indicated that when adding db to current in the > model file, it must be done inside a function rather than at the top level of > the model file, and that is not true. In the model file, you can do: > > from gluon import

Re: [web2py] Re: Current.db

2018-10-12 Thread Yoel Benitez Fonseca
clean, under 'manage' and then open the app the error > disappears. > On Sat, 13 Oct 2018, 00:16 Yoel Benitez Fonseca (mailto:ybenit...@gmail.com)> wrote: > > Sorry Anthony but it seems to that the original question was about accesing > > db trough current, with

Re: [web2py] Re: Current.db

2018-10-12 Thread Yoel Benitez Fonseca
nt.db auth = current.auth And there u go with access to any thing you can attach to current On Oct 12 2018, at 5:08 pm, Anthony wrote: > > On Friday, October 12, 2018 at 4:59:07 PM UTC-4, Yoel Benitez Fonseca wrote: > > In a model do, in db.py at the end if u can: > > > > d

Re: [web2py] Re: Current.db

2018-10-12 Thread Yoel Benitez Fonseca
In a model do, in db.py at the end if u can: def _(): from gluon import current current.db = db current.auth = auth _() Remember's the book says: don't import current into module level code. On Oct 12 2018, at 12:04 pm, Lovedie JC wrote: > > Yes. > from gluon import * > from gluon import current

Re: [web2py] web2py.test replacement

2018-10-12 Thread Yoel Benitez Fonseca
I have a local copy of that repository if u are interested. Also i'm working on a mayor project using the test system proposed by @viniciusban in his repository, also with our owm modifications. Sent from Mailspring (https://link.getmailspring.com/link/1539357757.local-9f00e710-50e2-v1.4.2-f587

Re: [web2py]

2018-09-13 Thread Yoel Benitez Fonseca
h! You can use SQLFORM.factory and custom forms in your views (http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms). El jue., 13 sept. 2018 a las 9:34, elisha bere () escribió: > > ok. thanks but is it safe ? > > > On Thu, 13 Sep 2018 at 15:25, sandeep patel wrote: >>

Re: [web2py] Re: How to go publick with web2py

2018-07-28 Thread Yoel Benitez Fonseca
no, you need nothing extra, checkout you antivirus and windows firewall those 2 can't refuse your inbound connections. El sáb., 28 jul. 2018 a las 8:28, Stavros Boletis () escribió: > > i need one more answer..How i can do it on windows?? cause every answer i > find is for ubu or linux enviroemnt.

Re: [web2py] Re: scheduler trouble

2018-07-09 Thread Yoel Benitez Fonseca
Can you try...cath the task code and send the notification on exception base from the task it self, or make other kind of task that can be schelude fron the first to send the notification in case of failure? El vie., 6 jul. 2018 a las 5:51, Manuele Pesenti () escribió: > Hi Dave, > > thanks for

Re: [web2py] How to know if my code is execute by a scheduler ?

2018-06-22 Thread Yoel Benitez Fonseca
2018 at 9:53 AM, Yoel Benitez Fonseca > wrote: >> >> I have a code (insert or modify some values on tables) with can be called >> both from a scheduler task and the normal request based method, in the last >> db.commit is called by web2py. >> >> The proble

[web2py] How to know if my code is execute by a scheduler ?

2018-05-30 Thread Yoel Benitez Fonseca
I have a code (insert or modify some values on tables) with can be called both from a scheduler task and the normal request based method, in the last db.commit is called by web2py. The problem is the same code won't commit the changes unless explicity db.commit if running on a scheluder task.

[web2py] Quick question... URL and scheduler...

2018-05-26 Thread Yoel Benitez Fonseca
H! Got this task on a scheduler in with an email notification is geneted for the users, the scheduler and the web server are not running on the same host. In the notificación i need to pass a link to the user, for example: some text My question is ¿what hostname will be used takng in account

[web2py] list:reference and SQLFORM.grid

2018-04-21 Thread Yoel Benitez Fonseca
Is the grid search not working witch list:reference ? for example: db.define_table('thing', Field('name', 'string')) db.define_table('person', Field('name', 'string'), Field('things', 'list:reference thing')) db.person.things.requires = IS_IN_DB(db, 'thing.id', '%(name)s', multiple=True) The

[web2py] Re: Pass a query from form to another function

2018-04-20 Thread Yoel Benitez Fonseca
Umm... sorry took long to answer, i have put on issue on PyDAL repo and a pull request with a posible fix: https://github.com/web2py/pydal/pull/531 El martes, 10 de abril de 2018, 22:20:04 (UTC-4), Anthony escribió: > > On Tuesday, April 10, 2018 at 6:14:06 PM UTC-4, Yoel Benitez Fonseca

[web2py] Re: Pass a query from form to another function

2018-04-10 Thread Yoel Benitez Fonseca
Is this not working any more ? >>> q = (db.photo.id == 1) >>> db(q.as_dict(flat=True)).select() File "", line unknown SyntaxError: Operator not supported: eq That is in a web2py shell,i mean is the same thing passing around the query in the session as a dict, is not ? El miércoles, 7 de dicie

[web2py] compiling application ?

2018-02-27 Thread Yoel Benitez Fonseca
Is there a way of compiling a web2py application from the command line ? -- Msc. Yoel Benítez Fonseca -- 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) --- Yo

Re: [web2py] _href to URL()

2018-02-24 Thread Yoel Benitez Fonseca
don't use URL at all, just do: ('TaC', False, A('TaC', _href='https://static.domain.com/files/Terms_and_Conditions.pdf', _target="_blank", vars=dict(attachment=True))) If it gives an error call the .xml() directly on A: ('TaC', False, A('TaC', _href='https://static.domain.com/files/Terms_and_Co

[web2py] Re: Resetting the database

2018-01-29 Thread Yoel Benitez Fonseca
I wan't to clean up my database trough an script with i want to use as a data generator for demo purposes it work's fine wth SQLite but with Mysql got a lot of error's: def limpiar_db(db, models): for m in models: l("Limpiando tabla: {}".format(m)) db[m].truncate() db.com

Re: [web2py] request.args(0) vs request.args[0]

2017-11-30 Thread Yoel Benitez Fonseca
#return None >>> print request.args[0] #fail >>> >> >> That's "fail" as in "ticket issued", because of array bounds error. Also, >> on the grammar level, that's an array reference and the other is a function >> ... and Anthony ha

[web2py] request.args(0) vs request.args[0]

2017-11-29 Thread Yoel Benitez Fonseca
¿What is the diff? -- Msc. Yoel Benítez Fonseca -- 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

[web2py] PluginManager is not instantiated in the default scaffolding app

2017-11-27 Thread Yoel Benitez Fonseca
h! This is web2py 2.16.1, in the book: http://web2py.com/books/default/chapter/29/12/components-and-plugins#Plugin-manager Says: The plugins object is already instantiated in the default scaffolding app in "models/db.py" But creating an app from the admin the PluginManager object is no where t

Re: [web2py] list:string field length

2017-11-19 Thread Yoel Benitez Fonseca
I don't mean to set the length, i just wanted to know the DAL behavior behind the scene. So, DAL translate 'string:list' to a list in databases that natively support lists and to a TEXT field on normal relational databases and hence set the length of the text field to the default ? 2017-11-17 15:5

[web2py] list:string field length

2017-11-17 Thread Yoel Benitez Fonseca
h! I always wanted to ask: According the online book, it is recommended to explicit set the length of "string", "password" or "upload", but what about list:string ? -- Msc. Yoel Benítez Fonseca -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2

Re: [web2py] Re: web2py 2.16.1 is OUT

2017-11-14 Thread Yoel Benitez Fonseca
Got some strange result after the updates... im ussing pytest for testing and the was a test for a submit form with was working últil the update, the model: db.define_table( 'producto', Field('nombre', 'string', length=50, unique=True, label='Nombre:'), Field('tipo_prod

[web2py] Re: Custom maintenance message

2017-10-20 Thread Yoel Benitez Fonseca
Nerver mind ... i have found app/static/503.html now ¿how to include images and souch ? 2017-10-20 12:04 GMT-04:00 Yoel Benitez Fonseca : > hi ! > > How can i make a custom 'Temporarily down for maintenance' page ? > > -- > Msc. Yoel Benítez Fonseca > Dpto. Informá

[web2py] Custom maintenance message

2017-10-20 Thread Yoel Benitez Fonseca
hi ! How can i make a custom 'Temporarily down for maintenance' page ? -- Msc. Yoel Benítez Fonseca Dpto. Informática. Redacción Adelante http://www.adelante.cu/ -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https:/

[web2py] Web2py con CentOS 7 with apache 2.4

2017-10-06 Thread Yoel Benitez Fonseca
Anyone with a example apache config working ... I've been trying for 2 days and got nothing... the python coded is executed correct but my static are either 403 or 404.. here is my apache config: https://pastebin.com/uV0aEu0F And the error log from apache: [Fri Oct 06 17:52:38.698109 2017] [auth

[web2py] Setup web2py on apache 2.4 along side with plex

2017-10-05 Thread Yoel Benitez Fonseca
Hi, I got all setup and running except that static files are denied by apache (2.4): this is my apache config: -- WSGIDaemonProcess web2py user=apache group=apache WSGIProcessGroup web2py WSGIScriptAlias / /opt/web-apps/web2py/wsgihandler.py WSGIPassAuthorization On

Re: [web2py] Re: weird issue with date field

2017-08-29 Thread Yoel Benitez Fonseca
umm.. should test it again ... thnk 2017-08-28 22:37 GMT-04:00 Peter : > For what it's worth... > > I downloaded the latest, > > 2.15.3-stable+timestamp.2017.08.07.12.51.45 > (Running on Rocket 1.2.6, Python 2.7.12) > > > pasted your code into db.py > > used crud.create in the controller (I know

Re: [web2py] Re: web2py 2.15.3 is OUT

2017-08-28 Thread Yoel Benitez Fonseca
Hi, new copy of 2.15.3, create a model with a date Field - using SQLite, in appadmin or a CRUD form the date widget don't show the year, just the name of the day. I come from 2.14.6, don't know if this is something related only to 2.15.3 or is that i'm missing something. 2017-08-27 21:13 GMT-04:

[web2py] weird issue with date field

2017-08-28 Thread Yoel Benitez Fonseca
hi, i got a new copy of the lasted stable web2py from web2py.com, put in this simple model: tbl = db.define_table( "productos", Field('nombre', 'string', length=100, label='Nombre'), Field('codigo', 'string', length=30, label='Código'), Field('fecha_caducidad', 'date', label='Fecha caducidad'), Fi

[web2py] w2p appliance

2017-03-01 Thread Yoel Benitez Fonseca
H! How can i add my app to the appliances list (http://www.web2py.com/appliances)? My project live on https://github.com/ybenitezf/nstock, is a work on progress. I thought I would make some money with it but things have not turned out as I wanted. I pretend to continue working on it anyway. --

Re: [web2py] Re: How to limit the size of uploads?

2017-01-30 Thread Yoel Benitez Fonseca
my bad. 2017-01-28 17:14 GMT-05:00 Leonel Câmara : > No Yoel, if he uses my second tip, which is change the webserver > configuration, the webserver will readily block the client after the limit > is reached and before the upload is finished. > > -- > Resources: > - http://web2py.com > - http://we

Re: [web2py] Re: How to limit the size of uploads?

2017-01-28 Thread Yoel Benitez Fonseca
Yea but theres two tips form Leonel implied that the client already have send data to the server with is what tomc514 is trying to avoid. 2017-01-28 9:54 GMT-05:00 Leonel Câmara : > You can use the IS_LENGTH validator, then usually people place max body size > on the webserver configuration, for i

Re: [web2py] Re: How do I add labels and text field dynamically in web2py and saved them into database.

2017-01-28 Thread Yoel Benitez Fonseca
think he wants to add fields on-the-fly to the database based on user input. 2017-01-27 23:30 GMT-05:00 Massimo Di Pierro : > sorry do not understand > > > On Friday, 20 January 2017 18:42:22 UTC-6, Corden Naraga wrote: >> >> Scenario: I have a Terms option ranging from 1-6. If I select 3, 3 label

Re: [web2py] Re: User group blocked in China

2017-01-28 Thread Yoel Benitez Fonseca
i'm a email user, don't use - almost never - the GG web UI. Works find with me. 2017-01-27 23:39 GMT-05:00 Massimo Di Pierro : > willing to help with this. but moving the group out of google group is a lot > of work. If you can think of a different solution let me know. > > > On Tuesday, 24 Januar

Re: [web2py] Web2py conditional models

2017-01-28 Thread Yoel Benitez Fonseca
this for example: https://github.com/yotech/agis/blob/master/app/agis/modules/agiscore/db/grupo.py Not a complete correct example, but can pin/ping the idea 2017-01-28 9:05 GMT-05:00 Yoel Benitez Fonseca : > sorry on 1.- sould say: > > 1.- Pass your models definitions to modules and pa

Re: [web2py] Web2py conditional models

2017-01-28 Thread Yoel Benitez Fonseca
sorry on 1.- sould say: 1.- Pass your models definitions to modules and packages on ``modules`` 2017-01-28 9:04 GMT-05:00 Yoel Benitez Fonseca : > I have being there :-/ ... what i do was: > > 1.- Pass your models definitions to models and packages on ``modules`` > 2.- In the modu

Re: [web2py] Web2py conditional models

2017-01-28 Thread Yoel Benitez Fonseca
I have being there :-/ ... what i do was: 1.- Pass your models definitions to models and packages on ``modules`` 2.- In the modules put each table definition on a method, for example: define_tables(): db = current.db if not hasattr(db, 'some_table'): db.define_table('some_table',

Re: [web2py] How to limit the size of uploads?

2017-01-28 Thread Yoel Benitez Fonseca
to be a little more precise validate it on both sides 2017-01-28 8:51 GMT-05:00 Yoel Benitez Fonseca : > think u can makeup it with js on client side. I mean, use custom form > and validated the upload size on client side: > > http://stackoverflow.com/questions/1601455/how-to-chec

Re: [web2py] How to limit the size of uploads?

2017-01-28 Thread Yoel Benitez Fonseca
think u can makeup it with js on client side. I mean, use custom form and validated the upload size on client side: http://stackoverflow.com/questions/1601455/how-to-check-file-input-size-with-jquery hope this help u out. 2017-01-22 18:22 GMT-05:00 : > Does anyone know how to limit the size of

Re: [web2py] Upload Video

2016-12-16 Thread Yoel Benitez Fonseca
I don't see wy your upload field is not accepting video files. El dic. 15, 2016 4:51 PM, "David" escribió: > What does RTFM mean? > > *db:* > >> db.define_table('post', >> >>Field('page_id','reference the_page'), >> >>Field('your_name', 'string'), >> >>

Re: [web2py] Upload Video

2016-12-15 Thread Yoel Benitez Fonseca
Yes u can. And not, "The normal "upload" type in db only lets me choose an image" don't do that - RTFM: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#More-on-uploads You are probably including some code from examples and using a image validator for the upload field

Re: [web2py] Re: Forcing the translation of a text

2016-12-12 Thread Yoel Benitez Fonseca
It was my fault, all the time. I forgot that theres is some code in my model with create the new record before the segment i have share in this thread. Sorry for the time. 2016-12-12 9:43 GMT-05:00 Yoel Benitez Fonseca : > This not worked for me, the idea was to insert a folder record with &g

Re: [web2py] Re: Forcing the translation of a text

2016-12-12 Thread Yoel Benitez Fonseca
Accept-Language'].lower() >> >> T.force(language) > > I think got what is wrong, the controller in particular with execute my > code was on a ajax request, i have tested on a normal request and it do > what is suppose to do. > > Thanks folks, i'll test setting is

Re: [web2py] This is not working as expected. Please correct this.

2016-11-28 Thread Yoel Benitez Fonseca
GMT-05:00 Mike Stephenson : > I am not getting the day of the month > > On Monday, November 28, 2016 at 10:47:13 PM UTC+5:30, Yoel Benitez Fonseca > wrote: >> >> and what value are u getting on 'k', the day of month i suppose !? >> >> 2016-11-2

Re: [web2py] This is not working as expected. Please correct this.

2016-11-28 Thread Yoel Benitez Fonseca
and what value are u getting on 'k', the day of month i suppose !? 2016-11-28 9:56 GMT-05:00 Mike Stephenson : > form3 = SQLFORM.factory(Field('ddate','date', label='Enter a > date')).process() > if form3.accepted: > k=form3.vars.ddate.day() > redirect(URL('readings', 'check', args

Re: [web2py] Re: vue.js

2016-10-12 Thread Yoel Benitez Fonseca
i miss the time of only server-side :-( 2016-10-12 13:21 GMT-04:00 Anthony : >> >> In react you simple do: >> >> > > > You don't simply do that in React. The above assumes you have created a > React component that takes "url" and "pollinterval" props and then after > being mounted starts mak

Re: [web2py] Re: vue.js

2016-10-12 Thread Yoel Benitez Fonseca
i don't get it... i have been reading vue.js docs and a lot of examples and don't see the way of it... suppose, for example, i want to use the comment plugin example with vue, so that i can LOAD the plugin into the web2py getting a form for post comment's and a list of comment... how to keep loadi

Re: [web2py] vue.js

2016-10-11 Thread Yoel Benitez Fonseca
thanks that give some ideas 2016-10-11 11:29 GMT-04:00 Anthony : > On Tuesday, October 11, 2016 at 10:59:11 AM UTC-4, Marlysson Silva wrote: >> >> Until now , https://github.com/web2py/scaffold > > > In particular, check out > https://github.com/web2py/scaffold/blob/master/views/default/main.html

Re: [web2py] vue.js

2016-10-11 Thread Yoel Benitez Fonseca
any example out there with vue.js and web2py ? 2016-09-24 23:25 GMT-04:00 Massimo Di Pierro : > I am becoming a huge fan of vue.js. Any other user here? > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https:

Re: [web2py] Re: field in list test

2016-09-20 Thread Yoel Benitez Fonseca
> > f = db.item.id > fields = [f.name] > f.name in fields > > Or using your current code, you can do: > > any(field is f for field in fields) > > Above, field == f would result in the same problem, but field is f avoids > the creation of the Query object. > > A

Re: [web2py] Re: Alternative IDEs?

2016-09-20 Thread Yoel Benitez Fonseca
Atom +1 El sep 19, 2016 9:56 AM, "Philip Kilner" escribió: > Hi, > > On 19/09/16 12:36, Jurgis Pralgauskis wrote: > >> What are people mostly using for W2P dev? >> > > I'm currently using Atom and Cloud 9. > > To be honest, I'm getting on better with Cloud 9, but need to the paid > version for m

[web2py] field in list test

2016-09-16 Thread Yoel Benitez Fonseca
Does this make sense to you? In [1]: fields = list() In [2]: f = db.item.id In [3]: f in fields Out[3]: False In [4]: fields.append(f) In [5]: f in fields Out[5]: True In [6]: f = db.item.headline In [7]: f in fields Out[7]: True I mean, the last value of 'f' is a fields object but a differ

Re: [web2py] Cannot Create Table Named "Items" - Already Exists

2016-09-01 Thread Yoel Benitez Fonseca
i don't know of "items" but "item" is not a keyword for Python or Web2py ... i'm using it right now in one of my projects: db.define_table('item', # item metadata Field('provider', 'string', length=100, default=''), Field('provider_service', 'string'), Field('pubstatus', 'string',

[web2py] Re: custom update form multiple tables and list:string

2016-08-30 Thread Yoel Benitez Fonseca
item[f.name] for f in db.concrete_item: form.vas[f.name] = concrete_item[f.name] if form.proccess().accepted: # here call update_record, etc. pass return dict(form=form) El lunes, 29 de agosto de 2016, 14:24:19 (UTC-4), Yoel Benitez Fonseca escribió: > > h

Re: [web2py] Best way to pre-populate a database on start-up

2016-08-30 Thread Yoel Benitez Fonseca
You can use a .CSV file. What i have used to do is: 1.- Define the tables that are being pre-populate. 2.- Insert all the data with appadmin. 3.- Using the appadmin export the data to a .CSV (db_colors.csv) file and put it in the private folder of your app. 4.- Do the same thing you are doing exce

[web2py] custom update form multiple tables and list:string

2016-08-29 Thread Yoel Benitez Fonseca
h! i got 2 tables, i need to make one update form for both, let's say they are: - db.define_table("item", ... Field('keywords', 'list:string', ...) ... ) db.define_table('concrete_item', Field('item_id', 'reference item'), ... ) - In the controller: - d

Re: [web2py] Re: sidebar

2016-03-28 Thread Yoel Benitez Fonseca
I'm using a structure similar to `response.menu` to generate my sidebar, in that way you can have general items inserted in your sidebar and customize it later. 2016-03-27 19:11 GMT-04:00, 黄祥 : > pls try in your view : > {{right_sidebar_enabled = True}} > > {{block right_sidebar}} > {{include 'def

Re: [web2py] Re: python Script

2016-02-11 Thread Yoel Benitez Fonseca
also [1]: ... python web2py.py -S app -M -R applications/app/private/myscript.py -A a b c where -S app tells web2py to run "myscript.py" as "app", -M tells web2py to execute models, and -A a b c passes optional command line arguments sys.argv=['applications/app/private/myscript.py','a','b','c'] t

Re: [web2py] overwrite installed app

2016-01-28 Thread Yoel Benitez Fonseca
I think that the overwriting feature is fine just as it's right now... I have one application on production server and I can update it merging the update with the old version without troubling my self with backups for upload files, for example. In my models definition modules - with is the way i p

Re: [web2py] Re: how to get old version

2016-01-05 Thread Yoel Benitez Fonseca
; > Anthony > > On Monday, January 4, 2016 at 11:24:02 AM UTC-5, Yoel Benitez Fonseca > wrote: >> >> h!, how can i get the old versions of web2py, on >> http://web2py.com/init/default/download u can only get the latest but >> i want one concrete version. >&

Re: [web2py] how to get old version

2016-01-05 Thread Yoel Benitez Fonseca
#x27;t need clone recursive for previous pyDAL > version... > > Richard > > On Tue, Jan 5, 2016 at 9:38 AM, Yoel Benitez Fonseca > wrote: > >> but on github u don't get the submodules >> >> 2016-01-04 11:29 GMT-05:00, Richard Vézina : >> > Github! &

Re: [web2py] how to get old version

2016-01-05 Thread Yoel Benitez Fonseca
but on github u don't get the submodules 2016-01-04 11:29 GMT-05:00, Richard Vézina : > Github! > > Richard > > On Mon, Jan 4, 2016 at 11:23 AM, Yoel Benitez Fonseca > wrote: > >> h!, how can i get the old versions of web2py, on >> http://web2py.com/in

[web2py] how to get old version

2016-01-04 Thread Yoel Benitez Fonseca
h!, how can i get the old versions of web2py, on http://web2py.com/init/default/download u can only get the latest but i want one concrete version. -- Yoel Benítez Fonseca http://redevil.cubava.cu/ $ python -c "import this" -- Resources: - http://web2py.com - http://web2py.com/book (Documentati

Re: [web2py] Re: web2py 2.13.1 is OUT

2015-12-19 Thread Yoel Benitez Fonseca
sorry, in the console it works, its seems to be my problem 2015-12-19 17:27 GMT-05:00, Yoel Benitez Fonseca : > i have upgrade to this version and the are some issues, for example > IS_UPPER validator stopped working... > > 2015-12-19 12:48 GMT-05:00, Raul Monares : >> Exc

Re: [web2py] Re: web2py 2.13.1 is OUT

2015-12-19 Thread Yoel Benitez Fonseca
i have upgrade to this version and the are some issues, for example IS_UPPER validator stopped working... 2015-12-19 12:48 GMT-05:00, Raul Monares : > Excellent !! > > On Thursday, December 17, 2015 at 11:31:38 PM UTC-7, Massimo Di Pierro > wrote: >> >> CHANGELOG >> >> ## 2.13.1 >> >> >> - fixed o

[web2py] getting db from a row

2015-12-15 Thread Yoel Benitez Fonseca
hi ! suppose i get a row form a query in a function, is there any way of extract the database connection used to get the row form it ? row._db ? row.db ? -- Yoel Benítez Fonseca http://redevil.cubava.cu/ $ python -c "import this" -- Resources: - http://web2py.com - http://web2py.com/book (Docum

Re: [web2py] Re: Write in database from modules

2015-12-04 Thread Yoel Benitez Fonseca
Anthony, I see the advantage of passing db as a parameter to the code on modules and not relaying to much on current, but what happen when u can't control the parameters, for example i have a custom Exporter for a grid in a module: class MyExporter(ExportClass): ... on a controller: exports

Re: [web2py] Personalize order reading Model File

2015-12-04 Thread Yoel Benitez Fonseca
What i do is put model definition on modules - not models - for example i have a module for person (person.py) and a module for state (state.py) each have a define_table function. Then in my models some where i can import then in pretended order: import person import state person.define_table() s

Re: [web2py] Write in database from modules

2015-12-04 Thread Yoel Benitez Fonseca
In module1.py: def myfunction(var1=2): db = current.db db.table1.insert(F1=var1) db.commit() # if this call is not a part of a HTTP request return 2015-12-04 9:39 GMT-05:00, Aydin S : > This might be asked before and I already found a similar question in here: > https://groups.g

Re: [web2py] Re: fields and table definition on modules

2015-11-17 Thread Yoel Benitez Fonseca
web2py's commits > "explicitely" for every "structure modification". > > On Tuesday, November 17, 2015 at 8:35:02 PM UTC+1, Anthony wrote: >> >> On Tuesday, November 17, 2015 at 12:35:31 PM UTC-5, Yoel Benitez Fonseca >> wrote: >>> >

Re: [web2py] Re: fields and table definition on modules

2015-11-17 Thread Yoel Benitez Fonseca
Side question: in a module, like in this example, i don't need to call commit() for the table to be created ? 2015-11-17 12:29 GMT-05:00, Yoel Benitez Fonseca : > sorry Anthony, it is just an adaptation of my original code: > > --- > from gluon import * > import categ_model

Re: [web2py] Re: fields and table definition on modules

2015-11-17 Thread Yoel Benitez Fonseca
sorry Anthony, it is just an adaptation of my original code: --- from gluon import * import categ_model m_fields = list() fld_name = Field('name', 'string') fld_categ = Field('categ_id', 'reference categories') m_fields.append(fld_name) m_fields.append(fld_categ) def define_table(): db = c

[web2py] fields and table definition on modules

2015-11-17 Thread Yoel Benitez Fonseca
h! all, Suppose i have this code in a app module: --- from gluon import * m_fields = list() fld_name = Field('name', 'string') fld_categ = Field('categ_id', 'reference categories') m_fields.append(fld_name) m_fields.append(fld_categ) def define_table(): if not hasattr(db, 'my_model'):

Re: [web2py] PyCharm license for web2py dev - who wants?

2015-10-16 Thread Yoel Benitez Fonseca
+1 2015-10-16 9:42 GMT-04:00, Richard Vézina : > For the one that want to try PyCharm "Professional" there is the EAP > (earlie access program), you can use the next version of PyCharm before the > official release... Most of the time these build are pretty stable... > > Richard > > On Thu, Oct 15

Re: [web2py] Re: Autocomplete widget don't respect other values in request.vars

2015-09-20 Thread Yoel Benitez Fonseca
for the callback from autocomplete: It should be: As you can see, autocomplete just add his parameters to the url assuming there are no other. 2015-09-20 9:01 GMT-04:00, Yoel Benitez Fonseca : > Thank's Antony for the replay, i'll create the issue. > > The error in th

Re: [web2py] Re: Autocomplete widget don't respect other values in request.vars

2015-09-20 Thread Yoel Benitez Fonseca
widget = city_widget > > Also, note that there is an error in your code -- you are assigning the > widget to db.person.city rather than to db.person.city.widget. > > Anthony > > On Saturday, September 19, 2015 at 11:05:52 AM UTC-4, Yoel Benitez Fonseca > wrote: >> >&

[web2py] Autocomplete widget don't respect other values in request.vars

2015-09-19 Thread Yoel Benitez Fonseca
hi! i have been struggling with a annoying bug, i got a this in a controller: --- def some_function(): if not request.vars.step: redirect(URL('some_function', vars=dict(step=1))) # # a lot of stuff in the middle # if request.vars.step = '3': db.person.

Re: [web2py] Re: ImportError: No module named

2015-09-08 Thread Yoel Benitez Fonseca
just to be sure i'm always importing modules with full quote: from applecations.myapp.modules import XXX just to be sure 2015-09-08 9:34 GMT-04:00, Leonel Câmara : > Ohh and it should be: > from form import Form > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation)

Re: [web2py] Action when file streaming finishes

2015-09-04 Thread Yoel Benitez Fonseca
if it a temporary file create by os.tmpfile() you don't need to care about deleting it, the system will take care of everything for you. -- Yoel 2015-09-04 8:32 GMT-04:00, desta : > Hello, > > When the client clicks on a specific link, a temporary file is created by a > > controller which is then

Re: [web2py] Re: protect a row in SQLFORM.grid

2015-08-16 Thread Yoel Benitez Fonseca
GMT-04:00, Yoel Benitez Fonseca : > Anthony, > > Can this method be applied to deletable parameter ? i'll test it aw. > > My problem is that i got a dataset where there are rows that can't be > deleted by users, but all the other rows can and must be editable and &

Re: [web2py] Re: protect a row in SQLFORM.grid

2015-08-16 Thread Yoel Benitez Fonseca
Anthony, Can this method be applied to deletable parameter ? i'll test it aw. My problem is that i got a dataset where there are rows that can't be deleted by users, but all the other rows can and must be editable and deletable, at first my work around was to implement my own grid factory managin

Re: [web2py] error importing module

2015-08-15 Thread Yoel Benitez Fonseca
Idk what are u doing but to me its seem to be a little dangerous to give root permissions to the www-data user. If you are doing some kind of system administrative application you should probably be better using the rocked webserver - included with web2py - rather apache or any other webserver. -

Re: [web2py] Application Seperation

2015-08-15 Thread Yoel Benitez Fonseca
It seems a good idea, since both are two separated domains, however u can make both applications cooperate through API or if they are installed in the same server y simply can import modules form the others applications. See [1] for examples. [1] http://web2py.com/books/default/chapter/29/10/ser

[web2py] protect a row in SQLFORM.grid

2015-08-15 Thread Yoel Benitez Fonseca
hello ! Is possible protect a row in a grid, i mean a specific row with certain value or Id ? -- Msc. Yoel Benítez Fonseca Especialista en TI Redacción Adelante Tel.: (53 32)284701 -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Sou

[web2py] Re: can a filename be suggested in a custom Exporter class for a SQLFORM.grid?

2015-08-10 Thread Yoel Benitez Fonseca
;views',filename)): html=response.render(filename, dict(rows=self.rows)) else: html=BODY(BEAUTIFY(response._vars)).xml() pass pdf.write_html(html) return XML(pdf.output(dest='S')) In this case is my own recipie for generic PDF exporting,

  1   2   >