[web2py] retrieving GET request (parameters; @service.json)

2022-08-03 Thread Vlad
If the following is exposed: @service.json def test(a, b): it works just fine when I submit url?a=val1;b=val2 but when I submit a dictionary - {"a":"val1", "b":val2"} - I can't figure out how to catch the parameters in the function test() - it gives an error that they are missing. I am

Re: [web2py] having to use migrate=false after migrating the database

2022-07-18 Thread Eliezer (Vlad) Tseytkin
Ah, that doesn't change - permissions are good - I am using the same app, just switching the database provider, so that's not a problem. Only pointing to a different db. On Mon, Jul 18, 2022 at 12:36 PM Massimiliano wrote: > Hello Vlad, > > Sorry for the misunderstanding

Re: [web2py] having to use migrate=false after migrating the database

2022-07-18 Thread Eliezer (Vlad) Tseytkin
e > fake_migrate = False > db = DAL(db_uri, migrate=migrate, fake_migrate=fake_migrate) > > maybe you can also check your databases folder permissions. Web2py needs > to be able to write into. > > Il giorno dom 17 lug 2022 alle ore 17:17 Vlad ha > scritto: > >> Massi

Re: [web2py] having to use migrate=false after migrating the database

2022-07-17 Thread Vlad
try fake_migrate=True so that DAL recreates tables metafata files > in the database folder. > Once done, you can restore fake_migrate=False and migrate=True. > > Should work > > Il giorno dom 17 lug 2022 alle ore 07:06 Vlad ha > scritto: > >> I've been using PythonAnywh

[web2py] having to use migrate=false after migrating the database

2022-07-16 Thread Vlad
I've been using PythonAnywhere Postgres hosting for a while. Used pg_dump and pg_restore to recreate the database in ElephantSQL. Not sure if this has contributed to the problem, but had to use options that drop owner and privileges (otherwise pg_restore generated errors, complaining about non-

Re: [web2py] Re: sessions folder under application

2022-07-07 Thread Eliezer (Vlad) Tseytkin
> a whole section in the docs web2py - Deployment recipes > <http://www.web2py.com/books/default/chapter/29/13/deployment-recipes?search=session2trash#Cleaning-up-sessions> > > On Wednesday, July 6, 2022 at 3:22:43 PM UTC+2 Vlad wrote: > >> Invalidating existing sess

Re: [web2py] Re: sessions folder under application

2022-07-06 Thread Eliezer (Vlad) Tseytkin
ll have to log in again. > > Are there date stamps you can use to delete old session files but keep > current ones? > > -Jim > > On Tuesday, July 5, 2022 at 10:44:35 PM UTC-5 Vlad wrote: > >> I was checking memory usage and noticed that the sessions folder (under >>

[web2py] sessions folder under application

2022-07-05 Thread Vlad
I was checking memory usage and noticed that the sessions folder (under one specific application) takes over 1G of disk space. Can I just delete everything in there? Trying to clean up the space to optimize disk usage - -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

[web2py] Groupby tricky question

2022-06-09 Thread Vlad
Please help - I can't figure it out! My question is a bit detailed, but it's not about details - I am totally missing how to properly handle this kind of thing: I have the following query: query = (db.ladore_order.created_on>=dt1) & (db.ladore_order.created_on<=dt2) rows = db(query).select(db

[web2py] Re: customizing field's visibility in user's profile

2022-06-09 Thread Vlad
ield_name.readable = False > db.auth_user.field_name.writable = False* > return dict(form=auth()) > > On Wednesday, June 8, 2022 at 2:02:54 AM UTC+5:30 Vlad wrote: > >> I added a few fields to auth_user, but they are for internal usage, so I >> don't want us

[web2py] Re: customizing field's visibility in user's profile

2022-06-09 Thread Vlad
sday, June 7, 2022 at 3:32:54 PM UTC-5 Vlad wrote: > >> I added a few fields to auth_user, but they are for internal usage, so I >> don't want users to see those when they are logged in. How do I manage the >> visibility of the fields in the user profile? >> > -

Re: [web2py] Abridged summary of web2py@googlegroups.com - 1 update in 1 topic

2022-06-08 Thread Eliezer (Vlad) Tseytkin
ead_0> - 1 Update > > customizing field's visibility in user's profile > <http://groups.google.com/group/web2py/t/6f3d34f8c0e91725?utm_source=digest&utm_medium=email> > Jim S : Jun 08 08:01AM -0700 > > Can you just set readable and writable to False? > >

[web2py] customizing field's visibility in user's profile

2022-06-07 Thread Vlad
I added a few fields to auth_user, but they are for internal usage, so I don't want users to see those when they are logged in. How do I manage the visibility of the fields in the user profile? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2p

[web2py] auth_user missing signature

2022-06-07 Thread Vlad
I just realized that auth_user has no signature by default. I've just changed it, but wondering if there is a trick to find out when the existing users were created - maybe some history / log of some kind somewhere? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) -

[web2py] Re: web2py.com down

2022-01-31 Thread Vlad
Indeed. On Sunday, January 30, 2022 at 10:20:06 PM UTC-6 Raul Monares wrote: > The site is down :( -- 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

[web2py] CAS setting the callback URL

2022-01-28 Thread Vlad
I have both consumer and provider behind Apache, with actual names (*as opposed to localhost:port) *, however when doing CAS, the provider sends the request back to the instance:port location instead of the URL I am accessing it with. The provider is defined in terms of its "external" URL (that

[web2py] The site hosted on PA is giving an error - an exception in db module

2021-09-23 Thread Vlad
File /home/vladtseytkin/web2py-vt/applications/vt/databases/c8b669d15150d7109e5f7ab36744a5b7_podcast.table appears corrupted I haven't changed or updated anything for a while, so it's not caused by anything that I would have done. Any ideas on how to restore the good behavior and get rid of

[web2py] Using min(), max(), count() with groupby in SQLFORM.grid

2020-12-23 Thread Vlad
Is there a limitation in the way SQLFORM.grid() can be used with groupby in the sense that functions like min(), max(), count() can't be used? the following gives an error: fields = [db.auth_user.id, db.my_table.created_on.min(), db.my_table.created_on.max()] grid = SQLFORM.grid(query, fields=

[web2py] rendering rows as a generator and displaying via SQLTABLE

2020-12-23 Thread Vlad
I'm getting the rows as a result of the select: *rows = db(query).select(*fields)* and want to display as *table = SQLTABLE(rows, _class='table')* but before displaying need to reformat based on field representation, so rendering first: *rendered_rows = rows.render()* now I simply want to displa

[web2py] modifying rows content before displaying in SQLTable (_extra in rows)

2020-11-21 Thread Vlad
I've got the following query: rows = db(query).select(db.ladore_order.total.sum().with_alias('Total'), db.ladore_order.total.count().with_alias('Transactions'), db.auth_user.first_name.with_alias('Fir

Re: [web2py] Re: How to reject request based on location

2020-10-27 Thread Eliezer (Vlad) Tseytkin
be top most > alphabetical) > Also you can modify PA-starting script to catch bad-IP before passing > request to web2py, but in this case you have to restart server after each > change. > > > > > вт, 27 окт. 2020 г. в 20:45, Eliezer (Vlad) Tseytkin < > westgate6...@gm

Re: [web2py] Re: How to reject request based on location

2020-10-27 Thread Eliezer (Vlad) Tseytkin
cessed for each request, so you > can just raise HTTP at db.py > > вторник, 27 октября 2020 г. в 04:52:57 UTC+3, Vlad: > >> I've discovered that my site is constantly bothered by weird locations - >> not that there is anything intrinsically wrong with those countries, but

[web2py] How to reject request based on location

2020-10-26 Thread Vlad
I've discovered that my site is constantly bothered by weird locations - not that there is anything intrinsically wrong with those countries, but those locations have nothing to do with actual customers. I want to reject the requests from those locations altogether. I can reject any specific

[web2py] Re: Connecting to mysql with TLS

2020-10-11 Thread Vlad
in fact, I can connect via CLI with just adding "--ssl" to the standard client. Any way to achieve that with web2py DAL ? On Sunday, October 11, 2020 at 1:47:16 PM UTC-5 Vlad wrote: > web2py 2.11.2 > > Ok so I only need the CA to be validated. > > Providing the

[web2py] Connecting to mysql with TLS

2020-10-11 Thread Vlad
web2py 2.11.2 Ok so I only need the CA to be validated. Providing the path to the CA file like: DAL("mysql://remoteuser:password@remotedbserver/database", driver_args={'ssl':{'ca':'path/to/ca/file'}}) I get "/path/to/web2py/gluon/contrib/pymysql/connections.py", line 822, in _send_authentic

Re: [web2py] Re: Db fields in the "links" of the grid

2020-10-08 Thread Eliezer (Vlad) Tseytkin
ly one who has encountered it for the past 10 years, we can live with it :) Thank you! On Thu, Oct 8, 2020, 10:58 AM Jim S wrote: > Vlad > > The behavior is exactly as you said it is. > > I don't know if I'd go as far as saying this is a problem with web2py. I > got

Re: [web2py] Re: Db fields in the "links" of the grid

2020-10-08 Thread Vlad
x27;formula','reference formula'), Field('description','string',default=None), Field('flavor','reference flavor'), Field('quantity','integer',requires=[IS_NOT_EMPTY()],default=1), Field('price','integ

Re: [web2py] Re: Db fields in the "links" of the grid

2020-10-08 Thread Vlad
rent','onhold'])), auth.signature) On Thursday, October 8, 2020 at 9:18:53 AM UTC-4 Jim S wrote: > any chance you have a model and a small sample-set of data you could share > that cause the inconsistencies to be shown? Just 3 records or so in each > table that can

Re: [web2py] Re: Db fields in the "links" of the grid

2020-10-08 Thread Eliezer (Vlad) Tseytkin
ere ALWAYS a > matching record in the secondary table? > > Oh, just thought of another thing. How about specifying db.cart.id in > fields=[], and the also specifying it in hidden_fields=[]? > > Jim > > > > On Wed, Oct 7, 2020, 9:50 PM Eliezer (Vlad) Tseytkin <

Re: [web2py] Re: Db fields in the "links" of the grid

2020-10-07 Thread Eliezer (Vlad) Tseytkin
; you need to use the table name. "if > you don't specify a left" -> omit the table name > > Do you have an occasion where sometimes different rows in the same grid > require you to specify the field differently? > > -Jim > > On Wednesday, October 7

Re: [web2py] Re: Db fields in the "links" of the grid

2020-10-07 Thread Eliezer (Vlad) Tseytkin
eil wrote: > I think that is a result of having a left join specified. With the left > join you now have to specify which table the field is in as well. > > Or, am I missing something? > > -Jim > > On Wed, Oct 7, 2020 at 9:13 PM Eliezer (Vlad) Tseytkin < > westgate6...

Re: [web2py] Re: Db fields in the "links" of the grid

2020-10-07 Thread Eliezer (Vlad) Tseytkin
you need even if it isn't included in the grid > fields. > > Not sure that completely addresses your concern, but if you run through > those ideas it might help you onto a solution. > > -Jim > > > On Wednesday, October 7, 2020 at 1:44:41 PM UTC-5, Vlad wrote: >> >&

[web2py] Db fields in the "links" of the grid

2020-10-07 Thread Vlad
Seems to me this is an inconsistency in the way how grid operates (which breaks it, as I show below, but, of course, most probably I am just missing something.) The following code crashes: query = db.cart fields = [db.cart.id] links = [dict(header='View', body=lambda row: str(*row.

[web2py] formatting a field in SQLTABLE

2020-08-23 Thread Vlad
I've got the rows to be displayed in a table: rows = db(query).select(db.orders.total.sum().with_alias('Total'), ...) and using SQLTABLE(rows) to show the data. How can I format this total.sum() in the SQLTABLE? More specifically, this total is the total amount

[web2py] Re: Nested menu item

2020-08-18 Thread Vlad
Our network > Networks we joined > > > > > > > Do you have any idea how to solve this issue? > > Kind regards, > > Annet > > Op vrijdag 17 juli 2020 om 16:33:16 UTC+2 schreef Vlad: > >> Missing s

[web2py] Re: modules: NameError("name 'reload' is not defined",)

2020-08-16 Thread Vlad
same error, though with a lot more than 3 lines On Wednesday, June 24, 2020 at 5:36:36 AM UTC-5 serge.bo...@gmail.com wrote: > > I have an issue saving my modues with the last version of web2py. > Is there something I do wrong? > > Context: Ubuntu 18.04 / web2py version 2.20.4 / python 3.6.9 > >

[web2py] Form input for date does not start the calendar date picker

2020-08-02 Thread Vlad
Ok so I have this *non-SQLFORM* form form = FORM(TABLE(TR(XML('Please enter/select below '),XML(' ')), TR(XML('Created'),INPUT(_name='skillcreated', _value=skillsdict['created']), _type="text", ), TR(XML(' '),XML(' ')), TR(INPUT(_type='submit',_value="SUBMIT"),XML(' ' I have tr

Re: [web2py] Nested menu item

2020-07-17 Thread Eliezer (Vlad) Tseytkin
Oops! Got it, thank you On Fri, Jul 17, 2020 at 11:03 AM AGRogers wrote: > I don't think bootstrap (which is what web2py utilises I think) allows for > the second nested level. So to do it you would need to implement your own > custom menu structure. > > On Sat, 18 Jul

[web2py] Nested menu item

2020-07-17 Thread Vlad
Missing something basic, but seems to me that the following code should result in nested menu: response.menu = [['One', False, 'link1', [ ['Two', False, None, ['Three', False, 'link3'] ] ]

Re: [web2py] Re: belongs to one table but not the other ...

2020-07-15 Thread Eliezer (Vlad) Tseytkin
azy#Logical-operators > > On Wednesday, 15 July 2020 13:12:53 UTC+10, Vlad wrote: >> >> I have the following select to get the ids that are in one table, also >> belonging to another table: >> >> db(db.cart.id.belongs(another_table_select)).select(db.cart.id) >&

[web2py] belongs to one table but not the other ...

2020-07-14 Thread Vlad
I have the following select to get the ids that are in one table, also belonging to another table: db(db.cart.id.belongs(another_table_select)).select(db.cart.id) I can't figure out how to do just the opposite - to get the ids that do NOT belong to the other table, i.e. exist in one table but n

Re: [web2py] count() as a field in sqlform.grid

2020-07-14 Thread Vlad
Perfect solution for me; somehow didn't think about it - Thank you! On Tuesday, July 14, 2020 at 2:51:59 AM UTC-4, AGRogers wrote: > > Can you add a virtual field to the Cart table to do the counting for you? > > On Tue, 14 Jul 2020, 4:34 pm Vlad, > > wrote: > >

[web2py] count() as a field in sqlform.grid

2020-07-13 Thread Vlad
The following doesn't work: fields = [db.cart.id, db.cart.id.count()] grid = SQLFORM.grid(db.cart, fields=fields, left = [db.cart_content.on(db.cart.id==db. cart_content.cart)], groupby=db.cart.id) what's the best

Re: [web2py] Re: I broke something

2020-05-24 Thread Vlad
I am having the exact same problem, removing session data did not help. 2.20.4-stable+timestamp.2020.05.03.05.18.50 (Running on Rocket 1.2.6, Python 3.7.2) I downloaded the latest web2py source, the app I am running was originally in python2.7, however. Are there any alternatives other than goi

[web2py] customizing grid (color)

2020-04-27 Thread Vlad
Is there a way to customize colors in the w2p grid similar to bootstrap idea, for example something like .table_dark in bootstrap? I tried this: > .w2p_odd { >background-color: brown; >color:white; > } > .w2p_even { >background-color: black; >color:white; > } > and it gives

Re: [web2py] Re: grid reloading the page on grid actions (and keeping the page's arguments)

2020-04-24 Thread Eliezer (Vlad) Tseytkin
; > # now I use search text to build the query I'm going to pass to > SQLFORM.grid > > # store the current value of the variables back to your session > session.search_values = dict(search_text=search_text) > > Not pretty, but it works for my use case. > > -Jim > &g

Re: [web2py] Re: grid reloading the page on grid actions (and keeping the page's arguments)

2020-04-24 Thread Eliezer (Vlad) Tseytkin
; -Jim > > On Friday, April 24, 2020 at 11:33:47 AM UTC-5, Vlad wrote: >> >> I've got a page with a grid on it. >> grid reloads the page on create and other actions. >> the page to begin with has arguments, for example, page/1/2/3. >> I want the grid to keep the

[web2py] grid reloading the page on grid actions (and keeping the page's arguments)

2020-04-24 Thread Vlad
I've got a page with a grid on it. grid reloads the page on create and other actions. the page to begin with has arguments, for example, page/1/2/3. I want the grid to keep these 1/2/3 in place when reloading the page on those actions, for example, on new record it should use page/1/2/3/new in

Re: [web2py] Re: reg expression use in web2py/dal?

2020-03-31 Thread Eliezer (Vlad) Tseytkin
I mean, I understand how to use regexp for a simple pattern matching, but here I need to use the "sub" feature. What am I missing? On Tue, Mar 31, 2020, 6:38 AM Eliezer (Vlad) Tseytkin < westgate6...@gmail.com> wrote: > Is there any example / doc on how to use regexp? It&

Re: [web2py] Re: reg expression use in web2py/dal?

2020-03-31 Thread Eliezer (Vlad) Tseytkin
Is there any example / doc on how to use regexp? It's just mentioned in the book, but no details and no samples. On Tue, Mar 31, 2020, 3:35 AM Val K wrote: > re.sub() is invoked at python level not at db level. You should use > db.field.regexp(pattern) > > -- > Resources: > - http://web2py.com

[web2py] Re: reg expression use in web2py/dal?

2020-03-30 Thread Vlad
March 30, 2020 at 11:09:07 AM UTC-4, Vlad wrote: > > I've got the following condition for the left join: > > left=db.auth_user.on(db.sms.sender==db.auth_user.phone) > > the problem is that sms.sender is in a format like 12345678901 while > auth_user.phone can be so

[web2py] reg expression use in web2py/dal?

2020-03-30 Thread Vlad
I've got the following condition for the left join: left=db.auth_user.on(db.sms.sender==db.auth_user.phone) the problem is that sms.sender is in a format like 12345678901 while auth_user.phone can be something like (234)567-8901. Doesn't have to be in any specific format, but I need to remove

Re: [web2py] Re: Looking for web2py developer for Italian small company

2020-02-12 Thread Vlad
I've used web2py happily until today, but seems need to switch to py4web :) I've never looked into py4web; just saw msgs going back and forth about it. What's the best way to start? Any tutorials? Is there a book similar to the one on web2py? What's the home page (assuming it's separate from we

[web2py] confirm on form submit

2019-12-03 Thread Vlad
The view has the following link: {{=A('Refunded', callback=URL('refund', target='REFUND')}} > The function 'refund' returns the form, and the idea is that this form can change from the initial form to a confirmation form: def refund(): > > form=FORM('Refund:', > INPUT(

[web2py] Pydal validate issue 2.15.4

2019-10-30 Thread Vlad Doster
Hi all, I am currently trying to get a dev environment up and running. I try to login and the pydal/object.py complains about __call__() taking 3 arguments but expecting exactly 2. Is this a web2py issue or Python versioning issue? Traceback (most recent call last): File "/home/vlad/V

[web2py] Re: auth_membership grid with both, group id and group roles displayed when adding a new record

2019-10-07 Thread Vlad
I don't fully understand it - will play with it to figure it out. Annet's suggestion worked right away, but still I really want to understand what's going on... thank you! On Monday, October 7, 2019 at 6:38:24 AM UTC-4, villas wrote: > > By specifying requires = IS_IN_SET(ids), you are also ov

[web2py] Re: auth_membership grid with both, group id and group roles displayed when adding a new record

2019-10-07 Thread Vlad
thank you very much! works like a charm! On Monday, October 7, 2019 at 6:36:02 AM UTC-4, Annet wrote: > > Use IS_IN_DB() > >ids = [1,3,5] >> > > > db.auth_membership.group_id.requires = > IS_IN_DB(db(db.auth_group.id.belongs(ids)), 'auth_group.id', '%(role)s') > > > Best, > > Annet > -- R

[web2py] auth_membership grid with both, group id and group roles displayed when adding a new record

2019-10-06 Thread Vlad
the following line works perfectly: grid = SQLFORM.grid(db.auth_membership) by "perfect" in the context, I mean that when I click "add record", the group id field contains both values, group id and group role (for example, "Manager (4)", "Loyal customer (9)", ... However, I want to limit wha

Re: [web2py] Re: customizing menu items when MENU helper is used

2019-07-31 Thread Eliezer (Vlad) Tseytkin
another helper and take class, style, and are fully configurable one at a time)... On Wed, Jul 31, 2019, 2:48 AM Dave S wrote: > > > On Tuesday, July 30, 2019 at 3:09:24 PM UTC-7, Vlad wrote: >> >> what would be the best way to specify a background color (different for

[web2py] customizing menu items when MENU helper is used

2019-07-30 Thread Vlad
what would be the best way to specify a background color (different for each menu item, depending on some database-driven data) when I build the menu with menu.append(...) in menu.py? I would love to have something like this: menu.append([description, False, URL('catalog','regimen',args=[id]

Re: [web2py] Using db.table.format (i.e. format attr outside of table definition)

2019-07-09 Thread Eliezer (Vlad) Tseytkin
Oh, I see, here is what's happening: I now have the following code: db.product._format = lambda row: 'test' grid = SQLFORM.grid(db.flavor) The table flavor has a column referencing the table product. So, the grid displays the product column correctly now (with _format - this is where just

Re: [web2py] Using db.table.format (i.e. format attr outside of table definition)

2019-07-08 Thread Eliezer (Vlad) Tseytkin
Nope, still doesn't work... On Mon, Jul 8, 2019, 1:20 PM Val K wrote: > Try db.table._format=... > > -- > 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)

[web2py] Using db.table.format (i.e. format attr outside of table definition)

2019-07-07 Thread Vlad
Please help! Any way to use this format property outside of a table definition? -- 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

[web2py] Using db.table.format (i.e. format attr outside of table definition)

2019-07-03 Thread Vlad
Using the following db.table.format = lambda row: 'test' before SQLFORM.grid creation doesn't seem to work. What's the proper way to set record representation outside of table definition? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web

Re: [web2py] specifying an id of an ajax component (LOAD)

2019-07-01 Thread Eliezer (Vlad) Tseytkin
Got it, Works like a charm, Thank you! On Mon, Jul 1, 2019, 11:10 AM Massimiliano wrote: > > http://web2py.com/books/default/chapter/29/12/components-and-plugins#LOAD-signature > > you need to define *target *not *id* > > On Sun, Jun 30, 2019 at 5:12 PM Vlad wrote: > &

[web2py] specifying an id of an ajax component (LOAD)

2019-06-30 Thread Vlad
I am using the LOAD helper in the view: {{=LOAD(c='customer',f='testimonials',extension='load',ajax=True,ajax_trap=True,content='loading testimonials...',*_id='TESTIMONIALS_HERE'*)}} The id (_id) is specified explicitly. However, it ignores the id parameter and produces the following: load

[web2py] redirecting domain

2019-06-20 Thread Vlad
what's the most efficient way to redirect domain to another domain entirely on a level of web2py? -- 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 re

Re: [web2py] Re: form's field having special characters transmitted via request.post_vars

2019-06-20 Thread Eliezer (Vlad) Tseytkin
here... > > Eureka! there is json! > safe_js_str = json.dumps(string_with_any_bad_char) > > now you can insert it in js code as > 'var s = %s' % safe_js_str # it is already quoted > > > > On Thursday, June 20, 2019 at 9:54:43 PM UTC+3, Vlad wrote: >> >>

Re: [web2py] Re: form's field having special characters transmitted via request.post_vars

2019-06-20 Thread Eliezer (Vlad) Tseytkin
t; > On Thursday, June 20, 2019 at 8:32:08 PM UTC+3, Vlad wrote: >> >> I have a form with an input text field. >> >> The form is submitted via POST. >> >> The vars value is read and passed over into response.js to run some >> action. >> >>

Re: [web2py] Re: emailing the content of the current page

2019-06-20 Thread Eliezer (Vlad) Tseytkin
logic: >> def foo(): >> ... >> ret = dict(...) >> if email_required: >> html = response.render(ret) >> ... # send html by email >> return html >> return ret >> >> >> >> On Thursday, June

Re: [web2py] Re: emailing the content of the current page

2019-06-20 Thread Eliezer (Vlad) Tseytkin
# send html by email > return html > return ret > > > > On Thursday, June 20, 2019 at 8:26:33 PM UTC+3, Vlad wrote: >> >> I couldn't figure out how this woks, so just rendered it again. Not a big >> deal - just a matter of convenience. The email req

[web2py] form's field having special characters transmitted via request.post_vars

2019-06-20 Thread Vlad
I have a form with an input text field. The form is submitted via POST. The vars value is read and passed over into response.js to run some action. All works perfect until that field has special characters, like " and the like. Javascript does't like it. It doesn't see that as a string, but

[web2py] Re: emailing the content of the current page

2019-06-20 Thread Vlad
I couldn't figure out how this woks, so just rendered it again. Not a big deal - just a matter of convenience. The email requests come occasionally, so this extra render doesn't cause trouble. Thank you, Val! On Thursday, June 20, 2019 at 6:23:55 AM UTC-4, Val K wrote: > > I think you can try

[web2py] emailing the content of the current page

2019-06-19 Thread Vlad
I'd like to send an email with html content - the current page: mail.send('y...@example.com', 'Message subject', 'html body') How do I make the html body available in python code? (i.e. how do I pass it from the view to the python code?) to get it in js easy - document.documentElement.outerHTML

[web2py] Re: sqlform grid to show a field entirely, without cutting off the text

2019-06-18 Thread Vlad
works like a charm!! thank you Annet!!! thank you Anthony!!! On Tuesday, June 18, 2019 at 3:11:08 PM UTC-4, Annet wrote: > > I think Anthony answered this question in this post: > > https://groups.google.com/forum/?fromgroups=#!topic/web2py/okMVqyQPKV8 > > hope he did ;-) > > > Regards, > > Ann

Re: [web2py] Re: orderby=['alias'] - works in sqlite, but not in postgres

2019-06-18 Thread Eliezer (Vlad) Tseytkin
Got it, Thank you very much On Tue, Jun 18, 2019, 1:53 PM Anthony wrote: > On Tuesday, June 18, 2019 at 11:04:16 AM UTC-4, Vlad wrote: >> >> Anthony, it works like a charm, thank you very much!! >> >> (Val's solution with also worked great, but it felt awkward t

[web2py] sqlform grid to show a field entirely, without cutting off the text

2019-06-18 Thread Vlad
Is there an easy way to force the SQLFORM grid to show one specific column entirely, without cutting it off, even if the row would have to be extended vertically, just whatever it takes to see the full text content? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - h

[web2py] Re: orderby=['alias'] - works in sqlite, but not in postgres

2019-06-18 Thread Vlad
l throw an error. In any case, in > SQL, "DESC" is used to indicate descending order ("ASC" for ascending). > > So, you can do: > > orderby='shares DESC' > > Anthony > > On Monday, June 17, 2019 at 11:48:51 PM UTC-4, V

Re: [web2py] Re: intercepting login & logout events

2019-06-18 Thread Eliezer (Vlad) Tseytkin
This is perfect, I missed it, Thank you!! On Tue, Jun 18, 2019, 2:25 AM 'Annet' via web2py-users < web2py@googlegroups.com> wrote: > Web2py has auth.settings I used them to solve your problem > > > auth.settings.login_onaccept = lambda form: __on_login() > auth.settings.logout_onlogout = lambda u

Re: [web2py] orderby=['alias'] - works in sqlite, but not in postgres

2019-06-17 Thread Eliezer (Vlad) Tseytkin
Thank you! On Tue, Jun 18, 2019, 1:19 AM Val K wrote: > Try [~db.cart_sharing.stats.sum()] > > -- > 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) > ---

[web2py] orderby=['alias'] - works in sqlite, but not in postgres

2019-06-17 Thread Vlad
This works perfect in SQLite: rows = db(query).select(db.cart_sharing.created_by.with_alias('sharer'), db.cart_sharing.stats.count().with_alias('carts' ), db.cart_sharing.stats.sum().with_alias('shares'), groupby=d

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Vlad
thank you ! On Monday, June 17, 2019 at 11:02:13 AM UTC-4, Yoel Benitez Fonseca wrote: > > Vlad, in the book: > > > http://www.web2py.com/books/default/chapter/29/04/the-core#HTTP-and-redirect > > And i can comment out +/- the code: > > def user(): > > #

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Vlad
to auth() will cause a redirect > (HTTP exception) and the user is effectively logged into the system. > > The same goes for the logout, but there is not a form in the middle. > > El lun., 17 jun. 2019 a las 9:57, Vlad (>) > escribió: > >> but isn't such a scenario

Re: [web2py] intercepting login & logout events

2019-06-17 Thread Vlad
nt_here() > > return dict(form=form) > > > > El lun., 17 jun. 2019 a las 9:19, Vlad (>) > escribió: > >> What would be the simplest way to intercept login and logout? >> (i.e. I'd like to perform some additional tasks when a user is logged in,

[web2py] intercepting login & logout events

2019-06-17 Thread Vlad
What would be the simplest way to intercept login and logout? (i.e. I'd like to perform some additional tasks when a user is logged in, and when a user is logged out.) web2py elegantly hides the functionality in default.user under form=auth() and {{=form}} and somehow I can't think of a simple w

Re: [web2py] switching to postgres [RuntimeError: No driver of supported ones ('psycopg2',) is available]

2019-06-16 Thread Vlad
Yes, it was a typo. There were quite a few things that went wrong and I missed this one even after looking at it dozens of times, checking each character... It's perfect now. Thank you very much -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web

[web2py] Re: please help: sycopg2.OperationalError: FATAL: password authentication failed for user "test"

2019-06-16 Thread Vlad
line 118, in connector return self.driver.connect(**self.driver_args) File "/home/vladtseytkin/.local/lib/python3.7/site-packages/psycopg2/__init__.py", line 126, in connect conn = _connect(dsn, connection_factory=connection_factory, **kwasync) psycopg2.OperationalError: FATAL:

[web2py] please help: sycopg2.OperationalError: FATAL: password authentication failed for user "test"

2019-06-16 Thread Vlad
I'm bringing this from another post, because I've narrowed down the problem considerably, and it no longer corresponds neither to the headline nor to the content of that post. the following works fine, creating a valid connection: connection = psycopg2.connect(database="test_db", user="test",

Re: [web2py] switching to postgres [RuntimeError: No driver of supported ones ('psycopg2',) is available]

2019-06-16 Thread Vlad
pointers to the db direction. I am at loss on how to handle this gracefully. SQLite has served perfect up until now, when I have to get to a real db... On Sunday, June 16, 2019 at 10:41:22 AM UTC-4, Vlad wrote: > > Okay, I recreated it in a simplest form, to get rid of any extra >

Re: [web2py] switching to postgres [RuntimeError: No driver of supported ones ('psycopg2',) is available]

2019-06-16 Thread Vlad
t; *So psycopg2 at this point is present and found by Python *(not even sure what was the problem before, when it couldn't be found on windows), but *on windows connection fails, while on linux password authentication fails*. Greatly appreciate any ideas. On Sunday, June 16, 2019 at 7:54:2

Re: [web2py] switching to postgres [RuntimeError: No driver of supported ones ('psycopg2',) is available]

2019-06-16 Thread Eliezer (Vlad) Tseytkin
On this one I run web2py on Windows. Using web2py from source. No idea what virtualenv is, so presumably not using it. Installed psycopg2 with pip3 specifically, to make sure it goes into the right Python. (I am not too familiar with this, but anything I install with pip goes to Python 2, and pip3

[web2py] making a secure db connection on top of already existing SSL for the site

2019-06-15 Thread Vlad
Here is a quote from the web2py docs: "Making a secure connection Sometimes it is necessary (and advised) to connect to your database using secure connection, especially if your database is not on the same server as your application. In this case you need to pass additional parameters to the d

[web2py] switching to postgres [RuntimeError: No driver of supported ones ('psycopg2',) is available]

2019-06-15 Thread Vlad
I am getting the following error: RuntimeError: No driver of supported ones ('psycopg2',) is available I used "pip3 install psycopg2" and pip now reports that psycopg2 is installed. What am I still missing? What's the best (quickest, easiest, and hassle-free) way to use postgres from web2py?

Re: [web2py] Re: 2 domains for 2 apps on 1 web2p

2019-06-14 Thread Eliezer (Vlad) Tseytkin
ain2.com': 'app2'})) > > > > -Jim > > > On Friday, June 14, 2019 at 1:47:22 PM UTC-5, Vlad wrote: >> >> let me be a bit more specific, as my problem is apparently in missing >> something very basic: >> >> here is a quote from PythonA

[web2py] Re: 2 domains for 2 apps on 1 web2p

2019-06-14 Thread Vlad
he root www.domain2.com will still be redirecting to /app1/cont1/func1, as per the only "/" entry in routes.py, as "/" doesn't distinguish between domains. What am I missing? How can I handle this properly?? On Friday, June 14, 2019 at 2:23:21 PM UTC-4, Vlad wrote: &g

[web2py] 2 domains for 2 apps on 1 web2p

2019-06-14 Thread Vlad
I've had multiple apps in one web2py with no problems, of course, but only up to the point I've assigned different domains to different apps I am on PythonAnywhere, but presumably it's the same issue on any hosting. I am giving 2 cnames for 2 apps, and I pointed both cnames properly. BUT only

[web2py] Re: managing users with no email

2019-06-11 Thread Vlad
- db(auth_user.phone == > form.vars.phone).select(auth_user.email) > + and you can login user using auth.login_bare(email, password) > > On Tuesday, June 11, 2019 at 9:41:40 PM UTC+3, Vlad wrote: >> >> seems to me that the ideal solution would be to allow an email field in >>

[web2py] Re: managing users with no email

2019-06-11 Thread Vlad
easy way to achieve this... On Tuesday, June 11, 2019 at 2:37:23 PM UTC-4, Vlad wrote: > > Trying to figure out how to manage the following: > > some users will manage themselves. this means that they have email and > they log into the system and do whatever they want. >

[web2py] managing users with no email

2019-06-11 Thread Vlad
Trying to figure out how to manage the following: some users will manage themselves. this means that they have email and they log into the system and do whatever they want. other users don't use email (and generally aren't online altogether). so I want an admin to manage them, i.e. they would

[web2py] Hiding grid's columns (SQLFORM.grid) for smaller screen sizes

2019-06-11 Thread Vlad
how would I hide certain fields of the grid generated by SQLFORM.grid() depending on a screen size? normally I would use media breakpoints, but I am not sure how to manage it with SQLFORM.grid, as grid doesn't seem to expose any widgets explicitly... -- Resources: - http://web2py.com - http:/

  1   2   3   >