Re: [web2py] Do we need a Web2py micro-framework , or split web2py into multiple components ?

2011-08-04 Thread Phyo Arkar
>Everything else is pretty much decoupled. sqlhtml.py depends on dal.py >and html.py. shell.py depends on everything because acts like main but >from shell. Thanks massimo , But things like contrib, which suppose to be not very critical module , but it cannot be removed coz important module like m

[web2py] Re: Tip: computed fields and update_record

2011-08-04 Thread Massimo Di Pierro
one should work. They should be This compute works: db.item.result.compute = lambda r: r.a + 1 This one does not: db.item.result.compute = lambda r: r.b + 1 The former works because there must be a global variable a defined somewhere which means you are getting wrong results. On Aug 3, 8:44 p

[web2py] Re: Do we need a Web2py micro-framework , or split web2py into multiple components ?

2011-08-04 Thread Massimo Di Pierro
Sorry what I meant is that you can use modules without web2py, not that you can use web2py without some of the modules. All modules together are small. Only gluon.contrib.populate and gluon.contrib.feedparser are a bit large and you can remove both of them without consequences because they are not

[web2py] Re: Web2Py with Python 2.4

2011-08-04 Thread Jagmal
Massimo, I got following error on server: ImportError: No module named hashlib So, I got hold of one local machine with python 2.4 and was able to reproduce the same error. Then, I installed latest hashlib package and retried. This time I got following error: ImportError: No module named uui

Re: [web2py] Re: Web2Py with Python 2.4

2011-08-04 Thread Jagmal
Thanks John for responding. I got the following error when I tried running web2py.py on a machine with python 2.4 ImportError: No module named hashlib I did some googling and installed hashlib from http://code.krypto.org/python/hashlib How should I have proceeded? Regards, Jagmal

Re: [web2py] email to all users of a group. Howto?

2011-08-04 Thread António Ramos
That is obvious right, but why not one step ahead? It would be simpler if a programmer just code mail.send(groupname,subject="demo",message="demo") web2py send function should detect if its a user or a group and if a group, send the messsage to all members. That is the way of an enterprise fra

[web2py] Re: how to add a css file in web2py

2011-08-04 Thread Web2Py Freak
Dear anthony , i did what u told me , and it didnt work , can anyone try it and see if it works , am trying to add this ( http://markitup.jaysalvat.com/home/ ) help me guys , am going crazy

[web2py] Re: Do we need a Web2py micro-framework , or split web2py into multiple components ?

2011-08-04 Thread Massimo Di Pierro
In trunk, I added scripts/make_min_web2py.py run it with cd web2py python scripts/make_min_web2py.py ../minweb2py cd .. tar cvf minweb2py.tar minweb2py ls -l minweb2py.tar It builds a minimal web2py in 1.6MB total uncompressed (446KB compressed). (tar BEFORE you run it to measure size) It d

[web2py] Re: how to add a css file in web2py

2011-08-04 Thread pbreit
Put the "markitup" directory in your "static" directory. Include this in in your layout.html file in the section: You might need to add more lines according to the docs: http://markitup.jaysalvat.com/documentation/ Make sure you do NOT including anything in your routes file about the /static

[web2py] Re: Tip: computed fields and update_record

2011-08-04 Thread pbreit
Oops, forgetting the r. was a typo. But it still looks to me like the compute function is only getting the fields specified in update_record(). For example, here are logs of an update in /appadmin and and update_record(drops=,duration=,start_date=): 2011-08-04 02:08:35,296 INFO 5_item.py 49 ge

[web2py] Re: Do we need a Web2py micro-framework , or split web2py into multiple components ?

2011-08-04 Thread Massimo Di Pierro
Made a mistake. Reposted. It is now 1495KB total. Perhaps it should be rewritten so that one lists files to be ignored instead of files to be included. It would also be nice to add a better docstring for the file. I live this as an exercise. ;-) Massimo On Aug 4, 3:55 am, Massimo Di Pierro wrot

[web2py] Re: Trouble with components

