Re: [web2py] Re: Selecting booleans from sqlite3 database
I'll give that a try. I did try porting the database over from django so I'm guessing that's probably the issue. On Mon, Jan 9, 2017 at 3:49 PM, Niphlodwrote: > did you try dropping the databae and letting web2py recreate it ? sqlite > doesn't go well with fields altering their type "afterwards" (i.e. maybe > you created it as a string and then turned into a boolean) > > > On Monday, January 9, 2017 at 9:17:19 PM UTC+1, LoveWeb2py wrote: >> >> Hello, >> >> >> I'm trying to do a simple query against a sqlite3 database where the >> values are stored as 0's and 1's >> >> All i want to do is select all values that are True or False >> >> According to the book this should work: >> >> db(db.table.field==True).select() >> >> and that would return rows >> >> however, it's returning Rows(0) (nothing) >> >> I verified in the database that they are being stored as True/False >> through appadmin >> >> Any thoughts on why this isn't working? >> > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to a topic in the > Google Groups "web2py-users" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/web2py/IV2pgqH5lfc/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Updated appliances or web2py blog?
Hi Paolo, Thank you for the recommendation. I followed the instructions on the Movuca web page, but this install fails right out of the box File applications\at_blog\modules\movuca.py, line 51, in define_classes obj = cls(self) File applications\at_blog\modules\basemodel.py, line 51, in __init__ self.pre_load() File applications\at_blog\modules\basemodel.py, line 111, in pre_load self.__getattribute__(method)() File applications\at_blog\modules\datamodel\article.py, line 192, in set_fixtures content_type=self.db(self.db.content_type.identifier == 'Article').select().first().id File C:\web2py_src\web2py\gluon\dal.py, line 9317, in insert ret = self._db._adapter.insert(self, self._listify(fields)) File C:\web2py_src\web2py\gluon\dal.py, line 1361, in insert raise e IntegrityError: foreign key constraint failed Using web2py 2.9.11 On Mon, Jan 12, 2015 at 5:22 AM, Paolo Valleri paolo.vall...@gmail.com wrote: Have a look at http://www.web2pyslices.com/home It is built on top of https://github.com/rochacbruno/Movuca Paolo On Sunday, January 11, 2015 at 10:12:08 PM UTC+1, LoveWeb2py wrote: Hello, I'm looking to implement a nice blog for my site. I'd like to use a web2py appliance if there is one available. I went through the old appliances but they all seem fairly old. Is there an site which has a list of all the current web2py projects or more specifically blogs that I could import? Thanks! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/tq1to20yf2w/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Creating a mobile friendly site -- How?
Thanks, Massimo. I'll give that a try. Would it be possible to just have a mobile site and redirect the user based on their agent string? On Sun, Jul 27, 2014 at 12:00 PM, Massimo Di Pierro massimo.dipie...@gmail.com wrote: It looks horrible about of the CSS that you use. Your divs have a fixed width and are not fluid. try rewrite it using twitter bootstrap or semantic-ui. On Sunday, 27 July 2014 10:34:17 UTC-5, LoveWeb2py wrote: Hello everyone, I'm working on www.handymancharles.com I'm using web2py for the site and I really love it! When I try to access the site on my mobile phone it looks horrible though. I know that if I create a default web2py app it is ready for mobile devices, but how could I make this current site mobile ready? What changes would I need to make or what is the best practice? Should I do something like check the user agent and then create a totally separate site for mobile devices? I'm lost and as always appreciate any advice! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/qwuRtlByMwQ/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: How to -- Popup window: Record already exists are you sure you want to upload file?
That might work Manuele. How would the code look? On Jul 15, 2014 1:39 AM, Manuele Pesenti manuele.pese...@gmail.com wrote: Il 14/07/14 21:21, Niphlod ha scritto: until the user clicks on submit, there's no way for web2py (or you) to know the name of the file being uploaded beforehand, using a normal input type=file. it's just not how the browsers work. what about to set up a javascript event on the upload like onselect and make your check via ajax? just a suggest hope it could help M. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/F5jydKmKbeA/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] create a link SQLFORM to another table with id.belongs
yes On Fri, Jun 6, 2014 at 1:09 PM, Fabiano Almeida fabi...@techno7.com.br wrote: Are you logged in your app? 2014-06-06 14:07 GMT-03:00 LoveWeb2py atayloru...@gmail.com: That was it! THANK YOU! Why does it work without a signature though? On Friday, June 6, 2014 1:03:35 PM UTC-4, Fabiano Almeida wrote: Try: grid = SQLFORM.grid(db.table, user_signature=False) Em sexta-feira, 6 de junho de 2014 13h10min34s UTC-3, LoveWeb2py escreveu: Hi Fabiano, I actually was already using grid= SQLFORM.grid(db.new_table). That is when I get the error. If I do grid='' to test it and just return the table without SQLFORM I can see it in the view, but when I apply SQLFORM I get the error 'Rows' object has no attribute '_db'. I'm guessing this is because of the way SQLFORM handles the grid? Could there be something in my model messing it up? On Friday, June 6, 2014 12:02:05 PM UTC-4, Fabiano Almeida wrote: Hi, You send var grid (see: return dict(grid=grid)). The first var grid is a send var to your view, de second var grid is a local var of your function. Then, in controller use: grid = SQLFORM.grid(db.new_table) return dict(grid=grid) in the view use: {{=grid}} Fabiano. 2014-06-06 12:45 GMT-03:00 LoveWeb2py atayl...@gmail.com: SQLFORM isn't working for me with new_table = db(db.table1.id.belongs(record_ids)).select() if I do {{=new_table}} in my view I can see the records which belong to record_ids, but if I do: SQLFORM.grid(new_table) return dict(grid=grid) I get an error 'Rows' object has no attribute '_db' -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/I8aGvbVcQxk/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Create a copy record button in SQLFORM?
I will definitely upgrade in the upcoming months... but for now Im stuck with 2.6. Your dict comprehension worked, but now I'm getting an error when I click bthe button saying there are too many values to unpack. I'm guessing this is because I'm using 2.6 again and its something to do with my function: def transition_form(): for f, v in rqeuest.vars: db.table[f].default = v form = SQLFORM(db.table) return dict(form=form) On Fri, May 2, 2014 at 4:03 PM, Richard Vézina ml.richard.vez...@gmail.comwrote: Try with dict() contructor in one of my last email if you want to stay in 2.6 Richard On Fri, May 2, 2014 at 4:02 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: python2.7 web2py ... On Fri, May 2, 2014 at 4:01 PM, LoveWeb2py atayloru...@gmail.com wrote: Is there a way to force web2py to use 2.7 instead of 2.6? I thought it was using 2.7. Thank you for being so patient. On Friday, May 2, 2014 3:59:06 PM UTC-4, Richard wrote: Upgrade to 2.9.5 web2py 2.3 is very old... Consider using 2.7 for python... http://stackoverflow.com/questions/1747817/python- create-a-dictionary-with-list-comprehension You can adapt Richard On Fri, May 2, 2014 at 3:44 PM, LoveWeb2py atayl...@gmail.com wrote: Okay... I think I see the issue. My web2py is running Python 2.6 and my Interpreter is 2.7. dictionary comprehension changed between those versions. I'm going to try and construct a dict comprehension for 2.6 and try it again. On Friday, May 2, 2014 3:40:53 PM UTC-4, LoveWeb2py wrote: Okay quick update: I loaded a row into python to test the comprehension. row = db(db.table.id0).select().first() {f: row[f] for f in db.table.fields} prints out the list fine and its exactly how Id like to prepopulate my field on the transition form. Thank you for getting me this far. However when I try to type vars={f: row[f] for f in db.table.fields})))] I get invalid syntax and the ^ points to the for in the dict comprehension. When I use regular python it works fine. Any thoughts? On Friday, May 2, 2014 3:16:24 PM UTC-4, LoveWeb2py wrote: I just realized I might be running into problems because I'm using 2.3. I haven't upgraded because the new web2py threw my css off. It looks like you're referencing the virtual fields? http://web2py.com/books/default/chapter/29/06/the-database- abstraction-layer#Old-style-virtual-fields If you think I should upgrade i'll make the change, but if I could stick with 2.3 I would prefer to do so On Friday, May 2, 2014 3:10:15 PM UTC-4, LoveWeb2py wrote: for this part: {f: row[f] for f in db.table.fields} what do I put for fields... could I just leave it as fields? On Friday, May 2, 2014 11:16:09 AM UTC-4, Richard wrote: Yes, so you want to pas by a transitionnal form with the data preset base on the copied record values, where you can make the change you want before submit the form. So if you have a grid where you can select the record to copy with the icon you want that link to the transitionnal form, you just have to pass the value of the record to the form throught out URL vars... You can iter like that : SQLFORM.grid(..., links=[dict(header='', body=lambda row: A(I(_class='icon some_icon'), _href=URL('transitionnal_form', vars={f: row[f] for f in db.table.fields}],) This part : {f: row[f] for f in db.table.fields} Is a dict comprehension... Then in transitionnal form controller you do something like that : def transition_form(): for f, v in request.vars: db.table[f].default = v form = SQLFORM(db.table, ...) ... Richard On Fri, May 2, 2014 at 10:18 AM, LoveWeb2py atayl...@gmail.comwrote: Basically... right now I have a magnifying glass, the pencil, and a trash can for my records. I want to add a plus next to each one of my records and when I click on the plus it copies that records values into a new record and creates a new ID. I can then modify some of the values in the record or keep it the same if I choose. Does that make sense? On Friday, May 2, 2014 9:57:23 AM UTC-4, LoveWeb2py wrote: This is very helpful, Richard. I have about 20 fields so I think I would have to iterate through the fields and insert the request.vars to the database. Ahhh after looking at your code it looks like that could would write a record from one table to another. In this case I just want to copy a record from the same table and insert the record as a new ID. I think the answer will be a combination of your and Oli's approach. On Friday, May 2, 2014 9:39:46 AM UTC-4, Richard wrote: What do you mean? You can redirect (A('Link', _href=URL(controler, function, vars=dict(pass_your_record_vars_here=record_vars1, ...))) to a function that do what I wrote above... Just pass record value throught vars then request.vars.field1 request.vars.field2 and assign .default= request.vars.field1 Richard On Fri, May 2, 2014 at 9:33 AM, LoveWeb2py
Re: [web2py] Re: Create a copy record button in SQLFORM?
return **dict(form=form)? I am sorry I know my questions are noob, but I can't tell you how much I appreciate your help. I've spent two days on this problem. On Fri, May 2, 2014 at 4:11 PM, Richard Vézina ml.richard.vez...@gmail.comwrote: **dict(...) On Fri, May 2, 2014 at 4:10 PM, Austin Taylor atayloru...@gmail.comwrote: I will definitely upgrade in the upcoming months... but for now Im stuck with 2.6. Your dict comprehension worked, but now I'm getting an error when I click bthe button saying there are too many values to unpack. I'm guessing this is because I'm using 2.6 again and its something to do with my function: def transition_form(): for f, v in rqeuest.vars: db.table[f].default = v form = SQLFORM(db.table) return dict(form=form) On Fri, May 2, 2014 at 4:03 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: Try with dict() contructor in one of my last email if you want to stay in 2.6 Richard On Fri, May 2, 2014 at 4:02 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: python2.7 web2py ... On Fri, May 2, 2014 at 4:01 PM, LoveWeb2py atayloru...@gmail.comwrote: Is there a way to force web2py to use 2.7 instead of 2.6? I thought it was using 2.7. Thank you for being so patient. On Friday, May 2, 2014 3:59:06 PM UTC-4, Richard wrote: Upgrade to 2.9.5 web2py 2.3 is very old... Consider using 2.7 for python... http://stackoverflow.com/questions/1747817/python- create-a-dictionary-with-list-comprehension You can adapt Richard On Fri, May 2, 2014 at 3:44 PM, LoveWeb2py atayl...@gmail.comwrote: Okay... I think I see the issue. My web2py is running Python 2.6 and my Interpreter is 2.7. dictionary comprehension changed between those versions. I'm going to try and construct a dict comprehension for 2.6 and try it again. On Friday, May 2, 2014 3:40:53 PM UTC-4, LoveWeb2py wrote: Okay quick update: I loaded a row into python to test the comprehension. row = db(db.table.id0).select().first() {f: row[f] for f in db.table.fields} prints out the list fine and its exactly how Id like to prepopulate my field on the transition form. Thank you for getting me this far. However when I try to type vars={f: row[f] for f in db.table.fields})))] I get invalid syntax and the ^ points to the for in the dict comprehension. When I use regular python it works fine. Any thoughts? On Friday, May 2, 2014 3:16:24 PM UTC-4, LoveWeb2py wrote: I just realized I might be running into problems because I'm using 2.3. I haven't upgraded because the new web2py threw my css off. It looks like you're referencing the virtual fields? http://web2py.com/books/default/chapter/29/06/the-database- abstraction-layer#Old-style-virtual-fields If you think I should upgrade i'll make the change, but if I could stick with 2.3 I would prefer to do so On Friday, May 2, 2014 3:10:15 PM UTC-4, LoveWeb2py wrote: for this part: {f: row[f] for f in db.table.fields} what do I put for fields... could I just leave it as fields? On Friday, May 2, 2014 11:16:09 AM UTC-4, Richard wrote: Yes, so you want to pas by a transitionnal form with the data preset base on the copied record values, where you can make the change you want before submit the form. So if you have a grid where you can select the record to copy with the icon you want that link to the transitionnal form, you just have to pass the value of the record to the form throught out URL vars... You can iter like that : SQLFORM.grid(..., links=[dict(header='', body=lambda row: A(I(_class='icon some_icon'), _href=URL('transitionnal_form', vars={f: row[f] for f in db.table.fields}],) This part : {f: row[f] for f in db.table.fields} Is a dict comprehension... Then in transitionnal form controller you do something like that : def transition_form(): for f, v in request.vars: db.table[f].default = v form = SQLFORM(db.table, ...) ... Richard On Fri, May 2, 2014 at 10:18 AM, LoveWeb2py atayl...@gmail.comwrote: Basically... right now I have a magnifying glass, the pencil, and a trash can for my records. I want to add a plus next to each one of my records and when I click on the plus it copies that records values into a new record and creates a new ID. I can then modify some of the values in the record or keep it the same if I choose. Does that make sense? On Friday, May 2, 2014 9:57:23 AM UTC-4, LoveWeb2py wrote: This is very helpful, Richard. I have about 20 fields so I think I would have to iterate through the fields and insert the request.vars to the database. Ahhh after looking at your code it looks like that could would write a record from one table to another. In this case I just want to copy a record from the same table and insert the record as a new ID. I think the answer will be a combination of your and Oli's approach. On Friday, May 2, 2014 9:39:46 AM UTC-4, Richard wrote: What do you mean
Re: [web2py] Re: Create a copy record button in SQLFORM?
I actually see it trying to return the values in the variables in the URL it says field1='data', field2='data2', but its hanging for some reason... On Fri, May 2, 2014 at 4:15 PM, Austin Taylor atayloru...@gmail.com wrote: return **dict(form=form)? I am sorry I know my questions are noob, but I can't tell you how much I appreciate your help. I've spent two days on this problem. On Fri, May 2, 2014 at 4:11 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: **dict(...) On Fri, May 2, 2014 at 4:10 PM, Austin Taylor atayloru...@gmail.comwrote: I will definitely upgrade in the upcoming months... but for now Im stuck with 2.6. Your dict comprehension worked, but now I'm getting an error when I click bthe button saying there are too many values to unpack. I'm guessing this is because I'm using 2.6 again and its something to do with my function: def transition_form(): for f, v in rqeuest.vars: db.table[f].default = v form = SQLFORM(db.table) return dict(form=form) On Fri, May 2, 2014 at 4:03 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: Try with dict() contructor in one of my last email if you want to stay in 2.6 Richard On Fri, May 2, 2014 at 4:02 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: python2.7 web2py ... On Fri, May 2, 2014 at 4:01 PM, LoveWeb2py atayloru...@gmail.comwrote: Is there a way to force web2py to use 2.7 instead of 2.6? I thought it was using 2.7. Thank you for being so patient. On Friday, May 2, 2014 3:59:06 PM UTC-4, Richard wrote: Upgrade to 2.9.5 web2py 2.3 is very old... Consider using 2.7 for python... http://stackoverflow.com/questions/1747817/python- create-a-dictionary-with-list-comprehension You can adapt Richard On Fri, May 2, 2014 at 3:44 PM, LoveWeb2py atayl...@gmail.comwrote: Okay... I think I see the issue. My web2py is running Python 2.6 and my Interpreter is 2.7. dictionary comprehension changed between those versions. I'm going to try and construct a dict comprehension for 2.6 and try it again. On Friday, May 2, 2014 3:40:53 PM UTC-4, LoveWeb2py wrote: Okay quick update: I loaded a row into python to test the comprehension. row = db(db.table.id0).select().first() {f: row[f] for f in db.table.fields} prints out the list fine and its exactly how Id like to prepopulate my field on the transition form. Thank you for getting me this far. However when I try to type vars={f: row[f] for f in db.table.fields})))] I get invalid syntax and the ^ points to the for in the dict comprehension. When I use regular python it works fine. Any thoughts? On Friday, May 2, 2014 3:16:24 PM UTC-4, LoveWeb2py wrote: I just realized I might be running into problems because I'm using 2.3. I haven't upgraded because the new web2py threw my css off. It looks like you're referencing the virtual fields? http://web2py.com/books/default/chapter/29/06/the-database- abstraction-layer#Old-style-virtual-fields If you think I should upgrade i'll make the change, but if I could stick with 2.3 I would prefer to do so On Friday, May 2, 2014 3:10:15 PM UTC-4, LoveWeb2py wrote: for this part: {f: row[f] for f in db.table.fields} what do I put for fields... could I just leave it as fields? On Friday, May 2, 2014 11:16:09 AM UTC-4, Richard wrote: Yes, so you want to pas by a transitionnal form with the data preset base on the copied record values, where you can make the change you want before submit the form. So if you have a grid where you can select the record to copy with the icon you want that link to the transitionnal form, you just have to pass the value of the record to the form throught out URL vars... You can iter like that : SQLFORM.grid(..., links=[dict(header='', body=lambda row: A(I(_class='icon some_icon'), _href=URL('transitionnal_form', vars={f: row[f] for f in db.table.fields}],) This part : {f: row[f] for f in db.table.fields} Is a dict comprehension... Then in transitionnal form controller you do something like that : def transition_form(): for f, v in request.vars: db.table[f].default = v form = SQLFORM(db.table, ...) ... Richard On Fri, May 2, 2014 at 10:18 AM, LoveWeb2py atayl...@gmail.com wrote: Basically... right now I have a magnifying glass, the pencil, and a trash can for my records. I want to add a plus next to each one of my records and when I click on the plus it copies that records values into a new record and creates a new ID. I can then modify some of the values in the record or keep it the same if I choose. Does that make sense? On Friday, May 2, 2014 9:57:23 AM UTC-4, LoveWeb2py wrote: This is very helpful, Richard. I have about 20 fields so I think I would have to iterate through the fields and insert the request.vars to the database. Ahhh after looking at your code it looks like that could would write a record from one table to another. In this case I
Re: [web2py] Re: Change button to loading after clicked
Thanks for the update Niphlod! I'm using 2.3.2. Do you know if its available in that version? I tried using data={'loading-text':'loading} in the controller, but its not taking it for some reason. On Thu, Apr 24, 2014 at 3:08 PM, Niphlod niph...@gmail.com wrote: python won't let you do _data-loading-text in that way (because of the - sign) However, recent web2py releases allow you to use data={'loading-text'} ^__^ you can review this section of the book for a complete reference http://web2py.com/books/default/chapter/29/05/the-views#HTML-helpers On Thursday, April 24, 2014 7:09:13 PM UTC+2, Derek wrote: I'm pretty sure you can pass the 'input' function a _ data-loading-text=Loading... I believe that anything with an underscore in front of it gets added as an attribute. You could do it like this... INPUT(_type='submit', _data-loading-text=Loading..., _cheese=Casu marzu) and your input tag will be on the page like so: input type='submit' data-loading-text=Loading..., cheese=Casu marzu On Wednesday, April 23, 2014 6:48:23 AM UTC-7, LoveWeb2py wrote: Hello, I'm using the form=FORM('Search text:', INPUT(_name='texttofind', INPUT(_type='submit')) which generates a button and a search field on a web page when I type {{=form}} How can I change the button to loading when a user clicks it I found this documentation on jquery http://getbootstrap.com/2.3.2/ javascript.html#buttons but I'm not sure how to assign it to the button. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/tosEHMsaL7U/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Current date/time for datetime field (time is wrong)
Perfect. Thank you! On Tue, Apr 15, 2014 at 1:04 PM, Marco Mansilla thebigsho...@gmail.comwrote: El Tue, 15 Apr 2014 10:13:26 -0700 (PDT) LoveWeb2py atayloru...@gmail.com escribió: Hello, I love the calendar that pops up in the 'datetime' field with a time/date selector. However, when my customers use it their time is always off. Is there a way to prepopulate the field with the current time, or make a button for them to click which will take their local system time? set default=request.now in the table definition Marco. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/-d2AJBX_1ns/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?
It's for mysql. Its stored as VARCHAR in the data base and up to 500 chars but fixing it to text in my db.py model fixed it. I'm guessing there is a built in validator for strings On Apr 11, 2014 4:00 PM, Derek sp1d...@gmail.com wrote: is this mssql or mysql or postgres? i think mysql has a limit of 255 for string data. it would silently change any lengths longer to 255... On Thursday, April 10, 2014 9:52:13 AM UTC-7, LoveWeb2py wrote: Are there any other suggestions? I've tried everything and I really need help with this. When the table is set to Migrate=True the sql log shows VARCHAR(255) even though my actual SQLDatabase shows 499 length and my length on the db model is set to length=500 On Thursday, April 10, 2014 11:05:29 AM UTC-4, 黄祥 wrote: please try to start from simple, create your new web2py application and then put your define table there, after that check your sql.log or test it from appadmin. e.g. *models/db.py* db.define_table('newtable', Field('Name','string'), Field('Comments', string', length=499) ) best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/d8G92qlxSjc/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?
Using MySQL and the table definition is just: db.define_table('newtable', Field('Name','string'), Field('Comments', string', length=499)' migrate=False) On Wednesday, April 9, 2014 8:09:19 AM UTC-4, Niphlod wrote: what's the table definition ? what backend are you using ? On Wednesday, April 9, 2014 9:06:12 AM UTC+2, Austin Taylor wrote: Wow thanks for the quick reply! I did try the length=499, but I still get the validator error. Do I need to restart web2py? On Wednesday, April 9, 2014 3:00:49 AM UTC-4, Niphlod wrote: Field('whatever') means really Field('whatever', 'string', length=255) it gets a default requires that resembles IS_LENGTH(maxsize=255) if you need more of that, use length=morethan255 On Wednesday, April 9, 2014 8:54:40 AM UTC+2, Austin Taylor wrote: I'm creating a grid using grid=SQLFORM.smartgrid(db.mydatabase, user_signature=True) when I try to update one of the fields using the edit button I get enter from 0 to 255 characters. The field already has over 255 characters in it because its in the database, but I cannot add extra characters to the field. Any help is appreciated. I looked all over for the error enter from 0 to 255 characters -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Custom grid based on user profile -- any cool smartgrid examples welcomed!!
Hello, I'm trying to create a custom grid based on the user who is logged in. In other words something that would allow them to select which columns they'd like to see in the database, have it save to their profile, and then view the grid. Are there any examples on how I could achieve this? I'm using mysql for the database. I was thinking of having some type of menu where they could select which fields they want and then somehow save that preference to their user id. Beyond that I'm really not sure where to start and welcome any advice. Lastly, thank you for everyone who post on these boards and continue to make the web2py community great! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?
I only define the table in my db.py though. I don't see it referenced anywhere else. On Thursday, April 10, 2014 10:46:23 AM UTC-4, 黄祥 wrote: perhaps try to set migrat = True, to take effect for your defined table. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?
I set migrate to True and checked the database logs. You're right... its showing as a VARCHAR 255. Even though I have length=499 defined in the db.define_table. Is web2py limited to 255 for VARCHARS? On Thursday, April 10, 2014 10:50:56 AM UTC-4, Austin Taylor wrote: I only define the table in my db.py though. I don't see it referenced anywhere else. On Thursday, April 10, 2014 10:46:23 AM UTC-4, 黄祥 wrote: perhaps try to set migrat = True, to take effect for your defined table. best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Custom grid based on user profile -- any cool smartgrid examples welcomed!!
Hi Stifan, I guess I didn't properly phrase my question but I really appreciate your response. Currently users can access one of our databases using the grid layout. I want to give them the option of only seeing select fields through some type of checkbox or multiple select. Like this: http://dev.s-cubism.com/plugin_multiselect_widget From there I want to only show select fields in the database on their selection and give them the ability to save the view. I hope this paints a little clearer pictures. On Thursday, April 10, 2014 10:52:33 AM UTC-4, 黄祥 wrote: if you set the access control correctly and set the logical for that it can be done, for menu i think you can do something like : *controllers/install.py* def index(): if db(db.auth_permission).isempty() and db(db.auth_membership).isempty(): # group auth.add_group('Finance', 'Finance') # user db.auth_user.bulk_insert([{first_name : Finance, last_name : Manager, email : finance...@a.com javascript:, username : financemanager, password : db.auth_user.password.validate(password)[0]}, ]) membership (group_id, user_id) # Finance auth.add_membership('1', '1') session.flash = T('Installation Done') redirect(URL(default, index) ) *models/menu.py* if auth.has_membership(role = 'Finance'): response.menu += [ (T('Finance'), False, URL('default', 'index'), [ (T('Master'), False, URL('finance_master', 'index'), [ (T('Bank'), False, URL('finance_master', 'bank'), []), ]), (T('Transaction'), False, URL('finance_transaction', 'index'), [ (T('Payment'), False, URL('finance_transaction', 'payment_cart'), []), ]), (T('Report'), False, URL('finance_report', 'index'), [ (T('Payment'), False, URL('finance_report', 'report_payment'), []), ]), ]), ] best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?
Are there any other suggestions? I've tried everything and I really need help with this. When the table is set to Migrate=True the sql log shows VARCHAR(255) even though my actual SQLDatabase shows 499 length and my length on the db model is set to length=500 On Thursday, April 10, 2014 11:05:29 AM UTC-4, 黄祥 wrote: please try to start from simple, create your new web2py application and then put your define table there, after that check your sql.log or test it from appadmin. e.g. *models/db.py* db.define_table('newtable', Field('Name','string'), Field('Comments', string', length=499) ) best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?
Fixed it by changing string to text. Is there anything that could go wrong by me doing that? On Thursday, April 10, 2014 12:52:13 PM UTC-4, Austin Taylor wrote: Are there any other suggestions? I've tried everything and I really need help with this. When the table is set to Migrate=True the sql log shows VARCHAR(255) even though my actual SQLDatabase shows 499 length and my length on the db model is set to length=500 On Thursday, April 10, 2014 11:05:29 AM UTC-4, 黄祥 wrote: please try to start from simple, create your new web2py application and then put your define table there, after that check your sql.log or test it from appadmin. e.g. *models/db.py* db.define_table('newtable', Field('Name','string'), Field('Comments', string', length=499) ) best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Enter from 0 to 255 characters on grid=SQLFORM How to fix?
I'm creating a grid using grid=SQLFORM.smartgrid(db.mydatabase, user_signature=True) when I try to update one of the fields using the edit button I get enter from 0 to 255 characters. The field already has over 255 characters in it because its in the database, but I cannot add extra characters to the field. Any help is appreciated. I looked all over for the error enter from 0 to 255 characters -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Enter from 0 to 255 characters on grid=SQLFORM How to fix?
Wow thanks for the quick reply! I did try the length=499, but I still get the validator error. Do I need to restart web2py? On Wednesday, April 9, 2014 3:00:49 AM UTC-4, Niphlod wrote: Field('whatever') means really Field('whatever', 'string', length=255) it gets a default requires that resembles IS_LENGTH(maxsize=255) if you need more of that, use length=morethan255 On Wednesday, April 9, 2014 8:54:40 AM UTC+2, Austin Taylor wrote: I'm creating a grid using grid=SQLFORM.smartgrid(db.mydatabase, user_signature=True) when I try to update one of the fields using the edit button I get enter from 0 to 255 characters. The field already has over 255 characters in it because its in the database, but I cannot add extra characters to the field. Any help is appreciated. I looked all over for the error enter from 0 to 255 characters -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Using Post mail in CentOS for Web2py
Hello, I'm trying to setup web2py to use mail for linux. I already have linux configured, so I don't need to use the configuration settings in db.py. For example, I could type 'mail -s test email u...@domain.com' and send an e-mail. How could I incorporate web2py's register/lost password feature to use those settings instead? Thank you so much. Austin -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Using Post mail in CentOS for Web2py
Solved it! mail = auth.settings.mailer mail.settings.server = '127.0.0.1:25' mail.settings.sender = 'testu...@domain.com' mail.settings.tls = False mail.settings.login = None On Tue, Apr 1, 2014 at 11:04 AM, Austin Taylor atayloru...@gmail.comwrote: Hello, I'm trying to setup web2py to use mail for linux. I already have linux configured, so I don't need to use the configuration settings in db.py. For example, I could type 'mail -s test email u...@domain.com' and send an e-mail. How could I incorporate web2py's register/lost password feature to use those settings instead? Thank you so much. Austin -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/bc5OIZwmA5o/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Secure RSS Feeds
Hi guys, I'm trying to get secure RSS feeds, but when I try to make the request using feed parser I can't get the request. How could I use my certificates with feedparser? I'm currently running web2py hosted by apache here is my code controller: import feedparser def index(): d = feedparser.parse('https//anybloghere.rss') return dict(content=d) view: {{=content.feed.title}} I get an error saying it can't see the feed.title because its not returning anything due to the https -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Make grid view larger add scroll bar to top
Thank you for the ideas, Tim. I like the idea of the wide_layout.html. I'll poke around and see if I can find where web2py sets the page width. Cheers! Austin On Sat, Mar 8, 2014 at 10:59 PM, Tim Richardson t...@growthpath.com.au wrote: Tip, in case you didn't know: exploring CSS with a tool like Firefox's Firebug is a great way to quickly work out which css in which file is driving what you see. Learning Firebug or its equivalent (like Chrome's developer tools) is pretty useful with modern sites since there are so many sources of CSS. 100% means the grid is as wide as its enclosing DIV, which you know of course. So you're correct, you want to make the whole page wider. Explore the CSS above, using a tool like Firefox. On a default page (an app copied from the welcome app) you'll see that the grid is probably contained in a container class div; the width comes from the bootstrap css I think. There are few approaches to how you provide a wider screen. You can put css directly into this specific view, or you can adjust your layout.html, or make a layout_wide.html and use that in pages which you need to be wider. It may be considered an unusal request here because most people are conscious of keeping sites responsive to different screen widths. Perhaps you can redesign your form so that people click buttons or links to view additional information about a record. On Sunday, 9 March 2014 12:36:13 UTC+11, Austin Taylor wrote: yeah I mean the entire grid wider. I know its at 100%, but I'm not sure how to make the overall layout of my grid bigger. I guess I would have to increase the default css layout? On Sat, Mar 8, 2014 at 7:42 PM, Tim Richardson t...@growthpath.com.au wrote: When you say larger, do you mean wider? It defaults to 100% as you say, so I don't understand what you are experiencing and what you want instead. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/HMCeGJ4BitM/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/HMCeGJ4BitM/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Complex css layout -- is web2py the right choice?
Thank you so much, Paolo!! This is wonderful! It certainly helped my understanding. However, whenever I try to use this code: Only web2py.css and calendar.css work. {{ response.files.insert(0,URL('static','css/web2py.css')) response.files.insert(1,URL('static','css/bootstrap.min.css')) response.files.insert(2,URL('static','css/bootstrap-responsive.min.css')) response.files.insert(3,URL('static','css/web2py_bootstrap.css')) response.files.insert(4,URL('static','css/style.css')) response.files.insert(5,URL('static','css/style-desktop.css')) }} After a little troubleshooting I figured out the calendar.css was being pulled from web2py_ajax.html Any idea on why the code above wouldn't work in the layout_custom.html? I REALLY appreciate your help. This has made such a difference! On Saturday, March 8, 2014 9:08:29 AM UTC-5, Paolo Caruccio wrote: It's just a demo. The code is not tested. You should consider this only as a very basic reference. The filenames here reported are only conventional you should use yours. 1) put the css files of the template in static/css folder of your web2py application; 2) put the js files of the template in static/js folder of your web2py application. Please note that jquery is already shipped with web2py (check web2py_ajax.html); 3) assuming that the index.html located to http://pastebin.com/zbnWjs1v is the main file of the template, you should modify it in order to get advantage of the web2py features and save it in the views folder as layout_custom.html (check the layout_custom.html here attached). Please note the {{include}} that replaced the main content and the changes in the head section; 4) create in views/default folder a file named intro.html (here attached) containing the main content from the index.html of the template and extending layout_custom.html; 5) in controller/default.py add the following: def intro(): return locals() 6) in the browser see http://ipserver/appname/default/intro page (of course you have to replace ipserver and appname with real values). As said this is only a basic guide. You should make other adjustments in order to obtain a full working layout based on the template but we are here to help you in case of necessity. Il giorno sabato 8 marzo 2014 01:55:10 UTC+1, Austin Taylor ha scritto: Hello, I purchased this CSS template and I want to integrate web2py with it (because I love web2py). http://www.4templates.com/website-templates/726353988-WT00926/#green It has multiple html files it references, js files, and css sheets. Index.html located here: http://pastebin.com/zbnWjs1v How would I be able to normalize this enough to where I can extend the layout.html into other sheets and use all of the .js/css that comes with it? I've tried for 2 days now and I keep running into issues. Even when I try to just return locals() (if I put the index.html in views) it still doesn't apply the css sheets. I've tried using {{=URL('static','css/style.css'))}} with no luck either. Please help me find the best way to make this page normal. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: Complex css layout -- is web2py the right choice?
Okay figured that part out. Sorry about that. I was accidentally editing the custom_layout.html which I had in my views/default folder instead of just views. This layout references some of the pictures in java scripts. For example: var settings = { // Images images: { /* Your slides, in this format: 'path/to/image.jpg': 'position', where 'position' is the vertical/horizontal position (eg. 'center center', 'top left'). Use wide/short images for best results. */ 'images/slide01.jpg': 'bottom center', 'images/slide02.jpg': 'top center', 'images/slide03.jpg': 'bottom center' }, // Transition speed (in ms) speed: 3000, // Transition delay (in ms) delay: 4500 }; Is there a way for me to point to my pictures while in javascript? Can I do {{URL('static','images/slide01.jpg')}} ? On Sat, Mar 8, 2014 at 2:31 PM, Austin Taylor atayloru...@gmail.com wrote: Thank you so much, Paolo!! This is wonderful! It certainly helped my understanding. However, whenever I try to use this code: Only web2py.css and calendar.css work. {{ response.files.insert(0,URL('static','css/web2py.css')) response.files.insert(1,URL('static','css/bootstrap.min.css')) response.files.insert(2,URL('static','css/bootstrap-responsive.min.css')) response.files.insert(3,URL('static','css/web2py_bootstrap.css')) response.files.insert(4,URL('static','css/style.css')) response.files.insert(5,URL('static','css/style-desktop.css')) }} After a little troubleshooting I figured out the calendar.css was being pulled from web2py_ajax.html Any idea on why the code above wouldn't work in the layout_custom.html? I REALLY appreciate your help. This has made such a difference! On Saturday, March 8, 2014 9:08:29 AM UTC-5, Paolo Caruccio wrote: It's just a demo. The code is not tested. You should consider this only as a very basic reference. The filenames here reported are only conventional you should use yours. 1) put the css files of the template in static/css folder of your web2py application; 2) put the js files of the template in static/js folder of your web2py application. Please note that jquery is already shipped with web2py (check web2py_ajax.html); 3) assuming that the index.html located to http://pastebin.com/zbnWjs1v is the main file of the template, you should modify it in order to get advantage of the web2py features and save it in the views folder as layout_custom.html (check the layout_custom.html here attached). Please note the {{include}} that replaced the main content and the changes in the head section; 4) create in views/default folder a file named intro.html (here attached) containing the main content from the index.html of the template and extending layout_custom.html; 5) in controller/default.py add the following: def intro(): return locals() 6) in the browser see http://ipserver/appname/default/intro page (of course you have to replace ipserver and appname with real values). As said this is only a basic guide. You should make other adjustments in order to obtain a full working layout based on the template but we are here to help you in case of necessity. Il giorno sabato 8 marzo 2014 01:55:10 UTC+1, Austin Taylor ha scritto: Hello, I purchased this CSS template and I want to integrate web2py with it (because I love web2py). http://www.4templates.com/website-templates/726353988-WT00926/#green It has multiple html files it references, js files, and css sheets. Index.html located here: http://pastebin.com/zbnWjs1v How would I be able to normalize this enough to where I can extend the layout.html into other sheets and use all of the .js/css that comes with it? I've tried for 2 days now and I keep running into issues. Even when I try to just return locals() (if I put the index.html in views) it still doesn't apply the css sheets. I've tried using {{=URL('static','css/style.css'))}} with no luck either. Please help me find the best way to make this page normal. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/_uG8b8zwdDk/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https
[web2py] Re: Complex css layout -- is web2py the right choice?
Thanks Paolo! I used firebug to check which css forms were pulling through and Calendar.css and web2py.css were being shown. However, when I started editing the proper custom_layout.html the other css files came through. It was a complete mistake on my end. On Saturday, March 8, 2014 3:26:04 PM UTC-5, Paolo Caruccio wrote: The following files are useful only if your template is based on bootstrap 2 (like the web2py scaffolding template): - css/bootstrap.min.css - css/bootstrap-responsive.min.css - css/web2py_bootstrap.css otherwise you should omit them. What do you mean with Only web2py.css and calendar.css work ? Are you able to see if the browser gives errors by using its developers tools? If you are not able then you could read: for chrome https://developers.google.com/chrome-developer-tools/ for firefox https://developer.mozilla.org/en-US/docs/Tools Anyway the simplest and trivial check is to verify if all the files are in the static/css folder. Il giorno sabato 8 marzo 2014 20:31:03 UTC+1, Austin Taylor ha scritto: Thank you so much, Paolo!! This is wonderful! It certainly helped my understanding. However, whenever I try to use this code: Only web2py.css and calendar.css work. {{ response.files.insert(0,URL('static','css/web2py.css')) response.files.insert(1,URL('static','css/bootstrap.min.css')) response.files.insert(2,URL('static','css/bootstrap-responsive.min.css')) response.files.insert(3,URL('static','css/web2py_bootstrap.css')) response.files.insert(4,URL('static','css/style.css')) response.files.insert(5,URL('static','css/style-desktop.css')) }} After a little troubleshooting I figured out the calendar.css was being pulled from web2py_ajax.html Any idea on why the code above wouldn't work in the layout_custom.html? I REALLY appreciate your help. This has made such a difference! On Saturday, March 8, 2014 9:08:29 AM UTC-5, Paolo Caruccio wrote: It's just a demo. The code is not tested. You should consider this only as a very basic reference. The filenames here reported are only conventional you should use yours. 1) put the css files of the template in static/css folder of your web2py application; 2) put the js files of the template in static/js folder of your web2py application. Please note that jquery is already shipped with web2py (check web2py_ajax.html); 3) assuming that the index.html located to http://pastebin.com/zbnWjs1v is the main file of the template, you should modify it in order to get advantage of the web2py features and save it in the views folder as layout_custom.html (check the layout_custom.html here attached). Please note the {{include}} that replaced the main content and the changes in the head section; 4) create in views/default folder a file named intro.html (here attached) containing the main content from the index.html of the template and extending layout_custom.html; 5) in controller/default.py add the following: def intro(): return locals() 6) in the browser see http://ipserver/appname/default/intro page (of course you have to replace ipserver and appname with real values). As said this is only a basic guide. You should make other adjustments in order to obtain a full working layout based on the template but we are here to help you in case of necessity. Il giorno sabato 8 marzo 2014 01:55:10 UTC+1, Austin Taylor ha scritto: Hello, I purchased this CSS template and I want to integrate web2py with it (because I love web2py). http://www.4templates.com/website-templates/726353988-WT00926/#green It has multiple html files it references, js files, and css sheets. Index.html located here: http://pastebin.com/zbnWjs1v How would I be able to normalize this enough to where I can extend the layout.html into other sheets and use all of the .js/css that comes with it? I've tried for 2 days now and I keep running into issues. Even when I try to just return locals() (if I put the index.html in views) it still doesn't apply the css sheets. I've tried using {{=URL('static','css/style.css'))}} with no luck either. Please help me find the best way to make this page normal. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Re: Complex css layout -- is web2py the right choice?
YOU'RE THE MAN!! The {{=URL('static', 'images/slide01.jpg')}}: 'bottom center' didn't work, but the ../static/images/slide01.jpg: 'bottom center' did because the js file is in the js folder. THANK YOU THANK YOU THANK YOU! On Saturday, March 8, 2014 4:09:56 PM UTC-5, Paolo Caruccio wrote: About the javascript issue, if the script is in a view {{=URL('static', 'images/slide01.jpg')}}: 'bottom center' should work. Instead, if the 'settings' variable is in an external javascript file and assuming that the javascript file is in the static/js folder ../static/images/slide01.jpg: 'bottom center' should work but please test it. Il giorno sabato 8 marzo 2014 21:46:05 UTC+1, Austin Taylor ha scritto: Thanks Paolo! I used firebug to check which css forms were pulling through and Calendar.css and web2py.css were being shown. However, when I started editing the proper custom_layout.html the other css files came through. It was a complete mistake on my end. On Saturday, March 8, 2014 3:26:04 PM UTC-5, Paolo Caruccio wrote: The following files are useful only if your template is based on bootstrap 2 (like the web2py scaffolding template): - css/bootstrap.min.css - css/bootstrap-responsive.min.css - css/web2py_bootstrap.css otherwise you should omit them. What do you mean with Only web2py.css and calendar.css work ? Are you able to see if the browser gives errors by using its developers tools? If you are not able then you could read: for chrome https://developers.google.com/chrome-developer-tools/ for firefox https://developer.mozilla.org/en-US/docs/Tools Anyway the simplest and trivial check is to verify if all the files are in the static/css folder. Il giorno sabato 8 marzo 2014 20:31:03 UTC+1, Austin Taylor ha scritto: Thank you so much, Paolo!! This is wonderful! It certainly helped my understanding. However, whenever I try to use this code: Only web2py.css and calendar.css work. {{ response.files.insert(0,URL('static','css/web2py.css')) response.files.insert(1,URL('static','css/bootstrap.min.css')) response.files.insert(2,URL('static','css/bootstrap-responsive.min.css')) response.files.insert(3,URL('static','css/web2py_bootstrap.css')) response.files.insert(4,URL('static','css/style.css')) response.files.insert(5,URL('static','css/style-desktop.css')) }} After a little troubleshooting I figured out the calendar.css was being pulled from web2py_ajax.html Any idea on why the code above wouldn't work in the layout_custom.html? I REALLY appreciate your help. This has made such a difference! On Saturday, March 8, 2014 9:08:29 AM UTC-5, Paolo Caruccio wrote: It's just a demo. The code is not tested. You should consider this only as a very basic reference. The filenames here reported are only conventional you should use yours. 1) put the css files of the template in static/css folder of your web2py application; 2) put the js files of the template in static/js folder of your web2py application. Please note that jquery is already shipped with web2py (check web2py_ajax.html); 3) assuming that the index.html located to http://pastebin.com/zbnWjs1v is the main file of the template, you should modify it in order to get advantage of the web2py features and save it in the views folder as layout_custom.html (check the layout_custom.html here attached). Please note the {{include}} that replaced the main content and the changes in the head section; 4) create in views/default folder a file named intro.html (here attached) containing the main content from the index.html of the template and extending layout_custom.html; 5) in controller/default.py add the following: def intro(): return locals() 6) in the browser see http://ipserver/appname/default/intro page (of course you have to replace ipserver and appname with real values). As said this is only a basic guide. You should make other adjustments in order to obtain a full working layout based on the template but we are here to help you in case of necessity. Il giorno sabato 8 marzo 2014 01:55:10 UTC+1, Austin Taylor ha scritto: Hello, I purchased this CSS template and I want to integrate web2py with it (because I love web2py). http://www.4templates.com/website-templates/726353988-WT00926/#green It has multiple html files it references, js files, and css sheets. Index.html located here: http://pastebin.com/zbnWjs1v How would I be able to normalize this enough to where I can extend the layout.html into other sheets and use all of the .js/css that comes with it? I've tried for 2 days now and I keep running into issues. Even when I try to just return locals() (if I put the index.html in views) it still doesn't apply the css sheets. I've tried using {{=URL('static','css/style.css'))}} with no luck either. Please help me find the best way to make this page normal. -- Resources: - http://web2py.com - http
Re: [web2py] Make grid view larger add scroll bar to top
yeah I mean the entire grid wider. I know its at 100%, but I'm not sure how to make the overall layout of my grid bigger. I guess I would have to increase the default css layout? On Sat, Mar 8, 2014 at 7:42 PM, Tim Richardson t...@growthpath.com.au wrote: When you say larger, do you mean wider? It defaults to 100% as you say, so I don't understand what you are experiencing and what you want instead. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/HMCeGJ4BitM/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Make grid view larger add scroll bar to top
Hello, I'm using grid=SQLFORM.grid(db.table) I want to know how to make the form it returns larger? I have looked all over for the CSS and I can't find it. It just says width 100% for .web2py_grid Is there a way to make the overall layout larger since I have a bigger table, and is it possible to add a scroll bar to the top so I don't have to scroll all the way to the bottom to scroll to the right? Fixed headers would be nice too, but I'll keep trying to figure that out. Thank you!! -Austin -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] How do I track who clicks a submit button?
I'm trying to figure out a way to track users who click the submit button. Maybe using their db.auth_user.username and appending it to a list whenever they click submit? I literally just have no idea where to start and any advice would be appreciated. Best, Austin -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [web2py] Re: How do I track who clicks a submit button?
Thank you so much, Anthony. What if I have multiple users logged in? How would I store their ID upon clicking? Sorry I'm still learning I know that is a noob question. On Fri, Mar 7, 2014 at 5:54 PM, Anthony abasta...@gmail.com wrote: Depends on your goals. If we're talking about a SQLFORM based on a db table, it might make more sense to have a created_by and/or modified_by field in the table. The field(s) could be set to readable=writable=False, and set the default to auth.user_id. Whenever a record is inserted or updated, you then have the id of the user. In any case, the current logged in user's id is in auth.user_id (which is None if the user isn't logged in), so you could store that wherever you like upon form submission. Anthony On Friday, March 7, 2014 5:01:03 PM UTC-5, Austin Taylor wrote: I'm trying to figure out a way to track users who click the submit button. Maybe using their db.auth_user.username and appending it to a list whenever they click submit? I literally just have no idea where to start and any advice would be appreciated. Best, Austin -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/JQayRnZibYA/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] Complex css layout -- is web2py the right choice?
Hello, I purchased this CSS template and I want to integrate web2py with it (because I love web2py). http://www.4templates.com/website-templates/726353988-WT00926/#green It has multiple html files it references, js files, and css sheets. Index.html located here: http://pastebin.com/zbnWjs1v How would I be able to normalize this enough to where I can extend the layout.html into other sheets and use all of the .js/css that comes with it? I've tried for 2 days now and I keep running into issues. Even when I try to just return locals() (if I put the index.html in views) it still doesn't apply the css sheets. I've tried using {{=URL('static','css/style.css'))}} with no luck either. Please help me find the best way to make this page normal. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[web2py] wildcard for grid=SQLFORM(db.tablename)??
I've looked through the book and forum and can't seem to find any reference to a wildcard search when using the SQLFORM layout that web2py provides. Does anyone know of a wildcard search you can use like %? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: wildcard for grid=SQLFORM(db.tablename)??
Thanks, Anthony. That worked, but I had to remove the quotes around the search when you click new On Wednesday, March 5, 2014 1:28:15 PM UTC-5, Anthony wrote: Assuming you mean SQLFORM.grid, you should be able to use the standard SQL % and _ wildcard characters. Anthony On Wednesday, March 5, 2014 12:21:16 PM UTC-5, Austin Taylor wrote: I've looked through the book and forum and can't seem to find any reference to a wildcard search when using the SQLFORM layout that web2py provides. Does anyone know of a wildcard search you can use like %? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: input validation and redirection -- how?
Also want to add that the function takes me to a page that says None. If the IP I type in the input field meets an if condition it works properly, but if its any kind of character, or an IP that doesn't match my script it redirects me to None. Any thoughts? On Wednesday, February 26, 2014 2:08:11 PM UTC-5, Austin Taylor wrote: Hello, I setup a form similar to the display form on the tutorial: def display_form(): form = FORM('Your name:', INPUT(_name='userinput', requires=IS_IPV4()),INPUT(_type='submit')) if form.process().accepted: session.flash = 'form accepted' redirect(URL('next')) elif form.errors: response.flash = 'form has errors' else: response.flash = 'please fill the form' return dict(form=form) but for some reason it takes ANY user input and runs the redirect function, even if there is no user input. How could I have the input validated and then perform a redirection if it approved. I thought that is what the form.process().accepted was for. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: input validation and redirection -- how?
Anthony, I have another function in the code that redirects the page, but that should only work if form.process().accepted works. After if form.process().accepted: I have it run through a long list of code and at the very end it goes into a function defined in my models.py. The function writes all the values to a dictionary and then redirects to the results.html page which displays properly. The problem is the form.process().accepted isn't performing validation. I can click the submit button and it will redirect me to a blank page and it says None. However if I type in a proper value it works great. Shouldn't form.process().accepted only go through if there were no processing errors? a blank field is not valid, but it still processes. On Thursday, February 27, 2014 2:00:47 PM UTC-5, Anthony wrote: Using your exact code, I cannot replicate the behavior you observe. Can you show the view code? Is there any other relevant code that might be doing a redirect somewhere? On Thursday, February 27, 2014 12:24:14 PM UTC-5, Austin Taylor wrote: Also want to add that the function takes me to a page that says None. If the IP I type in the input field meets an if condition it works properly, but if its any kind of character, or an IP that doesn't match my script it redirects me to None. Any thoughts? On Wednesday, February 26, 2014 2:08:11 PM UTC-5, Austin Taylor wrote: Hello, I setup a form similar to the display form on the tutorial: def display_form(): form = FORM('Your name:', INPUT(_name='userinput', requires=IS_IPV4()),INPUT(_type='submit')) if form.process().accepted: session.flash = 'form accepted' redirect(URL('next')) elif form.errors: response.flash = 'form has errors' else: response.flash = 'please fill the form' return dict(form=form) but for some reason it takes ANY user input and runs the redirect function, even if there is no user input. How could I have the input validated and then perform a redirection if it approved. I thought that is what the form.process().accepted was for. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: input validation and redirection -- how?
I figured it out. My return dict(form=form) was nestled under the else statement. Totally missed it and I'm sorry for wasting your time. However, when the new page appears with the validator the Submit button seems to be misplaced. It's now under the input field instead of next to it. On Thursday, February 27, 2014 4:45:05 PM UTC-5, Austin Taylor wrote: Anthony, I have another function in the code that redirects the page, but that should only work if form.process().accepted works. After if form.process().accepted: I have it run through a long list of code and at the very end it goes into a function defined in my models.py. The function writes all the values to a dictionary and then redirects to the results.html page which displays properly. The problem is the form.process().accepted isn't performing validation. I can click the submit button and it will redirect me to a blank page and it says None. However if I type in a proper value it works great. Shouldn't form.process().accepted only go through if there were no processing errors? a blank field is not valid, but it still processes. On Thursday, February 27, 2014 2:00:47 PM UTC-5, Anthony wrote: Using your exact code, I cannot replicate the behavior you observe. Can you show the view code? Is there any other relevant code that might be doing a redirect somewhere? On Thursday, February 27, 2014 12:24:14 PM UTC-5, Austin Taylor wrote: Also want to add that the function takes me to a page that says None. If the IP I type in the input field meets an if condition it works properly, but if its any kind of character, or an IP that doesn't match my script it redirects me to None. Any thoughts? On Wednesday, February 26, 2014 2:08:11 PM UTC-5, Austin Taylor wrote: Hello, I setup a form similar to the display form on the tutorial: def display_form(): form = FORM('Your name:', INPUT(_name='userinput', requires=IS_IPV4()),INPUT(_type='submit')) if form.process().accepted: session.flash = 'form accepted' redirect(URL('next')) elif form.errors: response.flash = 'form has errors' else: response.flash = 'please fill the form' return dict(form=form) but for some reason it takes ANY user input and runs the redirect function, even if there is no user input. How could I have the input validated and then perform a redirection if it approved. I thought that is what the form.process().accepted was for. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] input validation and redirection -- how?
Hello, I setup a form similar to the display form on the tutorial: def display_form(): form = FORM('Your name:', INPUT(_name='userinput', requires=IS_IPV4()),INPUT(_type='submit')) if form.process().accepted: session.flash = 'form accepted' redirect(URL('next')) elif form.errors: response.flash = 'form has errors' else: response.flash = 'please fill the form' return dict(form=form) but for some reason it takes ANY user input and runs the redirect function, even if there is no user input. How could I have the input validated and then perform a redirection if it approved. I thought that is what the form.process().accepted was for. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Change color of grid=SQLFORM.grid(db.abc, user_Signature=False)
Figured it out using Firebug and wanted to share my answer: To change the font colors inside the grid feature you have to create a CSS sheet (I called my tablebackground.css) and import it whenever I have a table. Then add this line: .odd.with_id {color: black;} There is also an even.with_id that web2py uses when converting sql databases into a form. Hope this helps someone else. Best, Austin On Friday, February 21, 2014 4:15:41 PM UTC-5, Austin Taylor wrote: I apologize for the vagueness. Part of that is my lack of knowledge and not knowing what to provide in the question. Thanks for responding, LightDot. I am using firebug and when I load the page it gives me 5 css scripts: background.css bootstrap-responsive.min.css bootstrap.min.css calendar.css (that one has a checkmark) web2py.css web2py_bootstrap.css You mentioned overriding the CSS Setting. How would I do so? On Friday, February 21, 2014 2:47:11 PM UTC-5, LightDot wrote: Question is a bit vague, yes ;) Like going to a mechanic and saying you want your car fixed, without any additional information and without showing your car. Grid is basically a html table, you have borders, rows, columns, fields, font colors, etc. etc. If your CSS template is overriding the Bootstrap's and web2py's CSS, then there is no magic one liner that will change all that back into something else. You need to redefine all CSS values that you want changed. This can be done for the grid alone. I suggest looking at your grid's CSS with a developer tool within your browser (all modern browsers have those built in, or you can use a plugin like Firebug for Firefox). This will show you which CSS definitions cause the color changes and which CSS file are they coming from. Then you can override them. Regards On Friday, February 21, 2014 5:31:35 PM UTC+1, Austin Taylor wrote: Really need help with this so if my question isn't clear please let me know and i'll try to rephrase. On Thursday, February 20, 2014 11:16:50 AM UTC-5, Austin Taylor wrote: I'm currently using a CSS template in my layout, but it changed my grid spreadsheet to an unreadable color. I've tried playing with the different css settings with no luck. Is there a way to just change the spreadsheet color? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Change color of grid=SQLFORM.grid(db.abc, user_Signature=False)
Really need help with this so if my question isn't clear please let me know and i'll try to rephrase. On Thursday, February 20, 2014 11:16:50 AM UTC-5, Austin Taylor wrote: I'm currently using a CSS template in my layout, but it changed my grid spreadsheet to an unreadable color. I've tried playing with the different css settings with no luck. Is there a way to just change the spreadsheet color? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] How to use markdown with dictionary
I tried using this answer located here: http://stackoverflow.com/questions/9679090/using-modules-in-views/9680031#9680031 Here is the response i'm trying to follow (so you don't have to click the link). - Just for record. It is not a good idea to use locals() instead of passing locals to response.render, it is better to create a dictionary with the keys you want to be available for the view to be rendered. You can also include a reference to markdown on that dictionary from gluon.contrib.markdown.markdown2 import markdown mydict = dict(markdown=markdown, anotherkey=anothervalue)return response.render(path/to/view, mydict) Dont try to extend locals() in to mydict, you will run in to problems if you try this. Also you can just use the default web2py behavior from gluon.contrib.markdown.markdown2 import markdown response.view = path/to/viewreturn dict(markdown=markdown, anotherkey=anothervalue) another option for you is to import markdown in a model file. --- What does he mean by anotherkey=anothervalue? If my dictionary is called queryDict and I have a lot of values I'd like to be returned how could I return them all using markdown? Sorry if this is noobish, I love web2py and am trying to use it for everything. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Change color of grid=SQLFORM.grid(db.abc, user_Signature=False)
I apologize for the vagueness. Part of that is my lack of knowledge and not knowing what to provide in the question. Thanks for responding, LightDot. I am using firebug and when I load the page it gives me 5 css scripts: background.css bootstrap-responsive.min.css bootstrap.min.css calendar.css (that one has a checkmark) web2py.css web2py_bootstrap.css You mentioned overriding the CSS Setting. How would I do so? On Friday, February 21, 2014 2:47:11 PM UTC-5, LightDot wrote: Question is a bit vague, yes ;) Like going to a mechanic and saying you want your car fixed, without any additional information and without showing your car. Grid is basically a html table, you have borders, rows, columns, fields, font colors, etc. etc. If your CSS template is overriding the Bootstrap's and web2py's CSS, then there is no magic one liner that will change all that back into something else. You need to redefine all CSS values that you want changed. This can be done for the grid alone. I suggest looking at your grid's CSS with a developer tool within your browser (all modern browsers have those built in, or you can use a plugin like Firebug for Firefox). This will show you which CSS definitions cause the color changes and which CSS file are they coming from. Then you can override them. Regards On Friday, February 21, 2014 5:31:35 PM UTC+1, Austin Taylor wrote: Really need help with this so if my question isn't clear please let me know and i'll try to rephrase. On Thursday, February 20, 2014 11:16:50 AM UTC-5, Austin Taylor wrote: I'm currently using a CSS template in my layout, but it changed my grid spreadsheet to an unreadable color. I've tried playing with the different css settings with no luck. Is there a way to just change the spreadsheet color? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Change color of grid=SQLFORM.grid(db.abc, user_Signature=False)
I'm currently using a CSS template in my layout, but it changed my grid spreadsheet to an unreadable color. I've tried playing with the different css settings with no luck. Is there a way to just change the spreadsheet color? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: How to reset authentication?
I used extract_mysql_models.py to create the models since I couldn't see them when I typed db.tables. After putting the defined models in db.py I could then see the models. I've tried troubleshooting with enable_migrate_all and migrate=True, but the register screen just stays blank for me. I'm also not sure how it is suppose to help me troubleshoot. I would like for the database to be able to overwrite any fields I have in there now and fix itself if possible. I thought that is what the migrate=True setting would do, but I must be wrong. On Fri, Feb 7, 2014 at 9:46 PM, LightDot light...@gmail.com wrote: Looks like web2py thinks that your main database structure is different than it really is. With other words, database migrations are broken for your app. That's why auth works if you start with a fresh database and doesn't if you use the existing one. Since you've been replacing one database with another (to test auth, etc.), how did you handle database migrations in web2py? Migrations are described here: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Migrations What I would do: 1) if there was important data in the main database: check the differences between the database definitions and your current main database structure, sort that out using fake migrations (refer to Fixing broken migrations chapter in the book) 2) if there was no need to keep the old data from the main database: a) drop all tables from the main database b) delete all files from the applications/yourapp/databases folder (assuming there are no sqlite databases in there that you still need) Regards On Friday, February 7, 2014 10:07:15 PM UTC+1, Austin Taylor wrote: Thanks, Massimo. Whenever I click register I get some new unknown column 'modified_by' in the field list (error 1054). I have tried manually adding each field whenever I get new errors, but I'm tired of it and just want to start over. I restored the views and controller to the default, but still get errors. When I create a new app and just use SQLite instead of mysql the register function works great. It also works well when I use it with another database in MYSql, but if I use it with my main database I run into issues. On Friday, February 7, 2014 1:50:54 PM UTC-5, Massimo Di Pierro wrote: Hard to help you without seeing the cod or the error tickets. There should be no difference between auth in sqlite or mysql. You should not save auth info a different database else you lose the ability to join the auth_user table with other tables and that is often an important requirement. On Thursday, 6 February 2014 06:38:26 UTC-6, Austin Taylor wrote: I've tried creating another app and authentication works fine there with the sqlite database, but when I try to use my mysql instance I run into error after error. Right now I have Login, Forgot Username and Lost Password when I hover over the login button. I don't know how to get it back to the default of just register/lost password/login. I have no idea where the code could be that messed up my registration. It was initially working but I tried creating another registration script that seems to have messed everything up. I tried removing the script and creating a new app and cloning the models/controllers but the old registration form which request a username still pops up. Any help would be greatly appreciated!! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/BfmiTOOM0o4/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: How to reset authentication?
Finally fixed!! Thank you so much! I had to delete all of the files in the app/databases folder. I didn't realize that checking those logs would help me see if the files could be written, but that helped a lot. Thank you! On Tue, Feb 11, 2014 at 6:13 AM, Austin Taylor atayloru...@gmail.com wrote: I used extract_mysql_models.py to create the models since I couldn't see them when I typed db.tables. After putting the defined models in db.py I could then see the models. I've tried troubleshooting with enable_migrate_all and migrate=True, but the register screen just stays blank for me. I'm also not sure how it is suppose to help me troubleshoot. I would like for the database to be able to overwrite any fields I have in there now and fix itself if possible. I thought that is what the migrate=True setting would do, but I must be wrong. On Fri, Feb 7, 2014 at 9:46 PM, LightDot light...@gmail.com wrote: Looks like web2py thinks that your main database structure is different than it really is. With other words, database migrations are broken for your app. That's why auth works if you start with a fresh database and doesn't if you use the existing one. Since you've been replacing one database with another (to test auth, etc.), how did you handle database migrations in web2py? Migrations are described here: http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Migrations What I would do: 1) if there was important data in the main database: check the differences between the database definitions and your current main database structure, sort that out using fake migrations (refer to Fixing broken migrations chapter in the book) 2) if there was no need to keep the old data from the main database: a) drop all tables from the main database b) delete all files from the applications/yourapp/databases folder (assuming there are no sqlite databases in there that you still need) Regards On Friday, February 7, 2014 10:07:15 PM UTC+1, Austin Taylor wrote: Thanks, Massimo. Whenever I click register I get some new unknown column 'modified_by' in the field list (error 1054). I have tried manually adding each field whenever I get new errors, but I'm tired of it and just want to start over. I restored the views and controller to the default, but still get errors. When I create a new app and just use SQLite instead of mysql the register function works great. It also works well when I use it with another database in MYSql, but if I use it with my main database I run into issues. On Friday, February 7, 2014 1:50:54 PM UTC-5, Massimo Di Pierro wrote: Hard to help you without seeing the cod or the error tickets. There should be no difference between auth in sqlite or mysql. You should not save auth info a different database else you lose the ability to join the auth_user table with other tables and that is often an important requirement. On Thursday, 6 February 2014 06:38:26 UTC-6, Austin Taylor wrote: I've tried creating another app and authentication works fine there with the sqlite database, but when I try to use my mysql instance I run into error after error. Right now I have Login, Forgot Username and Lost Password when I hover over the login button. I don't know how to get it back to the default of just register/lost password/login. I have no idea where the code could be that messed up my registration. It was initially working but I tried creating another registration script that seems to have messed everything up. I tried removing the script and creating a new app and cloning the models/controllers but the old registration form which request a username still pops up. Any help would be greatly appreciated!! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/BfmiTOOM0o4/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] how to make dictionary key a link
Hello, I'm displaying a dictionary using def results(): return dict(message=BEAUTIFY(session.dictionaryRequest)) Three of my keys have link values that I'd like the user to be able to click on. Is there a short way to do this? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: how to make dictionary key a link
I actually meant the value of the dictionary key: For example, a{'abc':'http://learnyourabcs.com'} a{'link':'http://thisisalink.com'} a{'user':'bob'} a{'norm':'anothervalue'} On Monday, February 10, 2014 6:00:54 PM UTC-5, Austin Taylor wrote: Hello, I'm displaying a dictionary using def results(): return dict(message=BEAUTIFY(session.dictionaryRequest)) Three of my keys have link values that I'd like the user to be able to click on. Is there a short way to do this? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: How to reset authentication?
Thanks, Massimo. Whenever I click register I get some new unknown column 'modified_by' in the field list (error 1054). I have tried manually adding each field whenever I get new errors, but I'm tired of it and just want to start over. I restored the views and controller to the default, but still get errors. When I create a new app and just use SQLite instead of mysql the register function works great. It also works well when I use it with another database in MYSql, but if I use it with my main database I run into issues. On Friday, February 7, 2014 1:50:54 PM UTC-5, Massimo Di Pierro wrote: Hard to help you without seeing the cod or the error tickets. There should be no difference between auth in sqlite or mysql. You should not save auth info a different database else you lose the ability to join the auth_user table with other tables and that is often an important requirement. On Thursday, 6 February 2014 06:38:26 UTC-6, Austin Taylor wrote: I've tried creating another app and authentication works fine there with the sqlite database, but when I try to use my mysql instance I run into error after error. Right now I have Login, Forgot Username and Lost Password when I hover over the login button. I don't know how to get it back to the default of just register/lost password/login. I have no idea where the code could be that messed up my registration. It was initially working but I tried creating another registration script that seems to have messed everything up. I tried removing the script and creating a new app and cloning the models/controllers but the old registration form which request a username still pops up. Any help would be greatly appreciated!! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: HTML Input (POST) field
Anthony/All, I'd like to return the results through an AJAX button. Right now I have everything being appended to a dictionary. How could I have the dictionary displayed on the same page after they click the button? On Wednesday, February 5, 2014 4:12:19 PM UTC-5, Anthony wrote: On Wednesday, February 5, 2014 3:32:46 PM UTC-5, Austin Taylor wrote: Now if I want to run it through a series of functions should I put the functions in the model.py? What would be the best way to do it? If the functions are needed in multiple controllers, you can define them in a model file. You can also import them from a module. Functions needed only within a given controller can be defined right in the controller itself (functions that take arguments or start with a double underscore are not exposed as actions via URL), though you may still prefer to organize them in modules. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: How to reset authentication?
Now I just tried to reset password and I get 1054, Unknown column 'auth_membership.is_active' in 'field list' On Friday, February 7, 2014 4:07:15 PM UTC-5, Austin Taylor wrote: Thanks, Massimo. Whenever I click register I get some new unknown column 'modified_by' in the field list (error 1054). I have tried manually adding each field whenever I get new errors, but I'm tired of it and just want to start over. I restored the views and controller to the default, but still get errors. When I create a new app and just use SQLite instead of mysql the register function works great. It also works well when I use it with another database in MYSql, but if I use it with my main database I run into issues. On Friday, February 7, 2014 1:50:54 PM UTC-5, Massimo Di Pierro wrote: Hard to help you without seeing the cod or the error tickets. There should be no difference between auth in sqlite or mysql. You should not save auth info a different database else you lose the ability to join the auth_user table with other tables and that is often an important requirement. On Thursday, 6 February 2014 06:38:26 UTC-6, Austin Taylor wrote: I've tried creating another app and authentication works fine there with the sqlite database, but when I try to use my mysql instance I run into error after error. Right now I have Login, Forgot Username and Lost Password when I hover over the login button. I don't know how to get it back to the default of just register/lost password/login. I have no idea where the code could be that messed up my registration. It was initially working but I tried creating another registration script that seems to have messed everything up. I tried removing the script and creating a new app and cloning the models/controllers but the old registration form which request a username still pops up. Any help would be greatly appreciated!! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] How to reset authentication?
I've tried creating another app and authentication works fine there with the sqlite database, but when I try to use my mysql instance I run into error after error. Right now I have Login, Forgot Username and Lost Password when I hover over the login button. I don't know how to get it back to the default of just register/lost password/login. I have no idea where the code could be that messed up my registration. It was initially working but I tried creating another registration script that seems to have messed everything up. I tried removing the script and creating a new app and cloning the models/controllers but the old registration form which request a username still pops up. Any help would be greatly appreciated!! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: [web2py:19089] Re: Input type button
Steve, I know this is an old post, but i'm trying to implement something like this (the classes). Where should I put the class index(): and how would I import it? Would it go in the default.py? On Sunday, April 5, 2009 6:03:26 AM UTC-4, Steve Shephed wrote: Where did you find the book in pdf format for under $20? You should look at the the following code that allows a callback without updating the page. This would be great for a calculator. class index(): button1=TAG.BUTTON(_onclick=$ .ajax({url: '%s', success: function (value) { $('#target').html(value); } }); % URL (r=request,f='callback')) div1=DIV(_id='target') return dict(button1=button1, div1=div1) class callback(): return H1('Hello world').xml() -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: How to reset authentication?
Or would it be possible for my authentication to be handled by another database?? I'm open for ideas/best practices. On Thursday, February 6, 2014 7:38:26 AM UTC-5, Austin Taylor wrote: I've tried creating another app and authentication works fine there with the sqlite database, but when I try to use my mysql instance I run into error after error. Right now I have Login, Forgot Username and Lost Password when I hover over the login button. I don't know how to get it back to the default of just register/lost password/login. I have no idea where the code could be that messed up my registration. It was initially working but I tried creating another registration script that seems to have messed everything up. I tried removing the script and creating a new app and cloning the models/controllers but the old registration form which request a username still pops up. Any help would be greatly appreciated!! -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] HTML Input (POST) field
This is driving me insane!! I've been trying to create an input field for a user to type in an IP address. I then want to assign their input to a variable, run it through my IP checks and return the result from our SQL database. In a nutshell, how can I assign their input to a variable (I'm thinking request.vars??) and then run it through a series of checks under myapp/controllers and return the result. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: HTML Input (POST) field
Anthony, I've followed this tutorial here: http://www.web2py.com/book/default/chapter/07#FORM my default.py looks like def display_form(): form=FORM('Your name:', INPUT(_name='name', requires=IS_NOT_EMPTY()), INPUT(_type='submit')) if form.accepts(request,session): response.flash = 'form accepted' elif form.errors: response.flash = 'form has errors' else: response.flash = 'please fill the form' return dict(form=form) and i'm not sure where in there I can assign a variable to run through a series of checks. I have a lot of checks I want to run the IP through and compare it against our SQL database. I just have to assign the input to a variable first. On Wednesday, February 5, 2014 10:51:01 AM UTC-5, Anthony wrote: Yes, it would be in request.vars (and request.post_vars, assuming a post request). Hard to help further without seeing some code. On Wednesday, February 5, 2014 10:20:35 AM UTC-5, Austin Taylor wrote: This is driving me insane!! I've been trying to create an input field for a user to type in an IP address. I then want to assign their input to a variable, run it through my IP checks and return the result from our SQL database. In a nutshell, how can I assign their input to a variable (I'm thinking request.vars??) and then run it through a series of checks under myapp/controllers and return the result. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: HTML Input (POST) field
I found what I was looking for. request.vars returns the data in dictionary format. All I had to do was assign a variable to the name of my key in request.vars (example: ip = request.vars['ip'] and it worked. Thank you!! On Wednesday, February 5, 2014 10:20:35 AM UTC-5, Austin Taylor wrote: First, thank you for any help. I really appreciate the support from these forums. I've been trying to create an input field for a user to type in an IP address and I can't seem to figure it out how to assign it to a variable. Tried following: http://www.web2py.com/book/default/chapter/07#Forms-and-validators and still seem to be missing something. I then want to assign their input to a variable, run it through my IP checks and return the result from our SQL database. In a nutshell, how can I assign their input to a variable (I'm thinking request.vars??) and then run it through a series of checks under myapp/controllers and return the result. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] MySQL not showing tables when using python web2py.py -S appname -M
Hello, I followed the instructions for importing legacy databases and created a db1.py which gave me a nice model, but I'd like to be able to interact with my current database. When I type db the shell returns DAL uri=mysql://*:@127.0.0.1/tablename I run for x in db: print x and it only shows user, user_group, user_membership, auth_event, and auth_cas when I access my database from phpmyadmin I don't even have those tables in the database. Am I doing something wrong? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: HTML Input (POST) field
Now if I want to run it through a series of functions should I put the functions in the model.py? What would be the best way to do it? On Wednesday, February 5, 2014 2:48:53 PM UTC-5, Anthony wrote: request.vars is a Storage object, so you can also do request.vars.ip. On Wednesday, February 5, 2014 2:20:21 PM UTC-5, Austin Taylor wrote: I found what I was looking for. request.vars returns the data in dictionary format. All I had to do was assign a variable to the name of my key in request.vars (example: ip = request.vars['ip'] and it worked. Thank you!! On Wednesday, February 5, 2014 10:20:35 AM UTC-5, Austin Taylor wrote: First, thank you for any help. I really appreciate the support from these forums. I've been trying to create an input field for a user to type in an IP address and I can't seem to figure it out how to assign it to a variable. Tried following: http://www.web2py.com/book/default/chapter/07#Forms-and-validators and still seem to be missing something. I then want to assign their input to a variable, run it through my IP checks and return the result from our SQL database. In a nutshell, how can I assign their input to a variable (I'm thinking request.vars??) and then run it through a series of checks under myapp/controllers and return the result. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: MySQL not showing tables when using python web2py.py -S appname -M
Hi Anthony, I created the db1.py (using scripts/extract_mysql_models.py) and placed that in the app/models folder. Should I have done something else? On Wednesday, February 5, 2014 2:53:40 PM UTC-5, Anthony wrote: When you do for x in db, that will iterate of the Table objects attached to db. The Table objects are just models defined in your model files -- they do not necessarily have to correspond to actual tables in your database. The tables you listed are Auth tables that would be defined via auth.define_tables(). If you have migrations turned off (or the database is not writable), then defining those tables in the model will not result in them actually being created in the database. Regarding the existing tables in the database, do you have models in your app defining them? Anthony On Wednesday, February 5, 2014 2:29:16 PM UTC-5, Austin Taylor wrote: Hello, I followed the instructions for importing legacy databases and created a db1.py which gave me a nice model, but I'd like to be able to interact with my current database. When I type db the shell returns DAL uri=mysql://*:@ 127.0.0.1/tablename I run for x in db: print x and it only shows user, user_group, user_membership, auth_event, and auth_cas when I access my database from phpmyadmin I don't even have those tables in the database. Am I doing something wrong? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: MySQL not showing tables when using python web2py.py -S appname -M
I have my default db.py model file and the db1.py which outlines my sql database. I didn't redfine anything else. All I did was update db.py to reflect the mysql layout. On Wednesday, February 5, 2014 4:09:36 PM UTC-5, Anthony wrote: How many model files do you have and what is in them? Did you inadvertently redefine the db object in a subsequent model file (that will remove any previously defined models)? Anthony On Wednesday, February 5, 2014 3:35:29 PM UTC-5, Austin Taylor wrote: Hi Anthony, I created the db1.py (using scripts/extract_mysql_models.py) and placed that in the app/models folder. Should I have done something else? On Wednesday, February 5, 2014 2:53:40 PM UTC-5, Anthony wrote: When you do for x in db, that will iterate of the Table objects attached to db. The Table objects are just models defined in your model files -- they do not necessarily have to correspond to actual tables in your database. The tables you listed are Auth tables that would be defined via auth.define_tables(). If you have migrations turned off (or the database is not writable), then defining those tables in the model will not result in them actually being created in the database. Regarding the existing tables in the database, do you have models in your app defining them? Anthony On Wednesday, February 5, 2014 2:29:16 PM UTC-5, Austin Taylor wrote: Hello, I followed the instructions for importing legacy databases and created a db1.py which gave me a nice model, but I'd like to be able to interact with my current database. When I type db the shell returns DAL uri=mysql://*:@ 127.0.0.1/tablename I run for x in db: print x and it only shows user, user_group, user_membership, auth_event, and auth_cas when I access my database from phpmyadmin I don't even have those tables in the database. Am I doing something wrong? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Anyway to interact with SQL Database?
I am using mysql. I've tried importing MySQLdb, pymysql, and importing DAL. I want to have an interactive prompt that I can practice querying tables on. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Anyway to interact with SQL Database?
Perfect! Thank you On Feb 4, 2014 2:00 PM, Austin Taylor atayloru...@gmail.com wrote: I am using mysql. I've tried importing MySQLdb, pymysql, and importing DAL. I want to have an interactive prompt that I can practice querying tables on. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to a topic in the Google Groups web2py-users group. To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/3BgAmfpELvc/unsubscribe. To unsubscribe from this group and all its topics, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Setting up examples (views/controllers)
Created a new test app and it worked. I must have messed up the kand app somehow. Really appreciate your help and quick replies! On Sunday, February 2, 2014 10:13:38 PM UTC-5, LightDot wrote: Basically, the files you need to have are: applications/kand/controllers/template_examples.py applications/kand/views/template_examples/variables.html Then simply visit http:127.0.0.1/kand/template_examples/variables Post your current directory structure if you can't get it to work. There is no point in us guessing. Regards On Monday, February 3, 2014 3:17:25 AM UTC+1, Austin Taylor wrote: https://lh4.googleusercontent.com/-k_GRjLmq2JQ/Uu78MulrZ5I/Fwo/DjaeMAVpGa0/s1600/webshot2.png Tried that here is the result: On Sunday, February 2, 2014 8:54:25 PM UTC-5, Ovidio Marinho wrote: 1) in Views: 2) Remove views/views/template_examples/variables.html 3) create template_examples/variables.html Only. Ovidio Marinho Falcao Neto ITJP.NET.BR ovid...@gmail.com itjp@gmail.com Brasil 2014-02-02 Austin Taylor atayl...@gmail.com: https://lh3.googleusercontent.com/-vCCairsIL3E/Uu71glrSHRI/FwY/3XNL2PF7JUw/s1600/screenshot.png On Sunday, February 2, 2014 8:44:47 PM UTC-5, Ovidio Marinho wrote: in views: create template_examples/variables.html no views/template_examples/variables.html, but is views/views/ template_examples/variables.html. Ovidio Marinho Falcao Neto ITJP.NET.BR ovid...@gmail.com itjp@gmail.com Brasil 2014-02-02 Austin Taylor atayl...@gmail.com: Same error: invalid function (views/template_examples) On Sunday, February 2, 2014 4:03:24 PM UTC-5, Massimo Di Pierro wrote: The view should be views/template_examples/variables.html On Sunday, 2 February 2014 11:21:30 UTC-6, Austin Taylor wrote: I've tried some of the examples on the site and created a function in my controllers folder. Controllers folder I have template_examples.py with a function called: def variables(): return dict(a=10, b=20) In my views folder I have variables.html with this code: {{extend 'layout.html'}} h1You variables/h1 h2a={{=a}}/h2 h2a={{=b}}/h2 I try to navigate to 127.0.0.1:8000/myapp/template_ examples/variables.html and I get: invalid function (template_examples/variables) I'm new to web developing with web2app and am trying to understand the basic layout, so I might have missed a step or need to add something else. I've also tried restarting the server. Any thoughts on what I could be missing? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Setting up examples (views/controllers)
I've tried some of the examples on the site and created a function in my controllers folder. Controllers folder I have template_examples.py with a function called: def variables(): return dict(a=10, b=20) In my views folder I have variables.html with this code: {{extend 'layout.html'}} h1You variables/h1 h2a={{=a}}/h2 h2a={{=b}}/h2 I try to navigate to 127.0.0.1:8000/myapp/template_examples/variables.html and I get: invalid function (template_examples/variables) I'm new to web developing with web2app and am trying to understand the basic layout, so I might have missed a step or need to add something else. I've also tried restarting the server. Any thoughts on what I could be missing? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[web2py] Re: Setting up examples (views/controllers)
Same error: invalid function (views/template_examples) On Sunday, February 2, 2014 4:03:24 PM UTC-5, Massimo Di Pierro wrote: The view should be views/template_examples/variables.html On Sunday, 2 February 2014 11:21:30 UTC-6, Austin Taylor wrote: I've tried some of the examples on the site and created a function in my controllers folder. Controllers folder I have template_examples.py with a function called: def variables(): return dict(a=10, b=20) In my views folder I have variables.html with this code: {{extend 'layout.html'}} h1You variables/h1 h2a={{=a}}/h2 h2a={{=b}}/h2 I try to navigate to 127.0.0.1:8000/myapp/template_examples/variables.html and I get: invalid function (template_examples/variables) I'm new to web developing with web2app and am trying to understand the basic layout, so I might have missed a step or need to add something else. I've also tried restarting the server. Any thoughts on what I could be missing? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Setting up examples (views/controllers)
https://lh3.googleusercontent.com/-vCCairsIL3E/Uu71glrSHRI/FwY/3XNL2PF7JUw/s1600/screenshot.png On Sunday, February 2, 2014 8:44:47 PM UTC-5, Ovidio Marinho wrote: in views: create template_examples/variables.html no views/template_examples/variables.html, but is views/views/ template_examples/variables.html. Ovidio Marinho Falcao Neto ITJP.NET.BR ovid...@gmail.com javascript: itjp@gmail.com javascript: Brasil 2014-02-02 Austin Taylor atayl...@gmail.com javascript:: Same error: invalid function (views/template_examples) On Sunday, February 2, 2014 4:03:24 PM UTC-5, Massimo Di Pierro wrote: The view should be views/template_examples/variables.html On Sunday, 2 February 2014 11:21:30 UTC-6, Austin Taylor wrote: I've tried some of the examples on the site and created a function in my controllers folder. Controllers folder I have template_examples.py with a function called: def variables(): return dict(a=10, b=20) In my views folder I have variables.html with this code: {{extend 'layout.html'}} h1You variables/h1 h2a={{=a}}/h2 h2a={{=b}}/h2 I try to navigate to 127.0.0.1:8000/myapp/template_ examples/variables.html and I get: invalid function (template_examples/variables) I'm new to web developing with web2app and am trying to understand the basic layout, so I might have missed a step or need to add something else. I've also tried restarting the server. Any thoughts on what I could be missing? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [web2py] Re: Setting up examples (views/controllers)
https://lh4.googleusercontent.com/-k_GRjLmq2JQ/Uu78MulrZ5I/Fwo/DjaeMAVpGa0/s1600/webshot2.png Tried that here is the result: On Sunday, February 2, 2014 8:54:25 PM UTC-5, Ovidio Marinho wrote: 1) in Views: 2) Remove views/views/template_examples/variables.html 3) create template_examples/variables.html Only. Ovidio Marinho Falcao Neto ITJP.NET.BR ovid...@gmail.com javascript: itjp@gmail.com javascript: Brasil 2014-02-02 Austin Taylor atayl...@gmail.com javascript:: https://lh3.googleusercontent.com/-vCCairsIL3E/Uu71glrSHRI/FwY/3XNL2PF7JUw/s1600/screenshot.png On Sunday, February 2, 2014 8:44:47 PM UTC-5, Ovidio Marinho wrote: in views: create template_examples/variables.html no views/template_examples/variables.html, but is views/views/ template_examples/variables.html. Ovidio Marinho Falcao Neto ITJP.NET.BR ovid...@gmail.com itjp@gmail.com Brasil 2014-02-02 Austin Taylor atayl...@gmail.com: Same error: invalid function (views/template_examples) On Sunday, February 2, 2014 4:03:24 PM UTC-5, Massimo Di Pierro wrote: The view should be views/template_examples/variables.html On Sunday, 2 February 2014 11:21:30 UTC-6, Austin Taylor wrote: I've tried some of the examples on the site and created a function in my controllers folder. Controllers folder I have template_examples.py with a function called: def variables(): return dict(a=10, b=20) In my views folder I have variables.html with this code: {{extend 'layout.html'}} h1You variables/h1 h2a={{=a}}/h2 h2a={{=b}}/h2 I try to navigate to 127.0.0.1:8000/myapp/template_ examples/variables.html and I get: invalid function (template_examples/variables) I'm new to web developing with web2app and am trying to understand the basic layout, so I might have missed a step or need to add something else. I've also tried restarting the server. Any thoughts on what I could be missing? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups web2py-users group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.