Anthony,
I have noticed an error in the code. I have created a very simple form to
test the upload without using components. The code is as follows:
Controller:
=
def index():
form = SQLFORM.factory(Field(first_name),Field(quotes_file,
upload,
After upgrading to web2py version 2.4.4 this no longer works:
auth.settings.logout_onlogout = lambda user: on_logout(auth,session)
I get the following error:
global name 'on_logout' is not defined.
on_logout(auth,session) is a function in a module which clears all the
settings
of the cms
I have this action that verify is a group exist, if not, it create this
group:
verify_install = db(db.auth_group.role == 'admin').select()
if not verify_install:
auth.add_group('admin', 'Administrative Group')
redirect
The action I have a table/collection with 3 objects
In the table this is reverenced as
Field('host_id', mdb.hoststable,
comment=Like nim or hmc server.,
label=T('Destination Host ID')),
But when in appadmin I select a other object to change then it throws a
error.
The
there's a logic step that you are missing
the grid is - usually - protected with signed urls, if you want to access
the edit form of the grid itself. First of all, you should embed in the
mail the signed url, otherwise a not authorized is expected.
but, since the signature depends on the
On 03/20/2013 08:33 AM, Martín Miranda wrote:
Here ...
http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html
Hi Marti'n, Richard,
Thank for your time.
Actually I think I solved it in another way allowing:
1) Load modal by an ajax call
2) use template system for
Created the following table
mdb.define_table('syscommands',
Field('commandname', type='string',
unique=True,
label=T('Commandname')),
Field('commandline', type='string',
label=T('Command')),
Field('host_id', mdb.hoststable,
comment=Like nim or
seems to me that a lot of people are interested in using mongodb but really
few are contributing back with tests and patches.
BTW: you DO know that Mongo generally doesn't play well with joins, right ?
Using references in mongodb is not a smart design.
--
---
You received this message
Op 21-03-13 17:50, Niphlod schreef:
seems to me that a lot of people are interested in using mongodb but
really few are contributing back with tests and patches.
BTW: you DO know that Mongo generally doesn't play well with joins,
right ? Using references in mongodb is not a smart design.
I'm concerned with the lack of reliability and speed of the recommended
backup / restore functions: db.export_to_csv_file and
db.import_from_csv_file.
They failed in my case, and apparently I'm not alone
(https://groups.google.com/forum/?fromgroups=#!newtopic/web2py/web2py/reOzXobYNgE).
Would
Thanks for the advice! I checked all the folders and removed some example
and doc folders that didn't include code. All the other folders contain
inits.
Still not working. I wonder if it is intended that way? Can you just put
packages in modules that make global imports?
--
---
You
hum... I use this and solves pretty much the bulk of the DLST issues that
were problematic for me.
http://pytz.sourceforge.net (its the Olsen TZ DB wrapped in python)
I found it a little tricky at first, but once i got my head wrapped around
the different permutations of
dates (past,
If I put a code inside models/controller_name/something.py, it gets
executed when running appadmin.
Tested in 2.2.1 and trunk.
Marin
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails
uhm. I'm not familiar with the implementation, but appadmin needs to be a
global management solution
What if in your conditional model you defined a table and you want to
manage that table from appadmin ?
On Thursday, March 21, 2013 11:40:09 AM UTC+1, Marin Pranjić wrote:
If I put a code
Dear ALL ,
i am having some problems starting my project in mysql , it was working
fine in sqlite but its not creating any tables in mysql , here is the error
:
Ticket ID
127.0.0.1.2013-03-21.11-35-49.b053e9f1-2194-47ee-b635-b00b1c370b0c
class 'gluon.contrib.pymysql.err.ProgrammingError'
I am new to web2py, and I am trying to get an embedded mp3 player to play audio
files stored in a database locally. I am using Google player, and I got the
following to work on my webpage
developed in web2py:
embed type=application/x-shockwave-flash
I am new to using web2py, and I was wondering how to embed an MP3 player
into a webpage using web2py. I have made a page with the embedded player,
with the MP3 file in a SQL Lite DB, but I cannot get the file to play with
the embedded player.
I am not sure if this is relevant, but I have jpg
I have a table that represents a group, which has permissions on a
row-by-row basis. User belongs to certain number of groups, and the rows
into the table are kept for convenience sake. I would like to screen that
list of rows for a specific permission and exclude those rows from the
list. The
I would love to have some pointers about how though define mongo in
db.py in a proper nosql way.
Could you open an issue at the project page?
If you can, please provide:
- The relevant part of the model
- A possible set of data which would reproduce the error
- Your mongodb driver,
I'm struggling to understand the interfaces syntax.
Because I'm using this as a Windows service, I need to set up the
options.py file.
I see from the documentation ie python web2py.py --help
that the ip option is ignored if interfaces is present.
What about port (logically that should be
Quite right, restoring from, let's say, native mysql dump to postgresql
would most certainly not work. That's exactly why web2py uses csv as the
export format.
I don't think exporting / importing to csv is really recommended over using
the native export / import functionality of your database
on command-line should be, in your case
web2py.py -i 0.0.0.0:80,0.0.0.0:443:keyfile.key:certfile.cer
using the options file,
interfaces = [('0.0.0.0', 80), ('0.0.0.0', 443, keyfile.key, certfile.cer)]
On Thursday, March 21, 2013 1:29:45 PM UTC+1, Tim Richardson wrote:
I'm struggling to
So, basically you're doing
get me 150K rows, put them in a list
for each of them, query the db for permission
if query doesn't return True, scan the 150K list and remove this instance
Cycling 150K and removing from a list while checking surely will get your
app killed.
Firing one query for
Indeed, or quite
close: https://code.google.com/p/web2py/issues/detail?id=1387.
And to be accurate, I think the issue has more to do with restore than
backup.
To build on your comment, there are indeed two ways to deal with backup /
restore:
1- managed by the database manager using native
This is a repost cause it did not receive much feedback.
I have noticed an error in the code below. The book emphasises on upload
file storage in the db, but what about simple upload and manipulation.
I have created a very simple form to test the upload without using
components. The code is as
I solved a similar case by writing a function to a) use native postgres
dump and archive the database and b) present the file to the user for
download in the administrative back-end. This function is triggered by cron
in my case, but it could also be executed on demand. For this I would use
Not exactly. The fields in rows are indices into db.my_table. len(rows) is
a small variable number, say around 8.
But there it is, anyway. Thank you Mr. Niphlod. Good work!
bad_rows = db((db.my_table.id.belongs(rows))
(auth.accessible_query('update', db.my_table,
i'll take a look and send it too you the file on the discussion that i've
refer above.
On Wednesday, March 20, 2013 9:36:49 PM UTC+7, Alex Glaros wrote:
thanks for the attached full example Steve
did you write it just to assist for this topic?
When I go to the app page I get:
invalid
Thanks Ales,
Basically, you're confirming the native backup / restore choice. I'm
concerned though that web2py's csv solution is not reliable, and should
therefore be used with high caution -- not to say a word about how slow it
is. It feels sad for me that web2py which other than that an
so you'd prefer to have it removed alltogether ?
On Thursday, March 21, 2013 3:37:44 PM UTC+1, dederocks wrote:
Thanks Ales,
Basically, you're confirming the native backup / restore choice. I'm
concerned though that web2py's csv solution is not reliable, and should
therefore be used with
Yes - unless someone finds a good use for these two functions.
It looks to me that if a record has been removed in a db (e.g. id is not
continuous: 1, 2, 4, 5 for example), the restore won't work if the table is
linked to another table. This is I think a sufficiently likely case to
remove the
I know they are not on travis.ci but they exist and can be extended to
include user applications.
On Tuesday, 19 March 2013 18:07:35 UTC-5, Niphlod wrote:
if you're referring to gluon/tests/test_web.py they aren't (at least in
travis-ci).
you're required to have a running webserver in an
I believe there is problem in parsing options. Those options are not web2py
options. They are winservice options. Please pen a ticket about this.
On Wednesday, 20 March 2013 09:36:18 UTC-5, wprins wrote:
Hi,
I'm trying to set up web2py with alternate account credentials via the
command
It's not specific to web2py, but may help you maybe :
http://stackoverflow.com/questions/11773544/nginx-different-domains-on-same-ip
The idea is to create a other server in nginx...
Richard
On Mon, Mar 18, 2013 at 4:21 PM, Tito Garrido titogarr...@gmail.com wrote:
Hi Folks,
I am reading
Probably the problem is the nested quotes in
flashvars=audioUrl={{=URL('download', args=image.file)}}
should be
flashvars=audioUrl={{=URL('download', args=image.file)}}
On Thursday, 21 March 2013 00:25:53 UTC-5, Gennaro Kukonu wrote:
I am new to web2py, and I am trying to get an
What is wkaleh_db? Is is defined somewhere in your code?
On Thursday, 21 March 2013 03:38:35 UTC-5, mqa...@gardeniatelco.com wrote:
Dear ALL ,
i am having some problems starting my project in mysql , it was working
fine in sqlite but its not creating any tables in mysql , here is the error
This was fixed in 2.4.5. What version of web2py are you using?
On Wednesday, 13 March 2013 09:47:38 UTC-5, Phillipp Schmidt wrote:
I want to use the tablib package. https://github.com/kennethreitz/tablib
So I put it in the modules folder of my application and use `import
tablib`.
Although
I have a major patch from Niphlod that replace my naive implementation with
one based on pytz. I agree this is the way to go. We have two open issues:
1) should be include pytz in web2py r make it a depencency
2) should we do the pytz import in web2py or should we pass pytz objects to
validators
I think the problem my be this: {{=BEAUTIFY(request.vars)}}. What if you
remove it?
On Thursday, 21 March 2013 08:56:44 UTC-5, software.ted wrote:
This is a repost cause it did not receive much feedback.
I have noticed an error in the code below. The book emphasises on upload
file storage
I just updated to this version, but I am still getting the error. Fany
interface, though!
Do you know any working packages that I could try to see whether it has
something to do with my setup?
--
---
You received this message because you are subscribed to the Google Groups
web2py-users
Removing the functionality altogether seems extreme. However, perhaps we
should change the documentation to remove the backup/restore terminology
(i.e., we can describe it as a way to export and import an entire db,
but not recommend it as a primary backup strategy and instead recommend
native
my point exactly it's a matter on how it's perceived as a
one-solution-for-all-exporting-problem vs a rapid way to load fixtures/etc
in your environment.
On Thursday, March 21, 2013 4:41:48 PM UTC+1, Anthony wrote:
Removing the functionality altogether seems extreme. However, perhaps we
see the other thread on web2py-developers for further details.
On Thursday, March 21, 2013 4:19:22 PM UTC+1, Massimo Di Pierro wrote:
I know they are not on travis.ci but they exist and can be extended to
include user applications.
On Tuesday, 19 March 2013 18:07:35 UTC-5, Niphlod wrote:
That's intentional. The idea is that appadmin needs access to all the
models in order to be able to manage the whole database. If you don't want
that for some reason, I think you should be able to change the name of
appadmin.py and appadmin.html to something else (the model execution code
Sure, I can do that. Good idea :-)
Thanks.
--
---
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
Yes you can. From the point of nginx treat all domains as one. the use
web2py routes.py to map different domains to different apps.
On Monday, 18 March 2013 15:21:25 UTC-5, Tito Garrido wrote:
Hi Folks,
I am reading the book section:
http://web2py.com/books/default/chapter/29/13#Nginx
Did you restart web2py after upgrade?
On Thursday, 21 March 2013 10:38:47 UTC-5, Phillipp Schmidt wrote:
I just updated to this version, but I am still getting the error. Fany
interface, though!
Do you know any working packages that I could try to see whether it has
something to do with
Hello,
I have a bizzard case where I need to set the number of input (more number
of rows to be insert then inputs to be more precise) of a form... I create
a bulk insert form that will insert many record at the same time but, if
there is empty rows form will never submit since there is field
Yes, I restarted a couple of times.
--
---
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
if request.vars.quotes_file:
Sorry, I didn't realize this, but apparently if you do if
[cgi.FieldStorage object] you get False rather than True, so instead try:
if hasattr(request.vars.quotes_file, file):
or
import cgi
if isinstance(request.vars.quotes_file, cgi.FieldStorage)
I
db.define_table('countries',
Field('country_name')
)
db.define_table('testing',
Field('origin','reference
countries',requires=IS_IN_DB(db,'countries.country_name',error_message='Choose
origin country'))
)
when i try to input testing from database administration, i get this
I'm glad you like it, and it's interesting, but this way is not secure,
since it is susceptible to double submit and CSRF. I would only recommend
this way if you are building an internal only website. You should probably
have a formkey to protect against it.
On Wednesday, March 20, 2013
I don't see any decaration of on_logout in web2py 2.3.2, search the book
for on_logout lead to nothing either...
Could it be your own custom function??
Richard
On Thu, Mar 21, 2013 at 3:08 AM, Annet anneve...@googlemail.com wrote:
After upgrading to web2py version 2.4.4 this no longer works:
Massimo, I think you need a new keyboard, looks like your 'o' key is
failing you. Either that, or the ring finger on your right hand has a
problem. Twice now there's a missing 'o'.
On Thursday, March 21, 2013 8:33:42 AM UTC-7, Massimo Di Pierro wrote:
I have a major patch from Niphlod that
But the question again is where is the file stored, its not appearing in
the specified uploads directory for manipulation. What I want to do is
upload an excel sheet with specific columns of data, then get the data and
insert into db with similar columns
On Mar 21, 2013 6:48 PM, Anthony
I use Mac Os X Lion
I open the web2py app directly for the server rather than using the
terminal to open.
I want to use MySQL database.
SO where should I place the MySQL db module so that I can import it in the
server.
For a Windows System we can direclty copy the contents to site-packages
:-)
On Thursday, 21 March 2013 12:51:26 UTC-5, Derek wrote:
Massimo, I think you need a new keyboard, looks like your 'o' key is
failing you. Either that, or the ring finger on your right hand has a
problem. Twice now there's a missing 'o'.
On Thursday, March 21, 2013 8:33:42 AM UTC-7,
Hi,
I am having trouble finding the right way to do this :
- I have a table, each row has an owner which is the only one allowed to
edit or delete it
- Ownership is represented thanks to auth_permission (permission 'owner')
- I would like to use ondelete and onupdate callbacks to
class 'psycopg2.IntegrityError' insert or update on table testing
violates foreign key constraint sea_inquery_origin_fkey DETAIL: Key
(origin)=(0) is not present in table countries.
Are you setting 0 value for the foreign key?
If you are in the admin app, the insert form should not pass
the form is created by the admin app, no validation error, just i get this
error for any insert with relation.
i dont understand.
On Thursday, March 21, 2013 10:06:54 PM UTC+3:30, Alan Etkin wrote:
class 'psycopg2.IntegrityError' insert or update on table testing
violates foreign key
On 03/21/2013 08:06 PM, Alan Etkin wrote:
I would love to have some pointers about how though define mongo in
db.py in a proper nosql way.
Could you open an issue at the project page?
Done :-) Issue 1401
https://code.google.com/p/web2py/issues/detail?id=1401: Mongodb error
in
the form is created by the admin app, no validation error, just i get this
error for any insert with relation.
Wait, your model has something odd (at least for me)
Since countries is a reference value, AFAIK, it must be an integer. But you
are using a string validator. I don't think
there is no string validator, i just use IS_IN_DB to create drop down widget
On Thursday, March 21, 2013 10:26:38 PM UTC+3:30, Alan Etkin wrote:
the form is created by the admin app, no validation error, just i get this
error for any insert with relation.
Wait, your model has something odd
there is no string validator, i just use IS_IN_DB to create drop down
widget
Yes, sorry, I checked the api and it seems you are using the correct syntax.
Does it work using IS_IN_DB (db, db.countries.country_name) instead?
--
---
You received this message because you are subscribed to
on trunk there is such a function, however it takes only user as a parameter
if onlogout:
onlogout(self.user)
On Thursday, March 21, 2013 6:48:40 PM UTC+1, Richard wrote:
I don't see any decaration of on_logout in web2py 2.3.2, search the book
for on_logout lead to nothing
Como posso alterar o tamanho (largura) das colunas do smartgrid?
Obrigado
Fernando
--
---
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
Can anyone shed light on this?
Webfaction shut me down this morning at a very inconvenient time, claiming
that I had exceeded my 256 Meg of memory.
The had an output from ps -u ... that supposedly showed my 5 Apache workers
had consumed ~ 50 meg each.
I don't see how this is possible. The
The syntax may be correct per the manual, but IS_IN_DB tells Postgres to
create a foreign key constraint on the field. If you look at the tables
with psql or pgadmin you will see this is so.
A foreign key constraint is always on the primary key of the foreign table.
It has to be this way to
:~/version_232/web2py$ grep 'onlogout' *
Return nothing!!
Richard
On Thu, Mar 21, 2013 at 3:43 PM, Niphlod niph...@gmail.com wrote:
on trunk there is such a function, however it takes only user as a
parameter
if onlogout:
onlogout(self.user)
On Thursday, March 21, 2013
I would do onvalidate.
Then you can redirect before damage is done or you can do something like:
form.errors['the_restricted_field'] = Gotcha!! What were you thinking?
You cannot edit this record. Go away.
You may wish to use a less abusive error message.
On Thursday, March 21, 2013
if you search with grep you should do it recursively
grep -nR 'onlogout' *
R for recursively, n for the line number.
On Thursday, March 21, 2013 9:03:55 PM UTC+1, Richard wrote:
:~/version_232/web2py$ grep 'onlogout' *
Return nothing!!
Richard
On Thu, Mar 21, 2013 at 3:43 PM,
just to clear out doubts.
a field 'reference sometable' gets:
- a foreign key to the id of sometable
- a validator that by default builds up on the format argument of sometable
you CAN'T have a foreign key to a table and have the requires parameter
with is_in_db() building a string value.
Forgot!
Sorry for the noise...
So with w2p 2.3.2 get onlogout and logout_onlogout
So Annet must have a mistake in his code or the on_logout change for
onlogout I guess...
Richard
On Thu, Mar 21, 2013 at 4:16 PM, Niphlod niph...@gmail.com wrote:
if you search with grep you should do it
My bad.
How could I not remember that?
On Thursday, March 21, 2013 4:27:40 PM UTC-4, Niphlod wrote:
just to clear out doubts.
a field 'reference sometable' gets:
- a foreign key to the id of sometable
- a validator that by default builds up on the format argument of
sometable
I am also having memory issues on dreamhost VPS... only 3 people accessing
it...
On Thu, Mar 21, 2013 at 4:46 PM, Cliff Kachinske cjk...@gmail.com wrote:
Can anyone shed light on this?
Webfaction shut me down this morning at a very inconvenient time, claiming
that I had exceeded my 256 Meg
Recall that the suggestions to forego calling form.process() and instead
just check for and directly manipulate request.vars.quotes_file was
assuming you did not want to permanently store the file. If you do want to
keep the file, then you should call form.process() (or include code to
Check out my app at wwwgong.pythonanywhere.com/rpad
I embed video mp3 and img
I can share the code if interested
--
---
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
Hi
There are some easy ways to do it.
If the owner reference is in the row you can use before and after
callbackshttp://www.web2py.com/books/default/chapter/29/06#before-and-after-callbacks
something
like:
db.mytable._before_update.append(lambda s,r: True if r.owner ==
auth.user_id else
No, there is no onlogout function in web2py (either in globals or in the
Auth class). Rather, the logout() function takes an onlogout argument,
which is a callable -- so this code:
if onlogout:
onlogout(self.user)
is inside the logout() function, and the onlogout referenced there
Hi,
How can I access the data in the PUT request? (in the body of the request)
Can this be automatically parsed (my data is JSON)
Thanks,
Daniel
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop
hi,
did anyone know how to show record representation format that refer to
another table and that table is refer to another table?
e.g.
*db.py*
db.define_table('branch',
Field('address', 'text'),
Field('zip'),
Field('city'),
Field('country'),
Field('phone'),
The format attribute does propagate, so you'll have to write your own
represent function for the room field (not tested):
Field('room', 'reference room', represent=lambda id, r: '%s %s' % (r.room.
branch.address, r.room.room_no))
The above represent function uses recursive selects, which I
My Webfaction account uses Apache with workers for MPM.
It seems that any memory allocated to a process spawned by an Apache worker
actually clings to that worker after the process finishes. That's why
there is a maximum_requests_per_worker directive.
Could it be that big database migrations
The Python anywhere web site was down earlier today.
Were the hosted apps down at the same time?
--
---
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
if request.env.request_method=='POST':
put_vars = request.post_vars
basically request.post_vars are the variables in body whether it is PUT or
POST or other.
On Thursday, 21 March 2013 19:10:27 UTC-5, Daniel Gonzalez wrote:
Hi,
How can I access the data in the PUT request? (in the
it's work well, thank you very much anthony.
it seems the 'represent' can't work in validators : requires. actually i'm
also want the represent format in the form too. when i try to use the
represent in requires an error is occured. did you know how to do it in
requires field?
when using :
No, IS_IN_DB does not take a represent argument, but it does take a
label argument that works similarly (though the lambda takes only a
single argument -- the record):
IS_IN_DB(db(db.room.status=='Available'), db.room.id,
label=lambda r: '%s %s' % (r.room.branch.address,
87 matches
Mail list logo