Re: [web2py] Re: MongoDB and Web2Py
+1 On 1 April 2011 06:35, David Marko dma...@tiscali.cz wrote: I'm also interested in testing ... David Marko
[web2py] Re: GSOC 2011 - BioChemical Reaction Network Visualization - web2py
can you summarize for us, what is done, what needs to be done. so far we have experiences visualizing biochemical networks with tools like Cytoscape, Graphviz, ... we even wrote our own web2py plugin to create force directed graphs http://groups.google.com/group/web2py/browse_thread/thread/d9c5b9ef9ddf2e49/63cec30770d1ef9f?lnk=gst and we have drawn tons of network images by hand, but this is not enough, what we really need is 1) a fast layout algorithm that creates good layout for biochemical graphs (better than force directed, ...) 2) a js library that renders these layouts in a standard compiant way in SVG, - so far the only standard for drawing biochemical networks out there is SBGN (http://sbgn.org/Main_Page see here for some examples) and we intend to use that - SVG images because the can be displayed in a browser (http:// slides.html5rocks.com/) - SVG images can be edited with (e.g. Inkskape) and that is crucial since no layout algorithm will generate images good enough for publications, wikipeda, ... 3) a communication layer that calls our new layout algorithm (and possibly others that are available) and uses the js lib to show the result in a browser, this is where web2py could act as the communication layer 4) an extension to the js library 2) so that the images can edited on the web (this will also have to communicate to 3) somehow) - this lowers the border for people to create standard compliant images 5) an extension to the communication layer 3) so that it access all kinds of databases that contain biochemical reaction networks and visualizes them (we have plenty of experinces with that, but it is hard work every time you want to do something like that) you probably see that all the ideas depend on each other and that some of the steps can be unified/done by one developer so far a lot of people are interested in 1) and also some in 2) but for 3) we there was nobody really showing much interest The development will start from scratch but we a optimistic that we will have some good results within the two month with a team of 3 students and about 6 mentors Finally I should mention that we have a experience in using web2py (http://pymantis.org/ http://semanticsbml.org/semanticSBML/ http://sysbio-goods.org/ ...) and other tools and programming languages (some of the tools developed in our group: http://www2.hu-berlin.de/biologie/theorybp/index.php?goto=tools)
Re: [web2py] Re: clean database
Jonathan was talking about how the w2p is generated. It's only a compressed file: tar.gz. Always you can digg in the code http://code.google.com/p/web2py/source/browse/gluon/fileutils.py#183 and http://code.google.com/p/web2py/source/browse/gluon/fileutils.py#218 make your own that only include the files and the subdirectorys that you want. Or search in the web about python make tar.gz or compress file. 2011/4/1 LightOfMooN vladsale...@yandex.ru No, I'm using postgres On 1 апр, 02:08, Johann Spies johann.sp...@gmail.com wrote: On 29 March 2011 15:13, LightOfMooN vladsale...@yandex.ru wrote: Yes, thanks, it's good. But first question stills opened: Is there a way to pack just app code? (to *.w2p) I think if you use sqlite as database, it is included but when you use something like PostgreSQL or MySQL the data will not be part of the package. Regards Johann -- May grace and peace be yours in abundance through the full knowledge of God and of Jesus our Lord! His divine power has given us everything we need for life and godliness through the full knowledge of the one who called us by his own glory and excellence. 2 Pet. 1:2b,3a -- My blog: http://martin.tecnodoc.com.ar Expert4Solution: http://www.experts4solutions.com/e4s/default/expert/6 http://www.cvstash.com/profile/Xzi5bWCdD
Re: [web2py] recaptcha or requires login for comments
also I need to localize reCaptcha, any easy way in web2py?
[web2py] Re: datetime, DAL and JSON serialization
Sorry for the long reply time (I am working at two jobs and didn't have time to get to it yet). I can supply the following simple example: the data model is: db.define_table(timestamps, Field(by, db.auth_user), Field(at, datetime, default=request.now)) and the controller function is: @service.jsonrpc def test_json(): data = [] timestamps = db(db.timestamps.id 0).select() for ts in timestamps: data.append(dict(by = ts.by.first_name, at = ts.at)) return data When I try to call this from my application (qooxdoo app) I receive the following JSONRPCError: TypeError: datetime.datetime(2010, 11, 10, 10, 33, 22) is not JSON serializable. I think this is different from the behavior in previous versions where I simply got a string back in return. If I go to the test_json view directly through the browser I get the following response: {'2 {'at': 2 {'at': datetime.datetime(2010, 11, 10, 10, 56, 58), 'by': 'Andreas'} 2 {'at': datetime.datetime(2010, 11, 10, 10, 58, 40), 'by': 'Andreas'} 2 {'at': datetime.datetime(2010, 11, 10, 11, 44, 11), 'by': 'Andreas'} {'2 {'at': 2 {'at': datetime.datetime(2010, 11, 10, 11, 48, 17), 'by': 'Andreas'} 2 {'at': datetime.datetime(2010, 11, 10, 11, 55, 12), 'by': 'Andreas'} 2 {'at': datetime.datetime(2010, 11, 10, 11, 58, 7), 'by': 'Andreas'} {'2 {'at': 2 {'at': datetime.datetime(2010, 11, 10, 12, 7, 50), 'by': 'Andreas'} 2 {'at': datetime.datetime(2010, 11, 10, 12, 17, 9), 'by': 'Andreas'} 2 {'at': datetime.datetime(2010, 11, 10, 12, 20, 20), 'by': 'Andreas'} I think it might be related to the detect_types change nick name has hinted at. Am i right? I have tried to look through the Service class source to understand if it uses as_list or not, but I haven't been able to ascertain when a function receives the as_list attribute. Any help would be greatly appreciated, and thanks for the extremely good work on web2py (it seems I keep saying it, but it is really and truly appreciated!) Omri
[web2py] Garbaginator
f.y.i. A Django blog mentions a garbage collection problem in most python frameworks, and web2py is also mentioned: http://pydanny.blogspot.com/2011/03/announcing-garbaginator.html
[web2py] Re: Garbaginator
It is one of the April's fools jokes There is more than one fake news here: http://www.reddit.com/r/Python/ On Apr 1, 7:08 am, cjrh caleb.hatti...@gmail.com wrote: f.y.i. A Django blog mentions a garbage collection problem in most python frameworks, and web2py is also mentioned: http://pydanny.blogspot.com/2011/03/announcing-garbaginator.html
[web2py] Uploaded file content issue.
Hello, as you know, Web2py transform the content and the name of a file when uploaded. I tried several time to expose the real content of the file But I always have Fieldstorage and other information at the begining. I can't get rid of this. The file content are like: FieldStorage('file_path', 'C:\\Documents and Settings\\w7774455\ \Desktop\\test.csv', 'contentline1\r\ncontentline2\r\n') I just want to be able to expose : contentline1 contentline2 Used controllers : def listfile(): files = db().select(db.Files.ALL) return dict (files=files) def exposecsv(): import csv filename=request.args[0] content = os.path.join(request.folder,'uploads/','%s' % filename) content1 = open(content, 'r') content2 = csv.reader(content1, delimiter=',') return dict(content2=content2) It would be very helpful if someone have an idea. Thank for reading me. Limesle
[web2py] Re: MongoDB and Web2Py
I'd also like to help with web2py+mongodb.
[web2py] Re: Garbaginator
On Apr 1, 2:29 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: It is one of the April's fools jokes There is more than one fake news here:http://www.reddit.com/r/Python/ Ha Ha. I suspected something was up when I had a quick look at the source repo after I posted the link here. I think I need a holiday :)
[web2py] Re: issues with session.auth.last_visit for login expiration?
Hi, can anyone please confirm or correct the behavior I'm describing above?. Thanks, Carlos
[web2py] [FUN] Python at your feet
The road to web2py is a too steep climb? put Python at your feet! http://www.lasportiva.com/magazine/?p=1176lang=en (disclaimer: i am not affiliated in any way to the above brand)
[web2py] Oracle Offers to Buy Web2py! ! !
In an unusual move, Oracle offers to buy Web2py. Ha Ha! April Fool Mr.Netadmin
Re: [web2py] Re: Garbaginator
Web.2.py Garbaginator Bridgerator ('cause people always get Web2Py and web.py confused with each other so we bridged them together) http://garbaginator.cartwheelweb.com/ DJ2PY Allied Forces is the best joke of the day! -- Bruno Rocha [ About me: http://zerp.ly/rochacbruno ] On Fri, Apr 1, 2011 at 9:38 AM, cjrh caleb.hatti...@gmail.com wrote: On Apr 1, 2:29 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: It is one of the April's fools jokes There is more than one fake news here:http://www.reddit.com/r/Python/ Ha Ha. I suspected something was up when I had a quick look at the source repo after I posted the link here. I think I need a holiday :)
[web2py] Re: Garbaginator
On Friday, April 1, 2011 8:29:47 AM UTC-4, Massimo Di Pierro wrote: It is one of the April's fools jokes There is more than one fake news here: http://www.reddit.com/r/Python/ Yeah, now even Flask is going Enterprise. :) http://www.reddit.com/r/Python/comments/gfxzf/we_just_released_flaskenterprise_enterprise_level/
Re: [web2py] Oracle Offers to Buy Web2py! ! !
...on condition that it be rewritten in Java.
Re: [web2py] Oracle Offers to Buy Web2py! ! !
web2py is just a scripting framework on top of jython which runs on jvm, so they can buy it :)
[web2py] LinkedIn Python group talks web frameworks
The Python Community group has a discussion on replacing ASP pages with python frameworks. http://www.linkedin.com/groups?home=gid=25827 I think this is a good place for regular updates on web2py (such as the video webcasts) to be announced.
[web2py] Bug in Dal: import for csv
When importing the database from csv, it appears that it does not update the reference id's in list:reference. It looks like to me that only references are mapped to their new values and list:reference is just grabbed as a string. In dal.py, within import_from_csv, the fix function seems to just convert all lists to string or int and never runs the items within list:reference through the id map. def fix(field, value, id_map): if value == null: value = None elif field.type.startswith('list:string'): value = bar_decode_string(value) elif field.type.startswith('list:'): value = bar_decode_integer(value) elif id_map and field.type.startswith('reference'): try: value = id_map[field.type[9:].strip()][value] except KeyError: pass return (field.name, value) I believe a fix would be to check for list:reference and then pass it through bar_code_string and then for each item map its values, but I have been unsuccessful so far.
[web2py] Re: odata
Just skimmed over it. Looks very powerful and promising. If it's easy to implement with parse_as_rest it would be a great feature for web2py! There are still not many consumers (http://www.odata.org/consumers), but nevertheless it'd be worth IMHO. (Unfortunately no Python client library seems to exist.) On 31 Mrz., 05:47, Massimo Di Pierro massimo.dipie...@gmail.com wrote: what do you think about this? http://www.odata.org/developers/protocols/uri-conventions perhaps the new db.parse_as_rest(patterns,args,vars) should also support odata formats db.parse_as_rest('odata',args,vars) It would not take that much work. Is it valuable?
[web2py] Re: MongoDB and Web2Py
Despite a lot of time, I'd like to help as well. MongoDB looks promising. On 1 Apr., 04:58, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Lots of people asked for support but nobody volunteered to help test it. If you are interested and can help with some regular tests we can make it work in relatively short time. Massimo On Mar 31, 9:09 pm, luckysmack luckysm...@gmail.com wrote: I have read a few older messages about mongoDB being made to work with the DAL. But they all seem to be pretty dated and have not specified what was working and what wasnt. massimo menitoned that it may be ready by january of this year. But under the supported list it wasnt listed. So im just curious as to what the status of using mongoDB is with web2py and if anyone has a basic example on how I would use it. Thanks
Re: [web2py] Re: MongoDB and Web2Py
While DAL might not support MongDB; you can still use it via mongoengine; On 4/1/11 10:41 AM, Marcel Luethi wrote: Despite a lot of time, I'd like to help as well. MongoDB looks promising. On 1 Apr., 04:58, Massimo Di Pierromassimo.dipie...@gmail.com wrote: Lots of people asked for support but nobody volunteered to help test it. If you are interested and can help with some regular tests we can make it work in relatively short time. Massimo On Mar 31, 9:09 pm, luckysmackluckysm...@gmail.com wrote: I have read a few older messages about mongoDB being made to work with the DAL. But they all seem to be pretty dated and have not specified what was working and what wasnt. massimo menitoned that it may be ready by january of this year. But under the supported list it wasnt listed. So im just curious as to what the status of using mongoDB is with web2py and if anyone has a basic example on how I would use it. Thanks
[web2py] Re: Question for mac users....
The extra shared memory allows PostgreSQL to cache more and perform better. It's mostly for production servers. It shouldn't have any adverse effects on the Mac. If it's the same setting I'm thinking of, then all it does is increase the amount of shared ram a single application can use. If it does mess anything up, then just delete the /etc/sysctl.conf file and when you reboot, the file will be rebuilt by the Mac to its default settings automatically.
[web2py] DAL: all database connections should be made by using the credentials of the authenticated user?!?!
I have been experimenting with web2py for a while. I have used only sqlite so far. However, in the future I would like to create new a web interface upon our existing mysql database. Currently we are using MS Access based user interfaces. MS Access connects to mysql by using ODBC driver and each user has their own user account and permissions defined in mysql database. I managed to create a new login_method (mysql_auth.py in gluon.contrib.login_methods) to allow users to login by using their current credentials (defined in mysql database: mysql.user). Next step would be to modify my app so that each database connection will be made by using the credentials of the authenticated user. Currently i have defined one web2py-user in mysql database to allow web2py applications to connect our test database. This is not allowed in our production database! We need to do all the database operations (especially delete, insert and update) by using the credentials of authenticated user. Is this possible in web2py? Teemu
[web2py] Re: CVStash finally launched! Thanks for all the help :-)
Thanks for props guys ;-) @Martin: I was actually looking on enhancing the entry description field, in which I stumbled upon markitup, which should be supporting markmin. I just made the enhancement a while ago. Regards, Arbie On Apr 1, 3:37 am, Martín Mulone mulone.mar...@gmail.com wrote: I like it, perhaps you can add markmin support. 2011/3/31 Martín Mulone mulone.mar...@gmail.com great job. +1 2011/3/31 Massimo Di Pierro massimo.dipie...@gmail.com +1 reposting the url:http://www.cvstash.com On Mar 31, 9:01 am, Arbie Samong phek...@gmail.com wrote: I ported the whole thing from django, took me like a couple of days, and I'm really impressed on how it makes most of the tasks trivial, easy and reliable. Most of the issues were having to make it work on GAE, but no biggie. Just wanna thank Massimo and the rest of the web2py folks for being awesome and helpful to beginners. I hope to contribute more in the future, soon as I could get my python- fu up to useful levels lol. In the meantime feel free to look around and tell me what you think, any feedback would be great; the site is a free service for with job seekers in mind. Regards, Arbie (www.cvstash.com) -- Pablo Martín Mulone (mar...@tecnodoc.com.ar) http://www.tecnodoc.com.ar/ My blog:http://martin.tecnodoc.com.ar Expert4Solution Profile: http://www.experts4solutions.com/e4s/default/expert/6 -- My blog:http://martin.tecnodoc.com.ar Expert4Solution:http://www.experts4solutions.com/e4s/default/expert/6http://www.cvstash.com/profile/Xzi5bWCdD
[web2py] Re: Garbaginator
Hmm didn't know Rails was a Python web framework, according to Garbaginator it is. :-) Check out gmail motion on Google home page
[web2py] little question about pack all
I created some app. Then packed it with pack all to install on VPS for deploy. When I install it, I have seen, that it didn't make postgres database structure, because of files in myapplication/database. Also all upload folder was packed. So, the question is: for what purpose pack all pack in w2p packet database and upload folder? I thought, this button is just for create an clear app packet, but I was wrong.
[web2py] web2py joins Pylons project
http://web2pyramid.pylonsproject.org/ -- Bruno Rocha [ About me: http://zerp.ly/rochacbruno ]
[web2py] auth.add_group
DISCLAIMER: very new to web2py, read book and building first app... I'm having some brain cramps trying to add some default groups. Basically I need some default groups set-up when I rollout my application, like Admins, End-Users, Management - when users register one of us will manually filter them into the right group (this is fine for our environment). What's the best way to do that? I just made some add_group lines in my model but it keeps recreating the group role on every launch and I got a bunch of duplicates. Thanks in Advance
[web2py] Re: web2py joins Pylons project
Happy April 1 to you too. On Apr 2, 1:50 am, Bruno Rocha rochacbr...@gmail.com wrote: http://web2pyramid.pylonsproject.org/ -- Bruno Rocha [ About me:http://zerp.ly/rochacbruno]
Re: [web2py] Re: web2py joins Pylons project
hahaha _ *Gilson Filho* *Web Developer http://gilsondev.com* 2011/4/1 CVstash dot com cvst...@gmail.com Happy April 1 to you too. On Apr 2, 1:50 am, Bruno Rocha rochacbr...@gmail.com wrote: http://web2pyramid.pylonsproject.org/ -- Bruno Rocha [ About me:http://zerp.ly/rochacbruno]
[web2py] Re: Garbaginator
I love this one: http://www.reddit.com/r/Python/comments/ggh70/the_pylons_project_announces_web2pyramid/ Massimo On Apr 1, 11:45 am, ron_m ron.mco...@gmail.com wrote: Hmm didn't know Rails was a Python web framework, according to Garbaginator it is. :-) Check out gmail motion on Google home page
[web2py] what drawback is there to web2py executing python files via execute?
Here is the comment - http://linkd.in/gNkdsa I read the web2py manual, and most what I saw in it is in the way thing should not be done. Without going into details, just the strategy of executing python files that are not modules with execute() make the framework a no-go.
[web2py] Re: auth.add_group
Yes, your model files will be executed upon every request, so you don't want to add the default groups there. The easiest method might be to add groups into the auth_groups table via appadmin (see http://web2py.com/book/default/chapter/03#More-on-appadmin). You can get to appadmin for your application by going to /yourapp/appadmin or by clicking the database administration button under Models on the application's edit page in the admin interface. Alternatively, you can run your app in an interactive shell via command line arguments (http://web2py.com/book/default/chapter/04#Command-Line-Options) and add the groups programmatically, as explained here: http://web2py.com/book/default/chapter/08#Authorization. You could also put your add_group code in a .py file and run it with your app via the -R command line option. Anthony On Friday, April 1, 2011 12:06:53 PM UTC-4, Mike wrote: DISCLAIMER: very new to web2py, read book and building first app... I'm having some brain cramps trying to add some default groups. Basically I need some default groups set-up when I rollout my application, like Admins, End-Users, Management - when users register one of us will manually filter them into the right group (this is fine for our environment). What's the best way to do that? I just made some add_group lines in my model but it keeps recreating the group role on every launch and I got a bunch of duplicates. Thanks in Advance
[web2py] Re: Garbaginator
On Friday, April 1, 2011 2:21:50 PM UTC-4, Massimo Di Pierro wrote: I love this one: http://www.reddit.com/r/Python/comments/ggh70/the_pylons_project_announces_web2pyramid/ That's pretty funny coming from a framework that had to take nearly 12,000 words to defend its own design decisions: http://docs.pylonsproject.org/projects/pyramid/1.0/designdefense.html They actually did a decent job highlighting some of web2py's benefits over other frameworks. All this attention is rather flattering. :)
[web2py] eliminate 'column-header' titles from query response?
This is probably simple but I can't find in the documentation or recognize anything posted on this. I have a primary database including fields which entries must be members of other databases - this is enforced through the primary database definition and select lists entry for the enforced membership fields: as recommended by the current manual. I must display the information entered on existing and later pages. Within the primary database the items entered through selected drop down lists appear as index which mean nothing to an end user. I can retrieve the indexed items by using something like in the controller/function: current_customer_name = db(db.customer_names.id==names.index).select('name') and is displayed in the view html with: {{=current_customer_name)) I need the results to be displayed in this form (which it does not): The Big Company It displays this (which won't work for me): NAME -- The Big Company I would appreciate any advice or pointers on where to look further. thanks in advance. James C.
[web2py] Re: auth.add_group
Nevermind. I thought there was a builtin web2py way for this but I just did this instead (after sifting more through the groups): def groupadd(check_group): if not db(db.auth_group.role==check_group).count(): db.auth_group.insert(role=check_group) groupadd('Admins') groupadd('Maintenance Users') groupadd('Download Users') auth.settings.register_onaccept=lambda form: auth.add_membership(auth.id_group('Download Users'),form.vars.id) -- On Apr 1, 12:06 pm, Mike m.she...@gmail.com wrote: DISCLAIMER: very new to web2py, read book and building first app... I'm having some brain cramps trying to add some default groups. Basically I need some default groups set-up when I rollout my application, like Admins, End-Users, Management - when users register one of us will manually filter them into the right group (this is fine for our environment). What's the best way to do that? I just made some add_group lines in my model but it keeps recreating the group role on every launch and I got a bunch of duplicates. Thanks in Advance
[web2py] Re: eliminate 'column-header' titles from query response?
On Apr 1, 3:24 pm, james c. james.cryp...@gmail.com wrote: This is probably simple but I can't find in the documentation or recognize anything posted on this. I have a primary database including fields which entries must be members of other databases - this is enforced through the primary database definition and select lists entry for the enforced membership fields: as recommended by the current manual. I must display the information entered on existing and later pages. Within the primary database the items entered through selected drop down lists appear as index which mean nothing to an end user. I can retrieve the indexed items by using something like in the controller/function: current_customer_name = db(db.customer_names.id==names.index).select('name') The select returns a Rows object, not just one row and not a field of that row so to get to the name field value you can do db(db.customer_names.id==names.index).select('name').first().name or db(db.customer_names.id==names.index).select('name')[0].name and then your variable will contain only the customer's name. and is displayed in the view html with: {{=current_customer_name)) I need the results to be displayed in this form (which it does not): The Big Company It displays this (which won't work for me): NAME -- The Big Company I would appreciate any advice or pointers on where to look further. thanks in advance. James C.
[web2py] april fools
from my country http://www.tigan.md/card1.aspx?id=7417ac7c-3188-4652-b9b2-362875219e70 from google http://www.google.com/mail/help/motion.html#utm_source=en-et-na-usutm_medium=new-features-linkutm_campaign=en
[web2py] Re: what drawback is there to web2py executing python files via execute?
Massimo has addressed this previously so it might be best to search the postings. Python programmers should definitely be careful about the use of exec but Massimo has made a very conscientious decision to use it. There are tradeoffs and many feel that the design decisions Web2py has made are beneficial. Dismissing a framework solely on the basis of the use of exec is extremely short-sighted. The poster really should go into details when making such a blanket assessment.
Re: [web2py] Re: web2py joins Pylons project
Pylons can only wish it has those features!
[web2py] app structural question
Hello, Im designing an application for license management of some software that my company produces. The intended workflow is as follows: 1) End-user of product registers on app, approval pending for review 2) When a user in the 'Admin' group logins they have access to a approval section where they can: 2a) approve the pending user, which will use onaccept to create a new group based off their company name (if it doesn't exist already)
[web2py] Re: app structural question
And your question is?
[web2py] Re: GAE 1.4.3 has support for mysql and sqlite?
haven't seen any news either. it's probably an indication that they are at least testing it. cfh
[web2py] Re: DAL: all database connections should be made by using the credentials of the authenticated user?!?!
Teemu, i have never tried it but i have an idea, but first a question: can you use web2py's built in history tracking with the authentication to preserve the information you need. i assume you are looking for an audit trail of who did what. i'm assuming you have already considered this so, then my idea... in your db.py file you probably have a line like: db = DAL('sqlite://storage.sqlite') # if not, use SQLite or other DB (but of course modified for your oracle connection). or actually in your case it sounds like you have a connection to a mysql database for auth, and then a connection to oracle for other data access. you could in db.py do something like: if auth.logged_in(): oracle_db = DAL('oracle://%s/%s'%(auth.user.oracle_username, auth.user.oracle_password)) ... define oracle tables here, or maybe in a separate model file... else: oracle_db = None (sorry for the bad oracle connection string, i haven't used it in a long time, but hopefully you get the idea) good luck! christian
[web2py] Re: Question for mac users....
Thanks for that! I guess its that easy way out I was looking for (removing that sysctl.conf file) thanks for the handy info! Mart :) On Apr 1, 11:29 am, Ross Peoples ross.peop...@gmail.com wrote: The extra shared memory allows PostgreSQL to cache more and perform better. It's mostly for production servers. It shouldn't have any adverse effects on the Mac. If it's the same setting I'm thinking of, then all it does is increase the amount of shared ram a single application can use. If it does mess anything up, then just delete the /etc/sysctl.conf file and when you reboot, the file will be rebuilt by the Mac to its default settings automatically.
[web2py] Re: app structural question
I think, he may be inquiring about workflow capabilities? If so, I don;t think web2py has workflow built in (I could be wrong), but can be concocted in a few different ways (depends on effort, time interest ;) ). If I remember, Massimo's conferencing app had some workflow features (something like submitting articles -. going to review - acceptance/refusal (i think), etc... based on roles. So, if workflow is the question, I would start there (although there may be more examples as well). Role definitions and workflow design can be an art in it self (some companies are dedicated to that)... so, inspiration could be had there as well (I.e. check out Adobe LiveCycle, on-line descriptions i believe have good description of process - may be a good starting point for ideas) Hope I win the guess ;) Mart :) On Apr 1, 4:58 pm, JorgeRpo jorgeh...@gmail.com wrote: And your question is?
[web2py] Re: auth.add_group
That's pretty close to what I did. Since my groups are created once and never changed I did one check to see if there are ANY groups created. If not, I create the ones I care about: if not db(db.auth_group).count(): db.auth_group.insert(role='root',description='Exactly what you think it does') db.auth_group.insert(role='super',description='Supervisor access for team manager') db.auth_group.insert(role='user',description='Normal user') This is in its own file in the models section. It is executed after the tables are created. (Model files are executed in alphabetical order, if you didn't know...) -- Joe B. On Apr 1, 11:22 am, Mike m.she...@gmail.com wrote: Nevermind. I thought there was a builtin web2py way for this but I just did this instead (after sifting more through the groups): def groupadd(check_group): if not db(db.auth_group.role==check_group).count(): db.auth_group.insert(role=check_group) groupadd('Admins') groupadd('Maintenance Users') groupadd('Download Users') auth.settings.register_onaccept=lambda form: auth.add_membership(auth.id_group('Download Users'),form.vars.id) -- On Apr 1, 12:06 pm, Mike m.she...@gmail.com wrote: DISCLAIMER: very new to web2py, read book and building first app... I'm having some brain cramps trying to add some default groups. Basically I need some default groups set-up when I rollout my application, like Admins, End-Users, Management - when users register one of us will manually filter them into the right group (this is fine for our environment). What's the best way to do that? I just made some add_group lines in my model but it keeps recreating the group role on every launch and I got a bunch of duplicates. Thanks in Advance
[web2py] Re: little question about pack all
It does not copy the DATA from your database. But the STRUCTURE is defined by the Python files in the models area. Your new application should create a new instance of the database with all tables initially empty. If you want to copy your table data, you can export the database to a CSV file and import it to another machine. There is a description of it in the online book: http://web2py.com/book/default/chapter/06#CSV-%28all-tables-at-once%29 -- Joe B. On Apr 1, 9:57 am, LightOfMooN vladsale...@yandex.ru wrote: I created some app. Then packed it with pack all to install on VPS for deploy. When I install it, I have seen, that it didn't make postgres database structure, because of files in myapplication/database. Also all upload folder was packed. So, the question is: for what purpose pack all pack in w2p packet database and upload folder? I thought, this button is just for create an clear app packet, but I was wrong.
[web2py] Re: app structural question
Correct, there's not built-in workflow. But there is built-in authentication and roles. If you keep it simple, shouldn't be too bad.
[web2py] Bug in populate?
I think there's a bug in the populate.py code: when a string field has an IS_IN_SET(['a','b','c','d']) validator, populate will also add a fifth option '' (zero length string). This follows from it reading the field.options set (which includes the zero length string *unless* you set zero=None in the constructor). I believe the right behaviour is to use field.theset() instead, which only includes the IS_IN_SET options without the zero length string. Does this make sense? Can anyone elaborate on the zero= option, and what it is useful for?
[web2py] Re: eliminate 'column-header' titles from query response?
Thanks Denes, Thank you Denes for your recommendations. I've seen documentation leading me to believe that most of this here should work. But it doesn't. 'Which reminds me that I have Python 2.6x installed and when I downloaded my current version, Version 1.91.6 (2011-01-03 17:55:14), there was a red 5 in the requirements Python 2.5x. It appears that many folks are now using 2.6x. I am going to upgrade and hope that addresses my issues. If anyone sees anything here or has more ideas I would appreciate the help or pointers to documentation. Thanks, James C. This is a very simple little test app for which I am implementing this very limited function, described here, working. I think the recommendation below should work. I also think that the use of .as_list() approach should work (however, there exists one additional character between the 'xoxoxo', characters which define the list - this may be confusing this approach.) I Tried both recommendations without any good results. The first recommendation is close to what I found in the documentation - neither would run. In either case the changes would not get beyond the editor. I could not find any documentation close to the second recommendation. The syntax might be wrong but could not find any further information to support that conclusion. After much lack of progress I tried a more direct approach using .as_list() The query I'm using and described earlier returns only one field, and that is customer name along with a database descriptive header. I tried the following in the controller: db(db.customer_names.id==names.index).select('name') current_c_name = db(db.customer_names.id==name_index).select('name') current_customer_name = current_c_name.as_list() display_name = current_customer_name[2] return dict(display_name,... in view: {{=display_name}} is also defined earlier with a default value. If just the entire 3 element list is displayed through {{=display_name}} it looks like: [{'_extra': {'name': u'The Big Company'}}] This goes wrong when trying to index the list current_customer_name[2]. What ever index is specified an index out of range error is returned. On Apr 1, 1:11 pm, DenesL denes1...@yahoo.ca wrote: On Apr 1, 3:24 pm, james c. james.cryp...@gmail.com wrote: This is probably simple but I can't find in the documentation or recognize anything posted on this. I have a primary database including fields which entries must be members of other databases - this is enforced through the primary database definition and select lists entry for the enforced membership fields: as recommended by the current manual. I must display the information entered on existing and later pages. Within the primary database the items entered through selected drop down lists appear as index which mean nothing to an end user. I can retrieve the indexed items by using something like in the controller/function: current_customer_name = db(db.customer_names.id==names.index).select('name') The select returns a Rows object, not just one row and not a field of that row so to get to the name field value you can do db(db.customer_names.id==names.index).select('name').first().name or db(db.customer_names.id==names.index).select('name')[0].name and then your variable will contain only the customer's name. and is displayed in the view html with: {{=current_customer_name)) I need the results to be displayed in this form (which it does not): The Big Company It displays this (which won't work for me): NAME -- The Big Company I would appreciate any advice or pointers on where to look further. thanks in advance. James C.
[web2py] psycopg2 on macos
so, I installed the the pre-built bins for macos from http://www.postgresql.org/download/ and when trying to connect to a remote DB, i get the 'psycopg2 is not defined' exception. A few days ago, Massimo pointed me to what seems like the obvious solution now (for windows) ;) install psycopg2. That worked well :) but on mac, it seems a little different 1) the quantity of stuff to download is enormous compared to what was needed for windows... and 2) not as intuitive (which is a little surprising). Does anyone know, what it is exactly I should be installing? I'm on macos, 10.6.something, and postgreSQL is 9.0.3. Thanks and any help is appreciated, Mart :)
[web2py] rendering database contents in layout
hello everybody, i like to display database records in sidebar of every page. i define the function that fetch the records and return as dictionary. then i put the function in default.py and return the result of the function every view function, it works fine. such as, def some_function(): ''fetch database records'' return rows def index(): rows = some_function() return dict(rows=rows) in layout.html: {{for row in rows:}} li{{=row}}/li {{pass}} But this approach is awkward. i like to hide sidebar rendering from main page rendering. There should be more beautiful approach in web2py. Is there any ideas? Thank you in advance.
[web2py] Re: rendering database contents in layout
You could define some_function in a model file (functions defined in model files are available in views, though functions defined in controllers are not), and then you could call it directly in your layout.html view (or you could call it within a separate sidebar view file, and then include that sidebar view in layout.html). For example: {{=some_function()['rows']}} Another option would be to include a component in your sidebar (see http://web2py.com/book/default/chapter/13#Components), either with or without using Ajax. For example: {{=LOAD(f='some_function', ajax=False)}} Anthony On Friday, April 1, 2011 11:25:29 PM UTC-4, kawate wrote: hello everybody, i like to display database records in sidebar of every page. i define the function that fetch the records and return as dictionary. then i put the function in default.py and return the result of the function every view function, it works fine. such as, def some_function(): ''fetch database records'' return rows def index(): rows = some_function() return dict(rows=rows) in layout.html: {{for row in rows:}} li{{=row}}/li {{pass}} But this approach is awkward. i like to hide sidebar rendering from main page rendering. There should be more beautiful approach in web2py. Is there any ideas? Thank you in advance.
[web2py] Re: eliminate 'column-header' titles from query response?
Are you saying that db(db.customer_names.id==names.index).select('name').first().name does not return just the name? Can you show your model code? Also, if you use as_list, you get a list of dictionaries (one dictionary per Row in the Rows object). If there is only one Row, then there is only one dictionary in the list, and therefore the maximum index of the list will be 0. If you try current_customer_name[2], it's looking for the third dictionary in the list (i.e., the third Row), which of course does not exist. The way you have defined current_customer_name, I think the actual name should be current_customer_name[0]['name'] (the [0] gets you the first dictionary in the list, and the ['name'] gets you the value associated with the 'name' key in that dictionary). But again, you shouldn't have to do it that way -- the query above should return the name directly without using as_list. Anthony On Friday, April 1, 2011 9:20:26 PM UTC-4, james c. wrote: Thanks Denes, Thank you Denes for your recommendations. I've seen documentation leading me to believe that most of this here should work. But it doesn't. 'Which reminds me that I have Python 2.6x installed and when I downloaded my current version, Version 1.91.6 (2011-01-03 17:55:14), there was a red 5 in the requirements Python 2.5x. It appears that many folks are now using 2.6x. I am going to upgrade and hope that addresses my issues. If anyone sees anything here or has more ideas I would appreciate the help or pointers to documentation. Thanks, James C. This is a very simple little test app for which I am implementing this very limited function, described here, working. I think the recommendation below should work. I also think that the use of .as_list() approach should work (however, there exists one additional character between the 'xoxoxo', characters which define the list - this may be confusing this approach.) I Tried both recommendations without any good results. The first recommendation is close to what I found in the documentation - neither would run. In either case the changes would not get beyond the editor. I could not find any documentation close to the second recommendation. The syntax might be wrong but could not find any further information to support that conclusion. After much lack of progress I tried a more direct approach using .as_list() The query I'm using and described earlier returns only one field, and that is customer name along with a database descriptive header. I tried the following in the controller: db(db.customer_names.id==names.index).select('name') current_c_name = db(db.customer_names.id==name_index).select('name') current_customer_name = current_c_name.as_list() display_name = current_customer_name[2] return dict(display_name,... in view: {{=display_name}} is also defined earlier with a default value. If just the entire 3 element list is displayed through {{=display_name}} it looks like: [{'_extra': {'name': u'The Big Company'}}] This goes wrong when trying to index the list current_customer_name[2]. What ever index is specified an index out of range error is returned. On Apr 1, 1:11 pm, DenesL dene...@yahoo.ca wrote: On Apr 1, 3:24 pm, james c. james@gmail.com wrote: This is probably simple but I can't find in the documentation or recognize anything posted on this. I have a primary database including fields which entries must be members of other databases - this is enforced through the primary database definition and select lists entry for the enforced membership fields: as recommended by the current manual. I must display the information entered on existing and later pages. Within the primary database the items entered through selected drop down lists appear as index which mean nothing to an end user. I can retrieve the indexed items by using something like in the controller/function: current_customer_name = db(db.customer_names.id==names.index).select('name') The select returns a Rows object, not just one row and not a field of that row so to get to the name field value you can do db(db.customer_names.id==names.index).select('name').first().name or db(db.customer_names.id==names.index).select('name')[0].name and then your variable will contain only the customer's name. and is displayed in the view html with: {{=current_customer_name)) I need the results to be displayed in this form (which it does not): The Big Company It displays this (which won't work for me): NAME -- The Big Company I would appreciate any advice or pointers on where to look further. thanks in advance. James C.
[web2py] Re: rendering database contents in layout
LOAD sounds like the perfect approach.
[web2py] Re: rendering database contents in layout
Thank you Anthony That is beautful!! On 4月2日, 午後12:57, Anthony abasta...@gmail.com wrote: You could define some_function in a model file (functions defined in model files are available in views, though functions defined in controllers are not), and then you could call it directly in your layout.html view (or you could call it within a separate sidebar view file, and then include that sidebar view in layout.html). For example: {{=some_function()['rows']}} Another option would be to include a component in your sidebar (seehttp://web2py.com/book/default/chapter/13#Components), either with or without using Ajax. For example: {{=LOAD(f='some_function', ajax=False)}} Anthony On Friday, April 1, 2011 11:25:29 PM UTC-4, kawate wrote: hello everybody, i like to display database records in sidebar of every page. i define the function that fetch the records and return as dictionary. then i put the function in default.py and return the result of the function every view function, it works fine. such as, def some_function(): ''fetch database records'' return rows def index(): rows = some_function() return dict(rows=rows) in layout.html: {{for row in rows:}} li{{=row}}/li {{pass}} But this approach is awkward. i like to hide sidebar rendering from main page rendering. There should be more beautiful approach in web2py. Is there any ideas? Thank you in advance.
[web2py] Re: web2py fabric, pip, virtualenv, virtualenvwrappers deployment scripts
Some other folks mentioned issues with installing PIL on OS X and I previously mentioned some binaries (they work, but you are stuck with Python 2.5). You can compile your own Python if you have XCode installed and then you should have no issues installing PIL to your virtualenvs or your system python. You can test the installation first in a virtualenv which might be a good idea if you are running an older version of OS X The target system in this example was OS X 10.4 [activate your virtualenv if you want to test] # install mkdir src cd src curl -O http://www.python.org/ftp/python/2.7.1/Python-2.7.1.tgz tar zxvf Python-2.7.1.tgz cd Python-2.7.1 ./configure --enable-framework MACOSX_DEPLOYMENT_TARGET=10.4 make sudo make frameworkinstall # test python Python 2.7.1 (r271:86832, Apr 2 2011, 00:11:44) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin Type help, copyright, credits or license for more information. Now you shoudl have no problems installing PIL # install Python Imaging Lib pip install PIL On Mar 25, 2:50 pm, pbreit pbreitenb...@gmail.com wrote: I had a lot of trouble getting reliable installs of PIL, especially on my Mac. What I currently do is apt-get install python-imaging which seems to work OK.
[web2py] mongoengine.org: can this work with web2py?
I would like to know if anybody has used mongoengine, it looks like an interesting project.
[web2py] Re: what drawback is there to web2py executing python files via execute?
On Apr 1, 8:21 pm, Terrence Brannon scheme...@gmail.com wrote: Here is the comment -http://linkd.in/gNkdsa I read the web2py manual, and most what I saw in it is in the way thing should not be done. Without going into details, just the strategy of executing python files that are not modules with execute() make the framework a no-go. If you seriously think that code execution is bad, consider that Python executes your own code each time you run it.With web2py, your web app code is being executed by the web2py framework. This need not be some mysterious thing. The key thing in the above quote is this phrase: Without going into details It's the one that always comes up.