[web2py] extending dal

2012-10-29 Thread guruyaya
Say I would like to create a project that uses eBay as a database. One of the things I'm dreaming of, is making ad hook storage engine, for the purpose of reading eBay listings. I'm not looking to hack DAL for this purpose (and make upgrades hard), but to extend DAL, and use it's built ins to

[web2py] Re: on_define=set_requirement does not work

2012-10-29 Thread Annet
Hi I think the hidden field option is the easiest to implement, however, custom validation, prevents me from publishing the hubID ... why ? This question made me go through my entire database model, which is completely node based, so almost every table references table 'node' and

[web2py] Re: SQLFORM.grid(db.mydb, fields=['name', 'info'] generate error type 'exceptions.AttributeError' 'str

2012-10-29 Thread Emilius Omeen
solved when use in controller default.py def sql_form(): sqlform=SQLFORM.grid(db.mydb, fields=[db.mydbname.name, db.mydbname.info]) return dict(sqlform=sqlform) --

[web2py] Showing a fixed URL for a web2py application

2012-10-29 Thread Daniel Gonzalez
Hi, In my application, I would like the URL being shown to the user to be always the same (http://www.myapp.com), no matter what page the user is currently browsing. The idea is that the user should not be confused about the internal structure of my application. The links in the page would

[web2py] Re: admin app 4 x slower with 2.2.1 versus 2.0.9

2012-10-29 Thread Niphlod
No need to apologize: probably I had to explain myself better what I meant as bulky. As for execute/test functions if those are the ones serving a webpage, I'd say go directly to the app/controller/function with your browser. I normally have 4/5 functions I work on simultaneously and it's not

Re: [web2py] Re: GWT, CSS and Web2Py

2012-10-29 Thread Joe Barnhart
Well back on your original topic, I don't see why web2py would be in any way unsuitable for a GWT front end, since it speaks fluent JSON and XML and has such grace when it comes to writing controllers for this kind of purpose. The only issue is getting the layout.html just right with the

[web2py] Dropbox backup of sqlite database

2012-10-29 Thread peter
I thought I would share some routines I find useful for backing up sqlite to dropbox I believe safely. The nice thing about backing up to dropbox, is that the backup ends up on your local machine and so can be backed up more safely from there. First execute 'setup_dropbox'. This should only

[web2py] Re: Help With Dropbox idea

2012-10-29 Thread peter
I have posted a related solution Dropbox backup of sqlite databasehttps://groups.google.com/forum/?fromgroups=#!topic/web2py/p1QeoKltkL8 in this forum Peter On Monday, 22 October 2012 12:48:28 UTC+1, Hassan Alnatour wrote: Dear ALL , I want to make function that makes a csv file from my

Re: [web2py] Re: GWT, CSS and Web2Py

2012-10-29 Thread Carl Roach
Coming from Pyjamas I lifted its approach to build a Web2py View HTML file. My question was: does anyone manage the CSS of their Web2py server pages and their GWT client app together? And I was going to follow-up with: What issues did they have to overcome? Are they using CSS variables between the

[web2py] Re: Showing a fixed URL for a web2py application

2012-10-29 Thread David Marko
Simply use one frame, and entire application inside Dne pondělí, 29. října 2012 10:47:25 UTC+1 Daniel Gonzalez napsal(a): Hi, In my application, I would like the URL being shown to the user to be always the same (http://www.myapp.com), no matter what page the user is currently

[web2py] Re: Dropbox backup of sqlite database

2012-10-29 Thread Niphlod
ps: don't use os.getcwd() + '/applications/' + request.application . Use request.folder. On Monday, October 29, 2012 12:08:27 PM UTC+1, peter wrote: I thought I would share some routines I find useful for backing up sqlite to dropbox I believe safely. The nice thing about backing up to

[web2py] Re: Dropbox backup of sqlite database

2012-10-29 Thread peter
Okay thanks that is much neater. Peter On Monday, 29 October 2012 11:47:57 UTC, Niphlod wrote: ps: don't use os.getcwd() + '/applications/' + request.application . Use request.folder. On Monday, October 29, 2012 12:08:27 PM UTC+1, peter wrote: I thought I would share some routines I find

[web2py] Re: datdbase update

2012-10-29 Thread alazar baharu
10qs bro for your great answer i have solved my problems using your sujestions On Saturday, October 27, 2012 5:15:29 AM UTC-7, Niphlod wrote: that is an update fired for every single row. to get one update statement, you can use the more concise way

[web2py] scheduler and mongodb

2012-10-29 Thread Adi
This simple insert into mongodb works fine when called from within same application, but not when called from a scheduler on nginx, uwsgi, pymongo. Scheduler reports task as COMPLETED and all other inserts into mysql from the same function work well. What's more interesting, same scheduler

[web2py] Re: A Web2py CMS like Joomla ?

2012-10-29 Thread Ivan G
I am new to Python (leaving php) and new to web2py. I have tried to learn django, but the break of backwards compatibily made I leave it quickly, because was difficult to find expert people with the new versions and probably more backward compatibility breakings, so web2py seems a very good

[web2py] Add username to auth_users

2012-10-29 Thread Paul Hartley
I wish users to login using their username so I would like to add username to the users table. So far I have made this change auth.define_tables(username=True, signature=False) which adds the field(column) to the table. However I read that I should also impose uniqueness on the field by using

[web2py] Re: Formatter and values=None problem

2012-10-29 Thread Friedrich Weber
Hi there! For me, this change breaks optional `date` fields. Until now, I had a field like this: Field('somefield', type='date', label=T('...')), The value could be NULL, in which case `None` was displayed in a `SQLFORM.grid`. Now, this code crashes with: AttributeError:

[web2py] Re: scheduler and mongodb

2012-10-29 Thread Niphlod
is there a commit in the functions? Functions executed in the scheduler environment are like the ones you use in the web2py shell: you have to manually commit them to save your results. On Monday, October 29, 2012 2:59:22 PM UTC+1, Adi wrote: This simple insert into mongodb works fine when

Re: [web2py] Re: scheduler and mongodb

2012-10-29 Thread Adnan Smajlovic
yes, i had it for mysql and that worked fine, but my understanding is that mongodb doesn't have commit... but i'll look in that direction to see if there is something similar... Mind you, when I insert task from my local machine, document gets inserted into mongodb properly through scheduler.

Re: [web2py] Re: Dropbox Error : to many values to unpack

2012-10-29 Thread peter
I tried the example in the book in 2.1.1 It logs in okay, but when I try stream = open('afile.txt','rb') mydropbox.put('destfile.txt',stream) I get a ticket 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. Traceback (most recent call last): File C:\Users\Peter\web2pyp1\gluon\restricted.py,

[web2py] scheduler and requires_https

2012-10-29 Thread Martin Weissenboeck
I am using the scheduler to send emails. Now I have got dozens of messages like: Traceback (most recent call last): File /users/www-data/web2py/gluon/scheduler.py, line 216, in executor _env = env(a=a, c=c, import_models=True) File /users/www-data/web2py/gluon/shell.py, line 134, in env

[web2py] Re: Formatter and values=None problem

2012-10-29 Thread Massimo Di Pierro
This is what was talking about. I have fixed all the validators but think may break third party custom validators this change is not backward compatible. On Monday, 29 October 2012 07:04:05 UTC-5, Friedrich Weber wrote: Hi there! For me, this change breaks optional `date` fields. Until

[web2py] Re: admin app 4 x slower with 2.2.1 versus 2.0.9

2012-10-29 Thread Simon Ashley
Yep, that makes a lot of sense. Tried that approach with Komodo, and certainly is more productive. Just a change in mind set. Thanks for your reply. --

[web2py] really hard using bootstrap input-append and add-on because of web2py error mechanism

2012-10-29 Thread Richard
Hello, I am searching for a way to use bootstrap input-append and add-on. div class=w2p_fw input class=date id=table_date name=date placeholder=-MM-DD type=text value= span class=add-oni class=icon-calendar/i/span /div The problem is that when the error trigger the error get between the

[web2py] Re: scheduler and mongodb

2012-10-29 Thread Adi
Niphlod... you have full right to punch me :) the problem was that the scheduler from other server was working all this time, and mongo changes i introduced actually never kicked in (I counted on scheduler running from this server)... Now, I'll hide for some time, while re-arranging the task

[web2py] Re: scheduler and mongodb

2012-10-29 Thread Niphlod
no probl, I was only suggesting the first thing that users forget. PS: unless you have to track something and/or prioritize and/or find the exceptions in your code (timeouts, etc), you can reduce the complexity embedding functions into functions, i.e. def test(): #do something def

[web2py] Question about Cache

2012-10-29 Thread David Simmons
Hi I understand the concept of cache but I don't understand the statement below. Would someone be willing to try and explain it to me in a different way (in the vain hope that I might actually understand it :-)) Note, time_expire is used to compare the current time with the time the

[web2py] Re: validate table cell

2012-10-29 Thread howesc
it sounds like something that you want to do in javascript. search for how to write onSubmit methods for JS. I personally like to use jQuery to help me select things and then create your validation. On Thursday, October 25, 2012 2:41:35 AM UTC-7, Wouter Pronk wrote: Hello All, I have a

Re: [web2py] Re: SQLFORM.smartgrid oncreate,ondelete not firing

2012-10-29 Thread howesc
something like: def myondelete(table, row_id): pass form = SQLFORM.smartgrid(..., ondelete=myondelete, ...) On Sunday, October 28, 2012 6:57:12 AM UTC-7, vivek wrote: So how would the new code be? I am a newbie a bit of direction needed! On Sun, Oct 28, 2012 at 5:39 PM, Niphlod

[web2py] Re: Manual upload to database fails to write blob

2012-10-29 Thread David Phillips
So I thought the problem might go away if I changed the definition of the table to: thumb_field = Field (thumb, upload, uploadfield = thumb_data) db.define_table (images, Field (image, upload, uploadfield = image_data, requires = IS_IMAGE (extensions = ('bmp', 'gif', 'jpeg', 'jpg', 'png'),

[web2py] Re: Question about Cache

2012-10-29 Thread Niphlod
cache.ram behaves a little different from other caching systems (with redis or memcache you find the usual cache algorithm). Cache.ram currently behaves storing indefinitely your object, and retrieves (or updates) the key based on time_expire (that's why it's recommended to use a finite set of

[web2py] Re: Question about Cache

2012-10-29 Thread David Simmons
Hi Niphlod thank you for your clear explanation. Do you know why cache.ram behave this way (as it is different to standard cache behaviour). many thanks Dave --

Re: [web2py] really hard using bootstrap input-append and add-on because of web2py error mechanism

2012-10-29 Thread Richard Vézina
I work around my problem like this : Add this little script in the view script jQuery(document).ready(function(){ jQuery('.input_wrapper').has('.error').addClass(inputError); // Add bootstrap class inputError to .input_wrapper div when there is error. Note .input_wrapper div is only there

Re: [web2py] really hard using bootstrap input-append and add-on because of web2py error mechanism

2012-10-29 Thread Paolo Caruccio
another workaround (without jquery) is (exemplifying): ''' replace my_table, my_field_date_name with your own values ''' ### controller ### def my_controller: form = SQLFORM(db.my_table,formstyle = 'bootstrap') if form.process().accepted: response.flash = 'form accepted' elif form.errors:

[web2py] Re: Question about Cache

2012-10-29 Thread Niphlod
as I said, for historical reasons. There are (as always) pros and cons with every implementation. Here I think prevailed the doesn't matter if cache gets large over I must check for every call if there are keys ready to be removed (can be tricky to implement something like that with costant

[web2py] Re: scheduler and requires_https

2012-10-29 Thread Niphlod
gotcha, we forgot to apply a patch when it was pointed out. Working on that as we speak --

[web2py] problems rendering a tab using SQLFORM.grid

2012-10-29 Thread Manuele Pesenti
Hi! I'm trying to render this following query with a grid: tab = mytable orderby = [tab[f] for f in ('municipio', 'quartiere', )] + [~tab['den_tot']] fields = [tab[f] for f in ('municipio', 'quartiere', 'desvia', 'den_tot', 'den_predatori', 'den_dann', 'den_confl', )] query =

[web2py] Re: scheduler and requires_https

2012-10-29 Thread Niphlod
PS: if you're on a rush, the problem is that requires_https() doesn't check if it's running within the scheduler. instead of request.requires_https() do cmd_options = request.global_settings.cmd_options if not (cmd_options and cmd_options.scheduler): request.requires_https() PS: this was

[web2py] Re: Question about Cache

2012-10-29 Thread David Simmons
Thanks Niphlod --

[web2py] Single page apps vs Web2py

2012-10-29 Thread António Ramos
Hello all I am a litle away from web2py in the last year and discovered a lot of other technologies (node, coffeescript,backbone,jade,stylus). Single Page Apps , they say, are the future.First client gets the page and then only data is transferred to the client. This i recognize to be a good

[web2py] Re: Single page apps vs Web2py

2012-10-29 Thread Niphlod
with single-paged-apps you're basically pushing models and controllers logics away from web2py and towards javascript embedded into the page. Web2py doesn't need anything 'more' out of the box to work with that concept, you just have to code more logic using javascript and/or views. At that

[web2py] Re: extending dal

2012-10-29 Thread howesc
i'm not claiming to be an expert herebut each database connector is a class, for example, my current favorite: class GoogleDatastoreAdapter(NoSQLAdapter): so i suspect you can create an Adapter class and use it with the DAL with little or no modifications to DAL.py. I've not tried it

Re: [web2py] Re: Dropbox Error : to many values to unpack

2012-10-29 Thread Massimo Di Pierro
I think I know what the problem is. I made a change in trunk. Can you check if it solves it? On Monday, 29 October 2012 10:01:26 UTC-5, peter wrote: I tried the example in the book in 2.1.1 It logs in okay, but when I try stream = open('afile.txt','rb')

[web2py] Re: Formatter and values=None problem

2012-10-29 Thread Massimo Di Pierro
I am reverting this. sorry. On Monday, 29 October 2012 10:09:35 UTC-5, Massimo Di Pierro wrote: This is what was talking about. I have fixed all the validators but think may break third party custom validators this change is not backward compatible. On Monday, 29 October 2012 07:04:05

[web2py] Enterprise Architect :: Dover, DE

2012-10-29 Thread Ankush Chaudhary
Hi, Please do let me know your interest for this position. DIRECT CLIENT In person interview is needed: Location: Dover, DE Duration: 12+ months Rate: $open/hr C2C Skills needed: Experience evaluating architecture Required 4 Years Experience evaluating designs and

[web2py] left / right side bars odd behaviors

2012-10-29 Thread Stephen Ekoka
Hey folks, I'm getting weird behaviors setting up the left and/or right sidebars from the default/index.html of the scaffolding app. This is what I get: 1. {{left_sidebar_enabled,right_sidebar_enabled=False,('message' in globals())}} -- this is the default setting but... -- I don't quite get