[web2py] injection - realities

2010-06-11 Thread Yarko Tymciurak
Interesting (FYI): http://threatpost.com/en_us/blogs/mass-sql-injection-attack-hits-sites-running-iis-061010

[web2py] Finding the relation between two sets...

2010-06-11 Thread Jason Brower
I have it this far.. users_tags = db((db.user_tags.user_id == auth.user.id)) viewed_users_tags = db((db.user_tags.user_id == request.args[0])) I think it's the right direction... but how do I find the releation between those two sets. another things that might be useful is.. auth_user is my

[web2py] widgets

2010-06-11 Thread leone
I coded a widget to use with a Field object. Because I need some javascript actions i wrote pure html-javascript code that my widget returns. It runs, but when I accept the form values are in request.vars, but not in form.vars. How can i store values in form.vars without using input widgets defined

[web2py] Re: Importing Ning network's content

2010-06-11 Thread mdipierro
http://effbot.org/zone/element-index.htm comes with Python On Jun 11, 9:55 pm, GoldenTiger wrote: > Hi I want to write a Web2Py app to import all content from my ning > networks > I have not experience with xml libraries, so before starting I would > like asking advice to users who knows about t

[web2py] Re: upload file -- lot of file in one directory

2010-06-11 Thread weheh
Massimo, Thadeus: I'm need to study this carefully, but it sounds really great! I already implemented a system months ago as per what I wrote above. However, it seems like there is more native support, now, so I want to re-implement. Is this thread the only documentation, or is there something else

[web2py] Importing Ning network's content

2010-06-11 Thread GoldenTiger
Hi I want to write a Web2Py app to import all content from my ning networks I have not experience with xml libraries, so before starting I would like asking advice to users who knows about this: -which libraries to use? -possible or predictable problems? -any similar experience? I'll thank any hel

[web2py] Re: routes with file extensions

2010-06-11 Thread NickFranceschina
ahh... right, thanks so you could just leave it as is and just change the documentation. Or perhaps a "function" really does consist of the "file name + extension". if you think that is so, then ya gotta change the code. On Jun 11, 4:23 pm, mdipierro wrote: > true. Let me give this some thoug

[web2py] Re: Hardening web2py on Linux and Windows servers

2010-06-11 Thread Yarko Tymciurak
if you are looking to prevent access, you should instead be doing something like this: chown -R nobody:nobody *.py ... etc. On Jun 11, 5:41 pm, Yarko Tymciurak wrote: > This would be a security concern:  I do not think you want web > executables / files owned by root.    You would then be force

[web2py] Re: Hardening web2py on Linux and Windows servers

2010-06-11 Thread Yarko Tymciurak
This would be a security concern: I do not think you want web executables / files owned by root.You would then be forced to open up accessibility to the files (so that something which _is not root_ can run / read them) --- which would weaken security; OR you would (???) need to run as root

[web2py] Re: Hardening web2py on Linux and Windows servers

