[web2py] Re: web2py internal error

2018-07-17 Thread Peter Hendriks
I can go in to the admin by typing https://www.maltaa-advies.nl/admin

then I get the login screen for admin.

Op dinsdag 17 juli 2018 00:12:29 UTC+2 schreef Dave S:
>
>
>
> On Monday, July 16, 2018 at 12:18:44 PM UTC-7, Peter Hendriks wrote:
>>
>> Ticket issued: 
>> malta_advies/141.8.9.39.2018-07-16.13-01-34.2270ef94-db9a-47a5-8866-f081bdf9715f
>>  
>> 
>>
>> Since this morning the above I see when I type my website.
>>
>> for info : my website is https://www.malta-advies.nl
>>
>> With admin I can go into the admin, but not further then that. After that 
>> clicking any link again the same ticket ... .
>>
>> Anyone experience with this one?
>>
>
> Does "clicking any link again the same ticket" mean that you get a ticket 
> from any link the *admin* app displays?That's my first thought about 
> what "not further than that" means.  That usually means a problem with some 
> resource the admin app depends on.  Sometimes it means you're out of space, 
> though creating a ticket does require space so the error handler usually 
> ends up with a message about "ticket unavailable".
>
> Do you have console access to your host?  If so, you can read the error 
> ticket as a text file, although the formatting will be horrible.
>
> /dps
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: web2py internal error

2018-07-17 Thread Peter Hendriks
When web2py generates an error like that, the ticket that it links to 
contains details of what is causing the error. That ticket is also written 
to disk somewhere. You can check the web2py documentation for where the 
ticket is stored so you can look at it to determiner what is wrong.

Thanks
Glenn

the answer above I have got from pythonanywhere. my hosting is overthere.


Op dinsdag 17 juli 2018 00:18:34 UTC+2 schreef Anthony:
>
> On Monday, July 16, 2018 at 3:18:44 PM UTC-4, Peter Hendriks wrote:
>>
>> Ticket issued: 
>> malta_advies/141.8.9.39.2018-07-16.13-01-34.2270ef94-db9a-47a5-8866-f081bdf9715f
>>  
>> 
>>
>> Since this morning the above I see when I type my website.
>>
>> for info : my website is https://www.malta-advies.nl
>>
>> With admin I can go into the admin, but not further then that. After that 
>> clicking any link again the same ticket ... .
>>
>> Anyone experience with this one?
>>
>
> When you click on the ticket link and then log into the admin app, what 
> happens next? You can copy on of the error ticket files from your server 
> (in the /errors folder) to a development machine and view it in admin on 
> the development machine.
>
> 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: row.update_record() leaves row as None (only sometimes)

2018-07-17 Thread Lisandro
I don't think the code for update_tsv() is related, because the traceback 
shows that the error is produced even before looking for that method. I 
mean, the error says that the "row" object is None, therefor I think it 
would throw error calling any method. 
But anyway, in case it helps to figure out what is going on, this is the 
code for update_tsv():

def update_tsv(row):
db = current.db
title = detail = ''
if row.title:
 title = row.title.replace("'", "")
if row.detail:
detail = row.detail.replace("'", "")
db.executesql(
 """UPDATE content SET tsv = (SELECT
 setweight(to_tsvector(coalesce(%s, '')), 'A') ||
 setweight(to_tsvector(coalesce(%s, '')), 'B')) WHERE id = %s;""",
 placeholders=[title, detail, row.id])
 return True



El jueves, 12 de julio de 2018, 20:52:38 (UTC-3), Leonel Câmara escribió:
>
> Can I see the code for update_tsv the bug is clearly there?
>

-- 
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: row.update_record() leaves row as None (only sometimes)

2018-07-17 Thread Leonel Câmara
In virtual methods you should not use row compact notation. You should use 
like row.content.title instead of row.title. So the error can be there.

