[web2py] Re: REF: SQLFROM.grid

2012-11-20 Thread Teddy Nyambe
...Okey can someone explain what the user_signature=False switch...adding it to the grid changes everything and all buttons appear..changing it like so.. form = SQLFORM.grid(db.department, searchable=True, deletable=True, details

[web2py] Set: no tables selected

2012-11-20 Thread Amit
I have added button "Delete" beside Clear button on SQLFORM.grid and when user selects query and click on it , I am passing the query to my controller function and using regular expression I just prepending "db." and changing "=" to "==" and passing the query to the db() function but it throws

[web2py] REF: SQLFROM.grid

2012-11-20 Thread Teddy Nyambe
Hey all, Having trouble using SQLFORM.smartgrid/grid...this is how my controller looks like: def myfiles(): response.title=" Files in the system " grid = SQLFORM.grid(db.myfile,deletable=True, editable=True, details=False,create=True, csv=False) return dict(grid=grid) My view: {{exte

[web2py] Re: Need to save a multipage PDF

2012-11-20 Thread Paul Rykiel
Nevermind ... figured it out On Tuesday, November 20, 2012 3:06:22 PM UTC-6, Paul Rykiel wrote: > > Greetings everyone, > > this is my code and I am having difficulity creating a "Multipage" PDF to > save to a directory. > any assistance will be welcomed. > > Regards, > > def taggen_print():

[web2py] Re: I need a bit of Help with a function ! .. please ...

2012-11-20 Thread Don_X
when I tested it .. i get an error : I tried to change the line " if member.id == auth_user[args]" to "if member.id == auth_user.args " ... I get basically the same kind of error I am running out of ideas ... please help File "/home/www-data/web2py/applications/adminsoccer/controllers/pr

[web2py] I need a bit of Help with a function ! .. please ...

2012-11-20 Thread Don_X
In an app where users have their own profile page ! Once a user gets logged in with their credentials .. they get redirected to their own profile page with all of their edit functions and preferences etc ... ... OK ! all was good so far ... BUT when the user is browsing through the app, I want

[web2py] posts being deleted again?

2012-11-20 Thread Dave
I posted three replies to this thread: https://groups.google.com/forum/?fromgroups=#!topic/web2py/Z7ZoN6Bn6pU And all three have shown up as "deleted". I know Anthony and Massimo have said in the past they don't delete posts. Have other people seen this phantom post stealing ghost in Google G

[web2py] Looking for occasional per-project based help

2012-11-20 Thread Dave
I have some projects that I am working on and am looking for some help. Each project has differing levels of expertise necessary. Not much we are doing is super complicated. Necessary experience ranges from college intern to experienced programmer. Some things that are "must have" skills: *

Re: [web2py] Re: Extracting row id from url using request.args

2012-11-20 Thread Cliff Kachinske
It's been a while since I've played with smartgrid, but I seem to recall that the ID of the record being edited was always the final arg. And you can treat request.args as a list, so the ID of the record being edited is request.args[-1], or so it seems to me. On Tuesday, November 20, 2012 7:44:

[web2py] Proper way to reference logged user

2012-11-20 Thread Daniele
I am trying to build a model where each logged user can decide if he/she is a tutor or student or both. So the tutor table has to 'reference auth.settings.table_user_name' and student also has to have the same reference. The tutor/student/logged user have to be related by their id key I imagine.

[web2py] Re: custom built login form

2012-11-20 Thread Paolo Caruccio
In this group there are several discussions on this subject (i.e.https://groups.google.com/d/msg/web2py/gLTthVDhqFM/dWldB9xGavgJ ) Search for messages containing the word '_xml' We are replacing the original form.custom.begin value with a new one within which is the '_class' attribute >From web

[web2py] Re: issue with multi-select widget

2012-11-20 Thread SamD
Thanks, I found those fixes useful. At the same time, it is quite a pain to have a message of error saying the type is not correct just because the list we pass contains only one element or no element. Would'nt it be more convenient to force whatever is passed to behave as a list (of strings) ?

[web2py] Existing MySQL database

2012-11-20 Thread Dennis Mackin
I have an existing MySQL data with some existing tables. I'd like to use gluon.dal to insert data into these tables. How do I do it? It seem dal only parses tables that it creates. I'm looking for a method names something like "load_schema". I can use the _mysql module instead, but I plan to u

Re: [web2py] Re: Extracting row id from url using request.args

2012-11-20 Thread Michael Hall
In the end I have used a different slightly more messy approach. I am getting the record id from the args by using a conditional to test if it is in one of 2 possible positions. @auth.requires_login() def contact_manage(): form = SQLFORM.smartgrid(db.t_contact,linked_tables=['t_courses','t_

[web2py] perhaps a silly question about index

2012-11-20 Thread Brian Blais
Hello, I was just started using web2py, and came across this organizational question. It seems as if the default application points to http://127.0.0.1:8000/appname/default/index why doesn't it point to: http://127.0.0.1:8000/appname/index Is there a reason to have the controllers all in de

[web2py] Re: Converting legacy MySQL databases to web2py DAL

2012-11-20 Thread Gelasto Kounavi
At my part ,i ran the extract_mysql_models script but the output model file was not editable and also got ticket when I put it in the app folder as I tried to see what was happening with app admin. Any thoughts ? I 'm guessing I ' ll have to either rearrange my database or find a solution with

[web2py] how to modify auth_membership.group_id of a user after registration

2012-11-20 Thread sreekanth narayana
I am new to web2py. I added an extra field to default auth_user to select user type (student, lecturer ) from drop down. But how to modify the "auth_membership.group_id" of the user. Already I added these two roles in auth_group table. So after user submits registration his membership should

[web2py] Login error messages

2012-11-20 Thread Daniele
For some reason, I am not getting the right error messages to display on my login form. Right now, I'm getting the same errors that one should get upon registration, such as: Minimum length is 8 Must include at least 1 upper case Must include at least 1 number However, this is giving away too m

[web2py] Re: custom built login form

2012-11-20 Thread Daniele
Thanks that seems to have worked. This was totally undocumented (or if it was, it was in an obscure place because I looked quite hard for how to do this.) What does that XML("<%s %s>" % (form.tag, form._xml()[0])) line do exactly? Also, say I want to style the button now...how can I do that? On

Re: [web2py] Re: we should support this in DAL

2012-11-20 Thread Simon Ashley
The bottom line seems to be that we/ others need to start to use nosql engines to sort the issues. My guess is that, currently, critical mass is not present to rely on it for production sites. --

[web2py] Need to save a multipage PDF

2012-11-20 Thread Paul Rykiel
Greetings everyone, this is my code and I am having difficulity creating a "Multipage" PDF to save to a directory. any assistance will be welcomed. Regards, def taggen_print(): rows = db(db.bike_no.id > 0).select() for row in rows: tag_no = row.bike_typ+str(row.id) pfil

Re: [web2py] Re: SQLFORM.smartgrid and constraint

2012-11-20 Thread Jim Steil
Glad to hear. On Nov 20, 2012 12:34 PM, "vivek" wrote: > No I am wrong it works! > > Thank you so much! > > > > On Tuesday, November 20, 2012 10:10:03 PM UTC+4, vivek wrote: >> >> Nope that doesn't help. >> >> >> >> On Tuesday, November 20, 2012 9:46:10 PM UTC+4, Jim S wrote: >>> >>> Try changing

[web2py] Re: SQLFORM.smartgrid and constraint

2012-11-20 Thread vivek
No I am wrong it works! Thank you so much! On Tuesday, November 20, 2012 10:10:03 PM UTC+4, vivek wrote: > > Nope that doesn't help. > > > > On Tuesday, November 20, 2012 9:46:10 PM UTC+4, Jim S wrote: >> >> Try changing: >> >> constraints = {'db.quote':q_comm} >> >> to: >> >> constraints = {'

[web2py] Re: SQLFORM.smartgrid and constraint

2012-11-20 Thread vivek
Nope that doesn't help. On Tuesday, November 20, 2012 9:46:10 PM UTC+4, Jim S wrote: > > Try changing: > > constraints = {'db.quote':q_comm} > > to: > > constraints = {'quote':q_comm} > > Does that help? > > -Jim > > On Tuesday, November 20, 2012 9:06:15 AM UTC-6, vivek wrote: >> >> Hi , >> >>

[web2py] Re: SQLFORM.smartgrid and constraint

2012-11-20 Thread Jim S
Try changing: constraints = {'db.quote':q_comm} to: constraints = {'quote':q_comm} Does that help? -Jim On Tuesday, November 20, 2012 9:06:15 AM UTC-6, vivek wrote: > > Hi , > > I been using SQLFORM.smartgrid and constraint successfully in many > places. But for some reason my constrain

[web2py] Re: PDF to directory

2012-11-20 Thread Paul Rykiel
This works great, but it does not handle multiple pages in my PDF. here is my code: # Print Generated tags for bike intake def taggen_print(): rows = db(db.bike_no.id > 0).select() for row in rows: tag_no = row.bike_typ+str(row.id) pfile = tag_no+'_p.pdf' pdf = FPDF

Re: [web2py] images folder

2012-11-20 Thread Paul Rykiel
nevermind figured it out!! On Tuesday, November 20, 2012 10:41:50 AM UTC-6, Paul Rykiel wrote: > This is great, but the image is too large ... I tried width and height, > but I am not getting errors. > do I need to do something in a > > On Tuesday, November 20, 2012 10:29:10 AM UTC-6, Paul Ryk

Re: [web2py] images folder

2012-11-20 Thread Paul Rykiel
This is great, but the image is too large ... I tried width and height, but I am not getting errors. do I need to do something in a On Tuesday, November 20, 2012 10:29:10 AM UTC-6, Paul Rykiel wrote: > Thank you... will do! > On Tuesday, November 20, 2012 12:09:55 AM UTC-6, rochacbruno wrote:

Re: [web2py] images folder

2012-11-20 Thread Paul Rykiel
Thank you... will do! On Tuesday, November 20, 2012 12:09:55 AM UTC-6, rochacbruno wrote: > > > web2py/applications/*yourapp*/*static*/img*/logo.png* > * > * > *Put all those files under your app "static" folder and retrieve with* > * > * > * > * > > *Bruno Cezar Rocha** - @rochacbruno* > rocha...@

[web2py] Re: PDF to directory

2012-11-20 Thread Paul Rykiel
Thank you Peter, I will try and let you know On Tuesday, November 20, 2012 4:09:44 AM UTC-6, peter wrote: > > Okay, now I am understanding what you are after Paul. > > Try this > > pdf.output(name=request.folder+'/static/temp.pdf') > response.headers['Content-Disposition'] = 'attachment; >

Re: [web2py] Sending and Recieving JSON data...

2012-11-20 Thread howesc
i do a lot of: post_data = json.loads(request.body.read()) ... return json.dumps(retval) works nicely for me. :) On Sunday, November 18, 2012 10:09:15 PM UTC-8, Jonathan Lundell wrote: > > On 18 Nov 2012, at 9:54 PM, Jason Brower > > wrote: > > I still don't get it. T

[web2py] Re: Please help me, add button not work

2012-11-20 Thread howesc
have you tried putting some logging in cart_callback to see if it actually gets called? are there JS errors in the browser (check the error console)? have you used the developer tools (now built in to both FF and chrome) to inspect the HTML, and check the HTTP traffic between client and serve

[web2py] SQLFORM.smartgrid and constraint

2012-11-20 Thread vivek
Hi , I been using SQLFORM.smartgrid and constraint successfully in many places. But for some reason my constraint for this particular grid isnt working def approval(): response.title=" Quotes waiting approval " response.view = 'Final/quotes/qapproval.html' q_comm = db.quote.sta

[web2py] Running GAE locally - beginners question

2012-11-20 Thread Andy W
I am having trouble getting GAE to run a simple app on the desktop with GAE Launcher. Any pointers to what I am doing wrong would be appreciated! So far I have: 1. Downloaded web2py source (v 2.2.1) and installed GAE Launcher (on mac) 2. Created app.yaml from app.example.yaml in the main w

[web2py] Re: changing the look of a form

2012-11-20 Thread Paolo Caruccio
Login form like all web2py forms has an argument 'formstyle' that can take following values 'table3cols', 'table2cols', 'divs', 'ul' and 'bootstrap' Latter is not documented. Therefore, for login form simply apply in your controller (or also in model) but before auth.form call auth.settings.fo

Re: [web2py] SQLFORM.grid + Linked page with SQLFORM.grid

2012-11-20 Thread vivek
Hi, Nope that didnt work, the result is the same On Tuesday, November 20, 2012 6:10:25 PM UTC+4, Johann Spies wrote: > > On 20 November 2012 13:05, vivek >wrote: > >> Hi , >> I have a grid , with links to pages which has another grid. >> >> constraints = {'db.lead':qcomm} >> fo

Re: [web2py] SQLFORM.grid in LOAD

2012-11-20 Thread Johann Spies
On 20 November 2012 15:02, vivek wrote: > > Hi , > > I have a grid as a LOAD component , everything works fine , except > for delete. If i was to click on delete , and then cancel it (d

[web2py] Re: custom built login form

2012-11-20 Thread Paolo Caruccio
In order to apply attributes to a custom form you have to change form.custom.begin before. The following code should work: #view html {{extend 'layout.html'}} {{ # add class to form form['_class'] = "form-horizontal" # change form.custom.begin form.custom.begin = XML("<%s %s>" % (form.tag, form._

Re: [web2py] SQLFORM.grid + Linked page with SQLFORM.grid

2012-11-20 Thread Johann Spies
On 20 November 2012 13:05, vivek wrote: > Hi , > I have a grid , with links to pages which has another grid. > > constraints = {'db.lead':qcomm} > form = SQLFORM.smartgrid(db.lead,constraints = constraints,deletable= > False,details=False, links = [lambda row: A(SPAN(_class='icol-commen

[web2py] SQLFORM.grid in LOAD

2012-11-20 Thread vivek
Hi , I have a grid as a LOAD component , everything works fine , except for delete. If i was to click on delete , and then cancel it (delete button in grid) , the URL is reloaded a

Re: [web2py] Re: Bug? Invalid url puts python into a tight loop - 100% CPU

2012-11-20 Thread jc
You are correct of course, but to quote the book: "web2py includes two distinct URL rewrite systems: an easy-to-use parameter-based system for most use cases, and a flexible pattern-based system for more complex cases." You have to use the pattern based system to avoid the vulnerability, and I

[web2py] Re: Question about response.menu !! ...

2012-11-20 Thread Don_X
Thank you Massimo ! .. it was a bit tricky ... but I got it ! .. --

Re: [web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-20 Thread Amit
Thanks Niphold :), Now its working fineyeah I do agree that I am not so good in Javascript as I am having very less experience on web development..but I am very sure that with the guidance of you people I will definitely learn it fast :). On Tue, Nov 20, 2012 at 4:33 PM, Niphlod wrote: > >

[web2py] SQLFORM.grid + Linked page with SQLFORM.grid

2012-11-20 Thread vivek
Hi , I have a grid , with links to pages which has another grid. constraints = {'db.lead':qcomm} form = SQLFORM.smartgrid(db.lead,constraints = constraints,deletable= False,details=False, links = [lambda row: A(SPAN(_class='icol-comment'), _href=URL("lead","comm",args=[row.id])),lambda

Re: [web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-20 Thread Niphlod
On Tuesday, November 20, 2012 10:19:25 AM UTC+1, Amit wrote: > > If I use A instead of button then its calling perfectly but i have to show > Delete as a button not as a link. > Style the A as a button. With bootstrap's included just add a class = btn . > Second observation: if I am adding D

[web2py] Re: PDF to directory

2012-11-20 Thread peter
Okay, now I am understanding what you are after Paul. Try this pdf.output(name=request.folder+'/static/temp.pdf') response.headers['Content-Disposition'] = 'attachment; filename=abc.pdf'# to force download as attachment # replace abc with whatever pdf name you want the user to see.

[web2py] Re: admin interface + GAE

2012-11-20 Thread Sebastian Cambeo
http://code.google.com/p/web2py/issues/detail?id=1177 --

Re: [web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-20 Thread Amit
If I use A instead of button then its calling perfectly but i have to show Delete as a button not as a link. Second observation: if I am adding Delete button/link beside Search and Clear button, and if I click Query input field, its not showing query filling fields(drop down menu,conditional fields

[web2py] Re: changing the look of a form

2012-11-20 Thread Niphlod
somersaults ? Login form is just a normal form containing 2 fields, username (or email) and password, and an optional "remember me". Edit the default/user.html and you're good to go. Anyway, the part on custom forms is a little later on the chapter. http://web2py.com/book/default/chapter/07#Cust

[web2py] Re: Forcing minus for converted parameter names in form helpers

2012-11-20 Thread Daniel Gonzalez
Thanks Niphlod, this is working. For the record: def get_bootstrap_radio(options): ''' 1 2 3 ''' i = [] for value in options: i.append(BUTTON(value, _type="button", _class="btn")) return DIV(*i, _class='btn-group', **{'_data-toggle':

[web2py] Re: Unable to call the onclick on my custom button on SQLFORM.grid

2012-11-20 Thread Niphlod
whoopsy, did you try with a simple A instead of a button ? TAG.a('Delete',_id="px-delete",_type="button",_href=URL('test')) On Tuesday, November 20, 2012 6:27:18 AM UTC+1, Amit wrote: > > Thanks Niphold for sharing the example code, but still it is not working > means upon clicking on the "Delet

Re: [web2py] Re: we should support this in DAL

2012-11-20 Thread Niphlod
I agree on the most part, but DAL "just the way it is now" doesn't get in your way. The second you need a larger field, add some fields, etc, you change your model and with a NoSQL engine you're good to go. --

[web2py] Re: Forcing minus for converted parameter names in form helpers

2012-11-20 Thread Niphlod
this is beginning to be a FAQ http://web2py.com/books/default/chapter/29/05?search=data- On Tuesday, November 20, 2012 9:37:34 AM UTC+1, Daniel Gonzalez wrote: > > Hi, > > I am trying to create a radio component in a custom web2py form, using > twitter bootstrap styles, as explained > here

[web2py] Forcing minus for converted parameter names in form helpers

2012-11-20 Thread Daniel Gonzalez
Hi, I am trying to create a radio component in a custom web2py form, using twitter bootstrap styles, as explained here . In order for the button group to behave like a radio button, we need to specify the 'data-toggle="buttons-radio"'

[web2py] User Recaptcha With a Crud form

2012-11-20 Thread Hassan Alnatour
Dear ALL , How Can i Use Recaptcha with a crud form ?? Regards, --