2011-08-04 Thread pbreit
Coupla other approaches: http://www.johnnycode.com/blog/2010/04/08/jquery-form-serialize-doesnt-post-submit-and-button-values-duh/ http://stackoverflow.com/questions/4007942/jquery-serializearray-doesnt-include-the-submit-button-that-was-clicked I'm surprised Jquery doesn't provide better support

[web2py] Re: layout with submenu

2011-08-04 Thread Casey Schroeder
Ok, this is just a problem not addressed I see. Not specific to the above code. If i install the layouts plugin to the welcome app i get the same result of a menu with odd behavior, so it is something that will pop up for everyone I think. I will address it in my code. On Aug 1, 3:10 pm, Richa

[web2py] Re: how to add a css file in web2py

2011-08-04 Thread pbreit
It's supposed to go in layout.html, not the view. But it may work where you have it. Also, it looks like you have not used the code that I provided for you. What I mean about the routes is that you do not need to edit the routes file for this to work, In fact you dont need the routes file at al

[web2py] Re: routes.py in webfaction with favicon

2011-08-04 Thread blackthorne
Thank you, it worked! :) On Aug 4, 6:56 am, annet wrote: > For what it's worth, this works at webfaction: in the > section of your layout simply put this: > > rel="shortcut icon" type="image/x-icon" /> > > In case of your solution, should this: > > routes_in = ( (r'.*:/favicon.ico', r'/init/sta

[web2py] Apple Dumps MySQL for PostgreSQL

2011-08-04 Thread Massimo Di Pierro
http://www.theregister.co.uk/2011/08/02/apple_dumps_mysql_from_mac_os_x_server/

Re: [web2py] Apple Dumps MySQL for PostgreSQL

2011-08-04 Thread Furqan Rauf
who uses mac anyways :P Just kidding!!! On Thu, Aug 4, 2011 at 5:15 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > > http://www.theregister.co.uk/2011/08/02/apple_dumps_mysql_from_mac_os_x_server/ > > -- *-Furqan Rauf* *Do you love your creator? Love your fellow-beings first. -Pro

[web2py] Auth by SSL cert

2011-08-04 Thread Michele Comitini
Hello list! I have a simple question, but I cannot find any example by googling around. Does anyone have a setup to allow authentication of users with X.509 signed certs with web2py? This means that the serial of the cert or the cn is used to identify the usre. The problem is passing those data

[web2py] Re: Auth by SSL cert

2011-08-04 Thread Massimo Di Pierro
Look into repoman, specifically this file: https://github.com/hep-gc/repoman/blob/master/server/repoman/repoman/lib/middleware/authentication.py They have a wsgi middleware that takes the certificate and sets environ['AUTHENTICATED'] On Aug 4, 5:45 am, Michele Comitini wrote: > Hello list! > >

[web2py] Re: Auth by SSL cert

2011-08-04 Thread Massimo Di Pierro
P.S. Adding a request.x509() method to do the same as below would be a nice web2py addition! On Aug 4, 6:45 am, Massimo Di Pierro wrote: > Look into repoman, specifically this file: > > https://github.com/hep-gc/repoman/blob/master/server/repoman/repoman/... > > They have a wsgi middleware that

Re: [web2py] Re: Auth by SSL cert

2011-08-04 Thread Michele Comitini
Thanks Massimo! I am eager to look into it asap. mic 2011/8/4 Massimo Di Pierro : > P.S. Adding a request.x509() method  to do the same as below would be > a nice web2py addition! > > > On Aug 4, 6:45 am, Massimo Di Pierro > wrote: >> Look into repoman, specifically this file: >> >> https://git

Re: [web2py] JqGrid module

2011-08-04 Thread Johann Spies
On 30 July 2011 20:34, Jim Karsten wrote: > Ray Luo and I are developing a web2py jqgrid module that allows you to > insert a jqgrid into a page with only a few lines of code. > ... > > > # In > controller > > > JqGrid = local_import('jqgrid', app='jqgrid', > reload=True).JqGrid > JqGrid.initial