That said can I see the original code for the controller? Are you doing 
something like row = row.update_record(**data)?

-- 
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: row.update_record() leaves row as None (only sometimes)

2018-07-17 Thread Malta Advies
Hello Leonel,

I see you gave information to me about my eventually error code and also
maybe how to solve this.

I have to inform you that I'm not a developer despite. I try to get my site
back on track. For this moment I do not have any help in my neighborhood.

Sure you can see / have the controller code. Just inform me what part of
controller and I send to you in wordpad.

thnx
peter

2018-07-17 14:07 GMT+02:00 Leonel Câmara :

> In virtual methods you should not use row compact notation. You should use
> like row.content.title instead of row.title. So the error can be there.
>
> That said can I see the original code for the controller? Are you doing
> something like row = row.update_record(**data)?
>
> --
> 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.
>



-- 
Best regards,


Peter Hendriks
Manager
*Travel Agency Malta Advies*


*00356 7900 9344*

-- 
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: row.update_record() leaves row as None (only sometimes)

2018-07-17 Thread Leonel Câmara
Hey Peter, 

I was trying to help Lisandro, I'm not sure what error you're getting. I've 
seen in other thread that you're getting a ticket error but without looking 
at the ticket and your code I can't guess what's wrong.

-- 
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] Bot sends bad POST and triggers ValueError: Invalid boundary in multipart form: ''

2018-07-17 Thread Lisandro
Hi there! I'm just reporting this situation in case it's a bug, I'm not 
sure.

I have a public webpage (no login required), and from time to time I see 
this error: 
ValueError: Invalid boundary in multipart form: ''

The error is produced by a bot that sends a bad POST to an URL that doesn't 
even expect a POST (it's just a public URL that shows a list of news, and 
it is cached). 
But as my application access request.vars, when the bot sends that POST, I 
see this error traceback:

Traceback (most recent call last):
  File "/var/www/medios/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
  File "applications/informatesalta/compiled/controllers.default.index.py", 
line 4, in 
  File "applications/informatesalta/modules/globales.py", line 2108, in 
get_publicidades_response
layout = request.vars.layout or ''
  File "/var/www/medios/gluon/globals.py", line 314, in vars
self.parse_all_vars()
  File "/var/www/medios/gluon/globals.py", line 285, in parse_all_vars
for key, value in iteritems(self.post_vars):
  File "/var/www/medios/gluon/globals.py", line 306, in post_vars
self.parse_post_vars()
  File "/var/www/medios/gluon/globals.py", line 242, in parse_post_vars
dpost = cgi.FieldStorage(fp=body, environ=env, keep_blank_values=1)
  File "/usr/lib64/python2.7/cgi.py", line 507, in __init__
self.read_multi(environ, keep_blank_values, strict_parsing)
  File "/usr/lib64/python2.7/cgi.py", line 621, in read_multi
raise ValueError, 'Invalid boundary in multipart form: %r' % (ib,)
ValueError: Invalid boundary in multipart form: ''



Notice the error is triggered in gluon/globals.py, specifically in 
"parse_all_vars" function.
What can I do in order to avoid the ticket error?

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


[web2py] Re: Why not to mention support to Python3 on the official sites main page?

2018-07-17 Thread Marcelo Huerta
El lunes, 16 de julio de 2018, 9:55:01 (UTC-3), Ari Lion BR Sp escribió:
>
> Hi,
>
> I wonder here why Python3 support is not mentioned at the official 
> web2py's website?
>
>
I also wonder this. I think it might be because web2py hasn't been 100% in 
Python3?

This is one of the issues which prevents further visibility of the 
framework (other that I think is also important is that the demo site 
doesn't work; if this could be made to work, preferable on Python 3, it 
would be very useful).

-- 
Marcelo 

-- 
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: Why not to mention support to Python3 on the official sites main page?

2018-07-17 Thread Ari Sobel
I have been using *web2py *on *Python3 *for almost a *year*, with *no
apparent issues.*

