I just tested this with a simple app using postgresql database and it seems
that it doesn't quite work.
It appears it will leave the string data that exists in the string field
alone in the database, however web2py will interpret it such that the first
and last character are truncated. For
I found that Python uses sth like that:
import subprocesssubprocess.call(['./scriptshell.sh'])
Looks fine. I must try it. Thanks a lot
Regards
Adam
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
Hi all,
I'd develop a web2py responsible app instead of an android app; at a first
sight it seams to some extent feasible. The only issue is related to an
unusual requirement, the web2py app (running on an intranet) must be
accessible only from well defined devices (android tablet). If needed I
Hi all,
I'm trying to set (custom) messages for both the verification email sent
for new user registration and password reset email sent for existing users.
I have found the list of available messages here:
http://www.web2py.com/book/default/chapter/09 however none of them seem to
correspond
On Tuesday, January 14, 2014 7:28:14 AM UTC-5, Alex Bush wrote:
Hi all,
I'm trying to set (custom) messages for both the verification email sent
for new user registration
Do auth.messages.verify_email and auth.messages.verify_email_subject not
work for you? Note, auth.messages.email_sent
If you want db.person to be updated upon changes to db.thing, instead of a
computed field in db.person, you probably want to create _after_insert and
_after_update callbacks for db.thing (see
For now, if you want to do a migration, all you have to do is loop through
the records and put a pipe character (|) before and after each string.
Perhaps this can be automated -- you can submit an issue on Google Code.
Anthony
On Tuesday, January 14, 2014 1:21:52 AM UTC-5, User wrote:
It
Appologies if the initial email was confusing and thank you for the reply
Anthony, I understand and am using auth.messages.verify_email and
auth.messages.verify_email_subject however I wondered if there was any way
to set a specific flash message for each situation (verification email sent
and
On Tuesday, January 14, 2014 1:18:11 AM UTC-5, User wrote:
So I tested the migration feature and string to list:string doesn't work.
So we are left with the fact that a list:string field with IS_IN_SET
multiple=False will not select the current value in an SQLFORM.
Seems kind of like a
Hello Maggs,
What you can do is to have 2 differents authentication process the internal
web2py process that will allow you to have a password as before and then
LDAP process... But you will not have password from LDAP you will have two
differents password, except if the user set the same
On Tuesday, January 14, 2014 9:56:25 AM UTC-5, Richard wrote:
Notice migrate_neabled=False as notting to do with read only, it only tell
to web2py to not migrate apply to the models in models.py. It is more of a
complement.
The point is that if two applications are accessing the database,
As I mentioned, you can change auth.messages.email_sent dynamically:
def user():
flash = dict(register='Verification email sent',
request_reset_password='Reset password email sent')
auth.messages.email_sent = flash.get(request.args(0), auth.messages.
email_sent)
Notice migrate_neabled=False as notting to do with read only, it only tell
to web2py to not migrate apply to the models in models.py. It is more of a
complement.
You may also consider to use auth permissions and set them to read and
select for every objects in your database for more sercure read
Thank you Anthony, that works beautifully!
On 14 January 2014 14:56, Anthony abasta...@gmail.com wrote:
As I mentioned, you can change auth.messages.email_sent dynamically:
def user():
flash = dict(register='Verification email sent',
request_reset_password='Reset
Some instruction about creating custom widgets at the end of this section:
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Widgets.
On Tuesday, January 14, 2014 12:33:22 AM UTC-5, Kiran Subbaraman wrote:
Yes, that works: use request.vars.*. That was the option which I had
Depending of the duration of your shell script you may face web server
timeout watchout!!
Richard
On Mon, Jan 13, 2014 at 4:33 PM, Adam Detektyw adambo...@gmail.com wrote:
I found that Python uses sth like that:
import subprocesssubprocess.call(['./scriptshell.sh'])
Looks fine. I must
Thanks good point about just modifying the db field directly to add pipe
characters if migrating from string to list:string. I think in that case I
will make my field a string field and migrate later if necessary.
On Tuesday, January 14, 2014 9:48:53 AM UTC-5, Anthony wrote:
On Tuesday,
For completeness and future reference this can also be done directly in SQL
for example in postgresql:
UPDATE your_table set some_field = '|' || some_field || '|';
On Tuesday, January 14, 2014 8:52:40 AM UTC-5, Anthony wrote:
For now, if you want to do a migration, all you have to do is loop
Anthony,
Thanks for the link; that is useful. Also, was looking at the
implementation of the default widgets in
https://github.com/web2py/web2py/blob/master/gluon/sqlhtml.py.
I think I can conclude that keepvalues does not retain values, as
detailed in this email.
Considering that I have to
Stifan, that is great info. pulling from the filesystem is much faster. I
think i'm going to go this route. Thanks!
On Monday, January 13, 2014 7:15:22 PM UTC-8, 黄祥 wrote:
please check this discussion.
https://groups.google.com/forum/#!topic/web2py/t83nQfT24gE
best regards,
stifan
keepvalues is for retaining values when there are no errors (but you want
to retain the values from the previous submission). If there are errors,
the values will be retained regardless of keepvalues. In your case, you are
not using form.custom.widget, so you're not getting the values retained.
I guess you can use something like:
request.user_agent().is_tablet and request.user_agent().dist.name ==
'Android'
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list
Thank you very much for your advise! I will keep this in mind.
On Tuesday, January 14, 2014 4:25:22 AM UTC+1, LightDot wrote:
Looking at your python version, you're running a RHEL 5 (or a derivative,
such as CentOS). Just a word of caution if you decide to attempt updating
the OS python's
Hi,
what you posted can be a starting point but it is not enough because it
doesn't guarantee that a different android tablet has been purchased.
The requirement is, only a well defined set of tablets can access the
webapp.
Paolo
2014/1/14 Leonel Câmara leonelcam...@gmail.com
I guess you can
On Tuesday, January 14, 2014 11:05:17 AM UTC-8, Paolo Valleri wrote:
Hi,
what you posted can be a starting point but it is not enough because it
doesn't guarantee that a different android tablet has been purchased.
The requirement is, only a well defined set of tablets can access the
You need to specify what is a 'well defined device'...
Even a MAC address can be spoofed.
On Tuesday, January 14, 2014 4:23:19 AM UTC-5, Paolo Valleri wrote:
Hi all,
I'd develop a web2py responsible app instead of an android app; at a first
sight it seams to some extent feasible. The only
this is an architectural problem: what does the device send to your app to
be able to identify it ?
If it's a webapp and it is accessed via the browser, and there are no
running bits on the device itself speaking to your webapp, then the headers
and the env are the only thing you can rely onto
Thanks, I came up with this:
db.thing._after_insert.append(lambda f,id:
db(db.person.id==f['owner_id']).update(total_items=len(db(db.thing.owner_id==f['owner_id']).select(
It works, but is there is a better way to do this? Also, can someone help
me with _after_delete? _after_delete gives
I am trying to make a custom form which allows the selection of a set of
images that are in the database. So far I have the following code:
rows = db().select(db.a_table.name,db.a_table.image)
fields = []
for row in rows:
fields += [
INPUT(_type=checkbox,
Hi Richard,
That is perfect and exactly what I need! Thanks so much :)
Maggs
On Tuesday, January 14, 2014 6:52:51 AM UTC-8, Richard wrote:
Hello Maggs,
What you can do is to have 2 differents authentication process the
internal web2py process that will allow you to have a password as
Keep in mind, in that post, the first method (i.e., with 1 ms responses)
involved serving static files. The second method (65-75 ms) also involved
storing the files on the filesystem, but they weren't served as static
files (instead, they were served using web2py's built-in file
another way around i think you can do it in web form using oncreate,
onupdate and ondelete. and for delete callback, please check this
discussion :
https://groups.google.com/forum/#!topic/web2py/didLpxEKT38
reference for oncreate, onupdate and ondelete, please check this discussion
:
import subprocesssubprocess.call(['./scriptshell.sh'])
is it can be used for windows batch files too?
just a suggestion, why not use configuration management like puppet, chef
or cfengine?
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
look :
https://groups.google.com/forum/#!topic/web2py/Ow-x1D4__q0
El lunes, 13 de enero de 2014 22:07:05 UTC-5, Brando escribió:
I don't know anyone who builds webapps with python. I've watched A LOT
of videos and read A LOT of posts about web2py. I've got the basics down
and have
If you want to submit a list of inputs to FORM(), then that's all you can
submit. So, append the submit input to the fields list and then just do
FORM(fields).
Also, if db.a_table.image is an upload field, it will just store the
transformed filename, which won't be very informative to the
I read through the link you show me. I'm using _before_delete now, since
doing s.select() returns 0 rows since it's already been deleted. I'm not
sure how to deal with sets in _after_delete.
Here is my updated models:
db.define_table('person',
Field('name'),
for after delete callback, please check this discussion
https://groups.google.com/forum/#!msg/web2py/M4_5THMHzH0/r9aXH-k8eJQJ
best regards,
stifan
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
Yeah, that thread says to use _before_delete, and it fits this use case.
Can you verify if what I'm seeing about the delete is correct? The
_before_delete is causing the admin panel to not delete the record for some
reason. Is it a bug?
I'm using web2py 2.7.4 stable
On Tuesday, January 14,
Hi everyone,
I plan to do an app for webs that have about 10k-100k visits per day. This
app would be an iframe of my own webpage/app.
I don't need a lot of bandwith (say that I will send an STATIC page, size
less than 30-20kb per request), but I need to update some data of this
static page
You know, I hate to say it but that never even occurred to me to try. I got
so distracted with other things that I never took the time to really
evaluate what could be happeing. Thank you, Anthony.
On Tuesday, January 14, 2014 5:23:23 PM UTC-7, Anthony wrote:
If you want to submit a list of
db.thing._after_insert.append(lambda f,id: db(db.person.id
==f['owner_id']).update(total_items=len(db(db.thing.owner_id==f['owner_id']).select(
from pprint import pprint
db.thing._before_delete.append(lambda s: db(db.person.id
Of course, that's only if you add or delete one record at a time.
On Wednesday, January 15, 2014 12:09:11 AM UTC-5, Anthony wrote:
db.thing._after_insert.append(lambda f,id: db(db.person.id
==f['owner_id']).update(total_items=len(db(db.thing.owner_id==f['owner_id']).select(
from pprint
As noted in the book, the _before_ callbacks must return falsey values, or
the operation will be aborted. So, you can either write a full function
(that returns False) instead of using a lambda, or do something like:
lambda s: db(...).update(...) and False
which will return the value False.
Massimo: Would you consider taking a patch / pull request for a new script?
-- James
On Thursday, January 9, 2014 9:16:02 AM UTC-5, Massimo Di Pierro wrote:
The problem is that it would not work. you can have exceptions at two
levels: web2py apps, web2py itself. In other frameworks these two
The problem still exists, here in 2014!
It is broader than just MOBI format -- it also makes EPUB book listings (at
least Python ones) useless. BUT -- it only affects one publisher I have
found so far -- Packt Publishing.
Sadly I will be crossing them off my list of suitable purveyors of
hi, thanks everyone for the answers
@Willoughby I don't think the mac address is sent/received in an http
request, isn't ?
@dave your suggestion is in the right direction but how can you
automatically tells the browser to send this token?
@niphlod authentication is not enough, an user can still
46 matches
Mail list logo