Re: [web2py] Re: layout with submenu

2011-08-04 Thread Richard Vézina
Which layout plugin? Your plugin maybe outdated... Richard On Thu, Aug 4, 2011 at 5:43 AM, Casey Schroeder wrote: > > Ok, this is just a problem not addressed I see. Not specific to the > above code. If i install the layouts plugin to the welcome app i get > the same result of a menu with od

[web2py] customisation in dal.py - what is the best way

2011-08-04 Thread Vineet
I want to do some customisation in dal.py. Want to use MySQLdb instead of PyMySQL. Reason behind it:-- I am going to use a 3rd party lib known as 'bizobj', which uses MySQLdb. I can change the code to -- - import MySQLdb drivers.append('MySQL') etc. --- Pl. tell me whether the below-mentioned

Re: [web2py] web2py 1.98.2 is OUT

2011-08-04 Thread Richard Vézina
Congrats... But this one is still there : http://code.google.com/p/web2py/issues/detail?id=348 If you think it is not a web2py issue I would like to know, but I don't see how it could coming from my app or what I should verify to fix this issue... I really need a fix about this issue I have the

[web2py] Re: MongoDB supported by DAL

2011-08-04 Thread Francisco Costa
any news? On Jul 25, 10:02 am, Francisco Costa wrote: > When will MongoDBAdapter finalize so we can use it with DAL?

[web2py] Re: MongoDB supported by DAL

2011-08-04 Thread David Marko
Also inteersted here. Can afford some time for testing ...

Re: [web2py] Re: delete a SQLTABLE column

2011-08-04 Thread Richard Vézina
I can't, I have to work with the html table because I do this before creating the SQLTQBLE : db[request.args(0)].sample_id.represent=\ lambda sample_id, record: A("%(sample)s" %db.v_sample_num_all[sample_id],\ _href=URL(r=request,f='read',args=request.args(0)+'/'+st

[web2py] Re: default function of a controller

2011-08-04 Thread Francisco Costa
I have controller over my URLs I have this controller 'user' with 2 functions: index(list of users), view(user details) I have another controller 'restaurant' with 2 functions: index(list of restaurants), view(restaurant details) I wanted to have this urls: http://domain.com/user/mcdonalds and ht

[web2py] Re: Tiny example on uwsgidecorators+web2py

2011-08-04 Thread Francisco Costa
Is it possible to have this in web2py: imagine i have a function for user registration: after the db.auth_user.insert() i want to send an email to the user I would like to have the sent_email() function in a spool, this way the controller could execute faster and the emails would be sent in "back

Re: [web2py] Re: About passwords security in web2py

2011-08-04 Thread António Ramos
If i use janrain what information is stored in the tables? Is this more trustable for users because i have an app to be used not by internal users but by clients of my company to request products. They can reject my app because of password confidentality. Thank you António 2011/8/3 Massimo

[web2py] extra_fields problem

2011-08-04 Thread Cliff
I get an exception from this code in db.py: auth.settings.extra_fields['auth_user'].append(Field('created_by', default=session.auth.user.id), writable=False, readable=False) Here is the exception: Traceback (most recent call last): File "/media/Myfiles/w2p-1-98-2/web2py/gluon/restricted.py"

Re: [web2py] extra_fields problem

2011-08-04 Thread António Ramos
i had the same problem.Now solved. check previous post http://osdir.com/ml/web2py/2011-08/msg00232.html 2011/8/4 Cliff > I get an exception from this code in db.py: > > auth.settings.extra_fields['auth_user'].append(Field('created_by', > default=session.auth.user.id), writable=False, readab

[web2py] Re: mongoDBAdapter test ......

2011-08-04 Thread Francisco Costa
> I will look at this again when I get a chance... When will MongoDBAdapter finalize so we can use it with DAL?

[web2py] Re: MongoDB supported by DAL