2010-06-11 Thread mdipierro
how about this: chown -R root:root *.py chown -R root:root gluon chown -R root:root scripts chown -R root:root applications/*/modules/ chown -R root:root applications/*/models/ chown -R root:root applications/*/controllers/ chown -R root:root applications/*/views/ chown -R root:root applications/*

[web2py] Re: upload file -- lot of file in one directory

2010-06-11 Thread mdipierro
you can use a lambda On Jun 11, 4:32 pm, Doug Warren wrote: > Should this be a lambda instead so you could specify your own function > completely?  I used to own an ISP and one of the challenges was > running the network news server.  You'd have > 1M files on a 20 gig > drive and have to give the

Re: [web2py] Re: upload file -- lot of file in one directory

2010-06-11 Thread Doug Warren
Should this be a lambda instead so you could specify your own function completely? I used to own an ISP and one of the challenges was running the network news server. You'd have > 1M files on a 20 gig drive and have to give them to multiple peers over their lifetime. One thing that we did for per

[web2py] Re: Can not send verification email

2010-06-11 Thread mdipierro
if you use server='gae' you should use login=None Not sure if this is the problem anyway. Do you get any error? On 11 Giu, 10:12, pecos1046 wrote: > I use the email verification option for new user registration. It > works fine in test mode on the google-appengine sdk. However when I > upload the

[web2py] Re: Hardening web2py on Linux and Windows servers

2010-06-11 Thread Salvor Hardin
lock-web2py.sh is a fantastic idea! On Jun 10, 4:28 pm, mdipierro wrote: > perhaps we should a web2py/scripts/lock-web2py.sh > > On Jun 10, 3:49 pm, Thadeus Burgess wrote: > > > > > www-data needs write access to databases/cache/sessions etc. IF a > > hacker were able to gain access *somehow* an

[web2py] Re: routes with file extensions

2010-06-11 Thread mdipierro
true. Let me give this some thought. meanshile you can do outes_in = ( ('/$c/$f\.$ext', '/init/$c/$f.$ext'), ) or outes_in = ( ('/$c/$anything', '/init/$c/$anything'), ) On 11 Giu, 14:41, NickFranceschina wrote: > I know file extensions are optional... but you do have some nice > funct

[web2py] routes with file extensions

2010-06-11 Thread NickFranceschina
I know file extensions are optional... but you do have some nice functionality in there that allows passing file extensions on to the view... so if I were to request "app/controller/function.html" I would get the matching (or generic) .html template... but if I were to request "app/controller/funct

[web2py] Can not send verification email

2010-06-11 Thread pecos1046
I use the email verification option for new user registration. It works fine in test mode on the google-appengine sdk. However when I upload the application to Google and change the smtp server to "gae" it is unable to send the verification email. The Google GAE log show the following warning messa

[web2py] Re: upload file -- lot of file in one directory

2010-06-11 Thread mdipierro
Field('name','upload',authorize=f) where def f(row): if auth.user and auth.user.id is allowed to download row.id return True else return False the authorize function is called automatically (if declared) when somebody attempts to download an uploaded document. On 11 Giu, 14:11, weheh wrot

[web2py] Re: Script to generate schema (models) from mysql

2010-06-11 Thread mdipierro
I will take a look tonight. On 11 Giu, 14:45, Álvaro Justen wrote: > Hello Alexandre, nice work. > I did it in past for SQLite and made it integrated to DAL > I think we can union the implementations and try to get more databases > working with this code. > > The email I sent to Massimo talking a

[web2py] Re: error in trunk

2010-06-11 Thread mdipierro
fixed On 11 Giu, 14:39, Jose wrote: > Hello, > > The next model is broken by a change in the trunk. > > db.define_table('TA', >     Field('f1'), >     Field('f2'), >     format='%(f1)s' > ) > > db.define_table('TB', >     Field('f1'), >     Field('f2', db.TA), > ) > > controller: > > def test():

[web2py] Re: possible bug in new IS_IN_DB groupby

2010-06-11 Thread mdipierro
fixed now. On 11 Giu, 14:31, "mr.freeze" wrote: > I get this on an app that worked before (running trunk): > > Traceback (most recent call last): >   File "C:\Users\freeze\workspace\web2py\gluon\restricted.py", line > 178, in restricted >     exec ccode in environment >   File "C:/Users/freeze/wo

Re: [web2py] Re: upload file -- lot of file in one directory

2010-06-11 Thread Thadeus Burgess
@auth.requires_login() def download(): problem solved. -- Thadeus On Fri, Jun 11, 2010 at 2:11 PM, weheh wrote: > Once assigned, the user_id that my app creates is never changed. I > would use the auth.user.id field, but I don't like the fact that it's > sequential and therefore, easily gu

[web2py] Internal error

2010-06-11 Thread Cory Coager
Getting this on an initial setup of web2py trying to load the welcome application. Not much in the logs... [Fri Jun 11 12:45:39 2010] [notice] mod_python (pid=3793, interpreter='example.com'): Importing module '/path/to/ modpythonhandler.py' [Fri Jun 11 12:45:39 2010] [notice] mod_python (pid=379

[web2py] error in trunk

2010-06-11 Thread Jose
Hello, The next model is broken by a change in the trunk. db.define_table('TA', Field('f1'), Field('f2'), format='%(f1)s' ) db.define_table('TB', Field('f1'), Field('f2', db.TA), ) controller: def test(): form=crud.create(db.TB) error: Traceback (most recent call last)

[web2py] possible bug in new IS_IN_DB groupby

2010-06-11 Thread mr.freeze
I get this on an app that worked before (running trunk): Traceback (most recent call last): File "C:\Users\freeze\workspace\web2py\gluon\restricted.py", line 178, in restricted exec ccode in environment File "C:/Users/freeze/workspace/web2py/applications/widgets/ controllers/default.py", l

[web2py] Re: upload file -- lot of file in one directory

2010-06-11 Thread weheh
Once assigned, the user_id that my app creates is never changed. I would use the auth.user.id field, but I don't like the fact that it's sequential and therefore, easily guessed. I doubt that uploads can be hacked easily since you did such a good job with security. Nevertheless, I prefer to have an

[web2py] Apache or routes.py rewrite across domains

2010-06-11 Thread Doug Warren
I have a rather interesting situation that came up yesterday. An OAuth callback is statically set to domain2.com/appname however all other web2py apps are hosted out of http://web2py.domain1.com/appname So I have an Apache config like: DocumentRoot "/home/domain1" ServerName web

[web2py] Re: Support for conversation?

2010-06-11 Thread pierreth
On 11 juin, 01:14, mdipierro wrote: > The only way to keep a conversation would > be to store a token in request.args(0) and keep it there in all links. > Still the conversation is fragile and ends if the user types in a url > without the token. An url parameter of a get request with the session

[web2py] Re: Support for conversation?

2010-06-11 Thread pierreth
On 11 juin, 09:42, szimszon wrote: > This conversation thing could be handy for my inventory app... I just > made use of session but the user starting new conversations to get the > info to continue the original... after that we can't trust the info in > session. ... :-o Yes, it is exactly th

Re: [web2py] Re: simplejson -- wasn't this resolved?

2010-06-11 Thread Thadeus Burgess
Sure. Worked. Installed simplejson with sudo easy_install simplejson Then get this traceback It seems that the version in contrib is importing from simplejson expecting its local version of the files, but instead it is pulling it down from the site-packages. -- Thadeus On Fri, Jun 11, 20

Re: [web2py] Permission Denied error when updating field

2010-06-11 Thread Doug Warren
As mentioned in irc, you're trying to execute the image as a command, from the python os.system documentation: os.system(command) Execute the command (a string) in a subshell. This is implemented by calling the Standard C function system(), and has the same limitations. Changes to sys.stdin, e

[web2py] Re: Uploading files

2010-06-11 Thread mdipierro
If I understand the question... you can have two or more forms form1=crud.create(db.table) form2=crud.create(db.table_file) return dict(form1=form1,form2=form2) as long as the forms are about different tables. Else you have to use SQLFORM and in accept give the forms different formname(s). On J

[web2py] Re: Client Tools Application corrupt on web2py Version 1.79.2 ?

2010-06-11 Thread mr.freeze
I think you're using an older version. Can you clear your browser cache and try again. My apache cache rules may not be working properly. On Jun 11, 4:32 am, AsmanCom wrote: > Hi, > > it seems that Client Tools wont work anymore on web2py Version 1.79.2: > > Traceback (most recent call last): >  

[web2py] Re: Uploading files

2010-06-11 Thread Kenneth
> in controller > form=crud.create(db.page) > return dict(form=form) Is this possible with two tables? I have two tables, page and page_files, the page is stored in page and all files in page_files as one page can have many files. > - you use form.vars.id. That is only created by

[web2py] Permission Denied error when updating field

2010-06-11 Thread Aaron Crowe
I'm working on an application that takes a Turtle Art (.ta) file, runs it, creates a .png of the result, and displays it in a table. So far I can create the .png and it's placed in the uploads folder with the same name as the original .ta file but when i try to run session.new_image = form.var

[web2py] Re: checking if table exists in database

2010-06-11 Thread mdipierro
if you set migrate=True web2py does the check for you and eventually creates tables. It can only detect tables if they were created by web2py itself since it uses metadata for that purpose. On Jun 11, 7:25 am, mika wrote: > hi i would like to make my application generate database at startup > (st

[web2py] Re: fresh from http://code.google.com/p/web2py/

2010-06-11 Thread mdipierro
somewhere you have orderby='table.field'|'table.field' instead of orderby=db.table.field|db.table.field On Jun 11, 7:25 am, szimszon wrote: > validators.py: > 376: groupby = self.groupby or reduce(lambda a,b:a|b,self.fields) > > Traceback (most recent call last): >   File "/home/szimszon/fejl

[web2py] Re: Support for conversation?

2010-06-11 Thread szimszon
This conversation thing could be handy for my inventory app... I just made use of session but the user starting new conversations to get the info to continue the original... after that we can't trust the info in session. ... :-o On jún. 11, 15:10, pierreth wrote: > On 11 juin, 01:14, mdipierr

[web2py] Re: Uploading files

2010-06-11 Thread mdipierro
Why not use the web2py way... in controller form=crud.create(db.page) return dict(form=form) and in view {{=form}} You code does not work because: - request.vars.file contains a cgi.FieldStorage object and you cannot put that id the database - the the actual file has to

[web2py] Re: Support for conversation?

2010-06-11 Thread pierreth
On 11 juin, 01:14, mdipierro wrote: > yes but people don't just navigate by submitting forms. they also > navigate by clicking links. The only way to keep a conversation would > be to store a token in request.args(0) and keep it there in all links. > Still the conversation is fragile and ends if t

[web2py] problem in processing form fields in array

2010-06-11 Thread lameck.kassana
Hi, Everybody I was working on one of my application, and I need to create the form in which user can add fields ( in row of table dynamically) .I did manage to implement it by javascript and user can delete and add fields in form dyanmically. Then my problem comes in my controller how to read thi

[web2py] fresh from http://code.google.com/p/web2py/

2010-06-11 Thread szimszon
validators.py: 376: groupby = self.groupby or reduce(lambda a,b:a|b,self.fields) Traceback (most recent call last): File "/home/szimszon/fejlesztes/sajat/web2py/gluon/restricted.py", line 178, in restricted exec ccode in environment File "/home/szimszon/fejlesztes/sajat/web2py/application

[web2py] checking if table exists in database

2010-06-11 Thread mika
hi i would like to make my application generate database at startup (sth like first run) - i mean generating automatically all needed relations (hardcoded).. on startup i would like to check if database was prepared before How to achieve this? what to do with migration? i though about such code (

[web2py] Re: Decoding problem - UTF8

2010-06-11 Thread Felipe
Just got the problem solved ! It is kind of cheating but i works.. here is the code def dic_lista(lista): for i in range(len(lista)): for key in lista[i]: try: lista[i][key] = lista[i][key].decode('utf8')

[web2py] Client Tools Application corrupt on web2py Version 1.79.2 ?

2010-06-11 Thread AsmanCom
Hi, it seems that Client Tools wont work anymore on web2py Version 1.79.2: Traceback (most recent call last): File "gluon/restricted.py", line 178, in restricted File "D:/web2py/applications/clienttools/controllers/default.py", line 265, in File "gluon/globals.py", line 96, in File "D:/

[web2py] Uploading files

2010-06-11 Thread Kenneth
Hello, in my application there is a need for users to add there own pages and an a page you should be able to upload files (Word, Excel), multiple files. So instead of defining "Field('picture','upload',default=''))" in my page table I made a own table just for the files. First I didn´t have the

[web2py] Re: Key query support in Google App Engine

2010-06-11 Thread Christian Foster Howes
Did some more testing today...i left out the corrections for orderby. the attached patch includes that bit as well. sorry for the extra file. i don't think there are any other clauses that you can put ID in, is that correct? also, if anyone is using GAE development server with sqlite, key qu