My script to install it with nginx (adaptation from original - please fork
and contribute):
https://github.com/arisobel/web2py_scripts/blob/master/setup-web2py-nginx-p3-uwsgi-ubuntu.sh

Ask everyone to try it. web2py  can grow a lot witrh this visibility.


thanks for all guys working for this wonderful framework.


*Ari - Brazil*
https://t.me/web2pybrasil

Em ter, 17 de jul de 2018 às 12:21, Marcelo Huerta 
escreveu:

> El lunes, 16 de julio de 2018, 9:55:01 (UTC-3), Ari Lion BR Sp escribió:
>>
>> Hi,
>>
>> I wonder here why Python3 support is not mentioned at the official
>> web2py's website?
>>
>>
> I also wonder this. I think it might be because web2py hasn't been 100% in
> Python3?
>
> This is one of the issues which prevents further visibility of the
> framework (other that I think is also important is that the demo site
> doesn't work; if this could be made to work, preferable on Python 3, it
> would be very useful).
>
> --
> Marcelo
>
> --
> 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/6stn2HcZEG0/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] Re: Why not to mention support to Python3 on the official sites main page?

2018-07-17 Thread Anthony
It is mentioned here , but should be 
updated here  and in the first 
three chapters of the book. Note, these updates can be made via pull 
requests to https://github.com/web2py/web2py (for the website, which is the 
"examples" app in the Github repo) 
and https://github.com/web2py/web2py-book (for the book -- there are 
mentions of Python 2.7 in each of the first three chapters).

Anthony

On Monday, July 16, 2018 at 8:55:01 AM UTC-4, Ari Lion BR Sp wrote:
>
> Hi,
>
> I wonder here why Python3 support is not mentioned at the official 
> web2py's website?
>
> It is a very important feature which was not enough publicized, in my 
> opinion.
> It would improove marketing for the framework at least at our Country, 
> Brazil.
> Peoples colective memory here tends to remeber web2py only suports python2.
>
>
> Thanks,
> Ari
>

-- 
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: Why not to mention support to Python3 on the official sites main page?

2018-07-17 Thread Ari Lion BR Sp
Thanks Marcelo Huerta  / Anthony.

Do you have tested python3?

I can testify that perfomance improoves a lot. Whats lacking for official 
support announcement?
Is there a list of issues for use under Python3?

Thanks again,
*Ari - Brazil*
https://t.me/web2pybrasil (Brazillian Telegram Group)


Em terça-feira, 17 de julho de 2018 13:14:35 UTC-3, Anthony escreveu:
>
> It is mentioned here , but should be 
> updated here  and in the first 
> three chapters of the book. Note, these updates can be made via pull 
> requests to https://github.com/web2py/web2py (for the website, which is 
> the "examples" app in the Github repo) and 
> https://github.com/web2py/web2py-book (for the book -- there are mentions 
> of Python 2.7 in each of the first three chapters).
>
> Anthony
>
> On Monday, July 16, 2018 at 8:55:01 AM UTC-4, Ari Lion BR Sp wrote:
>>
>> Hi,
>>
>> I wonder here why Python3 support is not mentioned at the official 
>> web2py's website?
>>
>> It is a very important feature which was not enough publicized, in my 
>> opinion.
>> It would improove marketing for the framework at least at our Country, 
>> Brazil.
>> Peoples colective memory here tends to remeber web2py only suports 
>> python2.
>>
>>
>> Thanks,
>> Ari
>>
>

-- 
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: Why not to mention support to Python3 on the official sites main page?

2018-07-17 Thread Marcelo Huerta
El mar., 17 jul. 2018 a las 13:54, Ari Lion BR Sp ()
escribió:

> Thanks Marcelo Huerta  / Anthony.
>
> Do you have tested python3?
>

​I don't have the infrastructure to perform testing best performed by the
development team...​