2011-08-04 Thread Francisco Costa
On Aug 4, 3:46 pm, David Marko wrote: > Also inteersted here. Can afford some time for testing ... This would be great to have. MongoDb is being widely adopted by a larger number of organizations. If DAL could support MongoDB, it would have a major impact in some development companies.

Re: [web2py] Re: MongoDB supported by DAL

2011-08-04 Thread António Ramos
Mongo over couch? Why? 2011/8/4 Francisco Costa > On Aug 4, 3:46 pm, David Marko wrote: > > Also inteersted here. Can afford some time for testing ... > > This would be great to have. > MongoDb is being widely adopted by a larger number of organizations. > If DAL could support MongoDB, it would

[web2py] Re: web2py and mercurial workflow question

2011-08-04 Thread Eric Scott
Thank you Chris, Richard, and pbreit for your excellent input. Good to know I'm heading in the right direction. I'll definitely look into Fabric. Sounds like if I can gain some fluency in Fabric, it will allow me a lot more control over deployment. Thanks again, Eric On Aug 3, 5:40 pm, Chris

[web2py] Re: customisation in dal.py - what is the best way

2011-08-04 Thread Massimo Di Pierro
You should just do before db=DAL(...) in your models: import MySQLdb from gluon.dal import MySQLAdapter MySQLAdapter.driver = MySQLdb On Aug 4, 8:49 am, Vineet wrote: > I want to do some customisation in dal.py. > Want to use MySQLdb instead of PyMySQL. > Reason behind it:-- I am going to use a

[web2py] Re: Tiny example on uwsgidecorators+web2py

2011-08-04 Thread Massimo Di Pierro
create a task table with a email, title, message, and done fields. insert a task in the table. Have a background process that selects the first task with done=False, sends the email, sets done=True and loops. On Aug 4, 10:02 am, Francisco Costa wrote: > Is it possible to have this in web2py: > >

[web2py] Re: About passwords security in web2py

2011-08-04 Thread Massimo Di Pierro
If you use Janrain you outsource the password issue (now the Janrain admins can steal the password). Caveats: - you as administrator do not need passwords to do bad things on behalf of the user - you as administrator can spoof janrain and steal the password anyway People do not realize how powerf

[web2py] Re: mongoDBAdapter test ......

2011-08-04 Thread Massimo Di Pierro
Nobody is really pushing for this... nobody has provided any feedback about the adapter. On Aug 4, 11:10 am, Francisco Costa wrote: > > I will look at this again when I get a chance... > > When will MongoDBAdapter finalize so we can use it with DAL?

Re: [web2py] email to all users of a group. Howto?

2011-08-04 Thread Anthony
On Thursday, August 4, 2011 4:25:49 AM UTC-4, Ramos wrote: > > That is obvious right, but why not one step ahead? > > It would be simpler if a programmer just code > > mail.send(groupname,subject="demo",message="demo") > > web2py send function should detect if its a user or a group and if a group

Re: [web2py] email to all users of a group. Howto?

2011-08-04 Thread Marin Pranjic
On Thu, Aug 4, 2011 at 10:21 PM, Anthony wrote: > On Thursday, August 4, 2011 4:25:49 AM UTC-4, Ramos wrote: >> >> >> That is the way of an enterprise framework. > > > Note, web2py is no longer an "enterprise" framework > (http://www.web2py.com/).  ;-) > > Anthony > Source: web2py Enterprise Web

[web2py] Re: extra_fields problem

2011-08-04 Thread Cliff
Thanks. I get it now. It didn't sink in that I was dealing with a list even though the square brackets were right there in front of me. (bangs head on desk) On Aug 4, 11:38 am, António Ramos wrote: > i had the same problem.Now solved. > check previous post > > http://osdir.com/ml/web2py/2011-0

Re: [web2py] email to all users of a group. Howto?

2011-08-04 Thread Anthony
On Thursday, August 4, 2011 4:35:12 PM UTC-4, Marin wrote: > > >> That is the way of an enterprise framework. > > > > > > Note, web2py is no longer an "enterprise" framework > > (http://www.web2py.com/). ;-) > > > > Anthony > > > > Source: > web2py Enterprise Web Framework > Yeah, it's still on

[web2py] How to copy rendered html to a file

2011-08-04 Thread JimK
I'm using web2py to create a report and would like to save the HTML that would be rendered in a browser to an HTML file to be viewed later (e.g. without re-running all of the queries). In other words, my web2py app generates a page that displays a bunch of queries that were run for a report and I'

[web2py] call web2py in view from a jQuery script

2011-08-04 Thread Richard
Hello, I try to do this : $(document).ready(function() { $('table.sortable').dataTable( { "sDom": '<"H"Tfr>t<"F"ip>', "oTableTools": { "sSwfPath": "{{=URL('static','plugin_added/DataTables-1.8.1/extras/ TableTools/media/swf/copy_cvs_xls_pdf.swf')}}" },

Re: [web2py] call web2py in view from a jQuery script

2011-08-04 Thread Richard Vézina
I get it like this : var sSwfPath_location = "{{=URL('static','plugin_added/DataTables-1.8.1/extras/TableTools/media/swf/copy_cvs_xls_pdf.swf')}}" And replace : "sSwfPath": "{{=URL('static','plugin_added/DataTables-1.8.1/extras/ TableTools/media/swf/copy_cvs_xls_pdf.swf')}}" With "sSwfPath":

[web2py] socket.error

2011-08-04 Thread Kenneth Lundström
Version web2py™ Version 1.98.1 (2011-07-31 10:15:50) Traceback (most recent call last): File "/data/domains/gluon/main.py", line 506, in wsgibase BaseAdapter.close_all_instances('commit') File "/data/domains/gluon/dal.py", line 373, in close_all_instances getattr(instance,action)() File "/data/do

Re: [web2py] call web2py in view from a jQuery script

2011-08-04 Thread Anthony
On Thursday, August 4, 2011 5:36:13 PM UTC-4, Richard wrote: > > Hello, > > I try to do this : > > $(document).ready(function() { > $('table.sortable').dataTable( { > "sDom": '<"H"Tfr>t<"F"ip>', > "oTableTools": { > "sSwfPath": "{{=URL('static','plugin_added/DataTables-1.8.1/extras/ > TableT

[web2py] Re: call web2py in view from a jQuery script

2011-08-04 Thread Richard
No, I think it a Datatables parsing issue since Datatables TableTools is waiting for a URL... I don't know why... Richard On 4 août, 17:56, Anthony wrote: > On Thursday, August 4, 2011 5:36:13 PM UTC-4, Richard wrote: > > > Hello, > > > I try to do this : > > > $(document).ready(function() { > >

Re: [web2py] customisation in dal.py - what is the best way

2011-08-04 Thread Richard Vézina
Vineet if you still have your issue with ajaxsource with Datatables you should read this Thread : http://groups.google.com/group/web2py/browse_frm/thread/a3cfb94dbbfe68c6/c715a7763ed2f24c?lnk=gst&q=%5Bweb2py%5D+call+web2py+in+view+from+a+jQuery+script#c715a7763ed2f24c I would appreciate if you ge

[web2py] Re: call web2py in view from a jQuery script

2011-08-04 Thread Anthony
Can you show more of your code? I don't see why your second version should work if the first one didn't. Was the original code inside a web2py view (so the URL would get rendered before the HTML was sent to the browser)? Anthony On Thursday, August 4, 2011 5:58:49 PM UTC-4, Richard wrote: > N

[web2py] Re: How to copy rendered html to a file

2011-08-04 Thread JimK
Never mind. I figured this out myself. Just add the following to the controller function for the view that needs to be saved: html = response.render('default/run_report.html', context) Then I just need to copy that to a file and store it on the disk. Thanks any way! On Aug 4, 2:17 pm, JimK

[web2py] Re: Trouble with components

2011-08-04 Thread G
I think I found a workable (but slightly annoying) solution: create several mini-forms that only have the submit button, each with a different form name. Then I can just use many if form_blah.accepts(request.vars, session, formname='form_blah'): clauses. I'd still be interested in knowing if there

[web2py] Re: Trouble with components

2011-08-04 Thread Massimo Di Pierro
if you do not need a view and your component only displays the form you can just "return form" and pypass the generic view. It will be faster. I also suggest you use ajax=True. Always call the component directly as a test that it is working. On Aug 4, 6:33 pm, G wrote: > I think I found a workabl

[web2py] Building web2py binary for windows with extra libs

2011-08-04 Thread Syed Mushtaq
Hi , I have an app that I want to ship as a windows binary . I was looking at http://web2py.com/book/default/chapter/12#How-to-Distribute-your-Applications-as-Binaries. I use PIL in my app for doing some image manipulation . It is possible to generate the windows binary of web2py which includes PI

[web2py] Re: Trouble with components

2011-08-04 Thread G
Hi Massimo, Thank you for the suggestions. I have implemented both, but neither helps with the original problem of having components with multiple buttons work with ajax=True. My new controller generates several forms each with just one button and with distinct formnames. It has an if form.accepts

[web2py] Re: Tiny example on uwsgidecorators+web2py

2011-08-04 Thread pbreit
That's what I do. I don't know how good this code is but it seems to work. Happy to see any improvements. auth.settings.register_onaccept.append(lambda form: send_email(type='register', recipient=auth.user.email, subject='Thanks for registering')) === model === # -*- coding: utf-8 -*-

[web2py] Re: web2py and mercurial workflow question

2011-08-04 Thread pbreit
Don't be too frightened by Fabric. I'm a complete newbie and got it working pretty quickly. Just keep it simple. It's really just a substitute for constantly ssh-ing in to your server and issuing a bunch of commands.

Re: [web2py] Re: MongoDB supported by DAL

2011-08-04 Thread pbreit
Someone probably needs to step up and try to work it out. I don't think it's going to get done with periodic status inquiries here.

[web2py] Re: default function of a controller

2011-08-04 Thread pbreit
That should be easy to support. In default.py: def user(): if request.args(0): user = request.args(0) ... else: # list ... def restaurant(): if request.args(0): restaurant = request.args(0) ... else: # list ...

[web2py] Database drivers lost

2011-08-04 Thread Matthew
I ran a functioning application using App Engine once. When I tried to run it again without GAE, I noticed that only the goolgle database driver was available now: Database drivers available: google And when I try to run the app, I get this error: Traceback (most recent call last): File "/

[web2py] Re: Do we need a Web2py micro-framework , or split web2py into multiple components ?

2011-08-04 Thread guruyaya
I have to say, the one thing I like about web2py, is the battaries included approch of django, taken to it's max. The only thing you need after downloading web2py exe, is a browser. Creating separate components, does not work for me, as I don't see myself taking any part of web2py to any other app,

[web2py] Re: customisation in dal.py - what is the best way

2011-08-04 Thread Vineet
@Massimo, Whether the MySQLdb module is also in-built in web2py or removed in lieu of pymysql; I mean to ask whether I should keep it separately in web2py folder for importing @Richard, I will again work on datatables with json this weekend & post the feedback here. Thanks. Vineet On Aug 5, 3:04

[web2py] Re: Do we need a Web2py micro-framework , or split web2py into multiple components ?

2011-08-04 Thread Gour-Gadadhara Dasa
On Thu, 4 Aug 2011 20:46:01 -0700 (PDT) guruyaya wrote: > I have to say, the one thing I like about web2py, is the battaries > included approch of django, taken to it's max. The only thing you need > after downloading web2py exe, is a browser. Creating separate > components, does not work for me,

[web2py] Re: customisation in dal.py - what is the best way

2011-08-04 Thread Vineet
@Massimo, If I get you right, the MySQLdb module is still there in web2py; and it is not replaced totally with pymysql; As such, we can choose from these 2 modules. Other statements would not break because pymysql is a drop-in replacement for MySQLdb. Is my understanding correct? @Richard, I will