>
> I can testify that perfomance improoves a lot. Whats lacking for official
> support announcement?
>

​Prominent mention in all documentation and ​a working test site would be
nice. There are several podcasts and web sites which could be happily
informed about web2py if those things were updated and working...


> Is there a list of issues for use under Python3?
>

​I would like to know this too.

-- 
   o-=< Marcelo >=-o

-- 
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: row.update_record() leaves row as None (only sometimes)

2018-07-17 Thread Leonel Câmara
I have to say I'm completely stumped. I don't see how this is even 
possible. Are you sure Line 301 is really the line after update_record?

-- 
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: row.update_record() leaves row as None (only sometimes)

2018-07-17 Thread Dave S


On Tuesday, July 17, 2018 at 4:50:02 PM UTC-7, Leonel Câmara wrote:
>
> I have to say I'm completely stumped. I don't see how this is even 
> possible. Are you sure Line 301 is really the line after update_record?
>

That should be verifiable with the full ticket, not just the stack trace.
The ticket should have a code clip  to show the context of the line; 
the usual frame expansions are code, arguments, and variables. 

/dps "Captain Obvious"


-- 
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] OperationalError when using datetime

2018-07-17 Thread Maurice Waka
I have two problems;

   1. When I successfully submit a form and try to retrieve the text for 
   processing in the controller, I tend to get the previously submitted text 
   and not the latest. I tried to get the latest database insert based on the 
   current time using this code but get the operational error. I want to check 
   the current time in order to retrieve the latest inserted text.

controller code:

def retrieve():
dt=request.now
row = db(db.post.author== auth.user.id).select(db.post.ALL, orderby=~db.
post.created_on == dt, limitby=(0,1)).first()
message = row.message if row else None
return dict(message=message, form=form)


Error message
row = db(db.post.author== auth.user.id).select(db.post.ALL, orderby=~db.
post.created_on == dt, limitby=(0,1)).first() File 
"/usr/local/lib/python2.7/dist-packages/pydal/objects.py", line 2250, in 
select
 return adapter.select(self.query, fields, attributes)
 File "/usr/local/lib/python2.7/dist-packages/pydal/adapters/sqlite.py", 
line 82, in select
 return super(SQLite, self).select(query, fields, attributes)
 File "/usr/local/lib/python2.7/dist-packages/pydal/adapters/base.py", line 
762, in select
 return self._select_aux(sql, fields, attributes, colnames)
 File "/usr/local/lib/python2.7/dist-packages/pydal/adapters/base.py", line 
718, in _select_aux
 rows = self._select_aux_execute(sql)
 File "/usr/local/lib/python2.7/dist-packages/pydal/adapters/base.py", line 
712, in _select_aux_execute
 self.execute(sql)
 File "/usr/local/lib/python2.7/dist-packages/pydal/adapters/__init__.py", 
line 67, in wrap
 return f(*args, **kwargs)
 File "/usr/local/lib/python2.7/dist-packages/pydal/adapters/base.py", line 
412, in execute
 rv = self.cursor.execute(command, *args[1:], **kwargs)
OperationalError: near "DESC": syntax error



Problem/query: 
Is there a way to have a trigger in the db, that when there is an insert, 
the db updates to the controller the current text? something like:

CREATE TRIGGER your_table_trig AFTER UPDATE ON your_table BEGIN update 
your_table SET updated_on = datetime('now') WHERE user_id = NEW.user_id; END;

-- 
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: OperationalError when using datetime

2018-07-17 Thread 黄祥
orderby should be table's field not a conditional comparison
ref:
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#orderby--groupby--limitby--distinct--having-orderby_on_limitby-left-cache

for 2nd question: web2py auth.signature will cover to update value of field 
modified_on when user update the table, for any specific table's field 
perhaps you can use before or after callback 
ref:
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#callbacks-on-record-insert--delete-and-update

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.