[web2py] remove a class from an element in the form

2013-05-10 Thread António Ramos
hello this code a=form.elements('#trabalhador_val_formacao__label') a[0]['_class'] = 'label label-warning' only appends to the existing class in the label. I want to replace existing label class with another one how do i do it? Thank you António -- --- You received this message

[web2py] Re: JQUERY as response in Ajax call?

2013-05-10 Thread Mika Sjöman
Hi No I am not calling it from a component, but from a jQuery post when I submit a phone number from a post via ajax. Any ideas? On Friday, May 10, 2013 2:49:33 PM UTC+8, Niphlod wrote: > > if you're using components, use response.js . > http://web2py.com/books/default/chapter/29/12?search=

[web2py] jQuery and Web2py? Multiple vars problem

2013-05-10 Thread Mika Sjöman
Hi I am having a problem because my forms are getting sent with multiple values. The issue is that on my page there are multiple places where the same formnames are used. So the post vars becomes like this: Parametersapplication/x-www-form-urlencoded answer280lesson75lesson75lesson75player_answ

[web2py] Re: upgrade web2py

2013-05-10 Thread LightDot
We recently updated a somewhat complex app from web2py 1.99.4 to 2.4.2 and it was pretty straightforward. Going to 2.4.6 should be exactly the same. Do make backups and test everything before going live. Things that required intervention were experimental features of web2py that we used, such a

[web2py] Re: JQUERY as response in Ajax call?

2013-05-10 Thread Anthony
http://web2py.com/books/default/chapter/29/11#Eval-target On Friday, May 10, 2013 6:13:23 AM UTC-4, Mika Sjöman wrote: > > Hi > > No I am not calling it from a component, but from a jQuery post when I > submit a phone number from a post via ajax. > > Any ideas? > > On Friday, May 10, 2013 2:49:33

[web2py] Re: remove a class from an element in the form

2013-05-10 Thread Anthony
Unless you are using formstyle='bootstrap', web2py does not add any class at all to elements -- instead, the "w2p_fl' class is added to the label's parent element (which is a TD, DIV, or LI, depending on the formstyle). The 'bootstrap' formstyle adds a 'control-label' class directly to the lab

[web2py] Re: How can Web2py prevent web scraping?

2013-05-10 Thread LightDot
Some of those rogue robots / harvesters are really damaging. I've seen them bring entire sites down. We are using mod_evasive and mod_bw for apache and also permanently ban certain IP ranges. But as you can see, none of this is web2py specific. Regards, Ales On Thursday, May 9, 2013 8:58:43 P

[web2py] Handling OPTIONS request in a web2py RESTful API

2013-05-10 Thread Daniel Gonzalez
Hi, I have implemented a RESTful api in web2py which handle the usual GET, POST, PUT, DELETE. (using @request.restful()) Is there a standard mechanism in web2py to implement OPTIONS requests? Thanks, Daniel -- --- You received this message because you are subscribed to the Google Groups "we

[web2py] Re: jQuery and Web2py? Multiple vars problem

2013-05-10 Thread Niphlod
the default function that you're using (ajax()) defined in web2py.js can't handle the "please restrict only to this formname" scenario. it's a bad design choice to have the same input names for different forms. It's a bad design choice to have the same formname for different forms (because of po

[web2py] Re: In openshift: Need help on why my web2py website is being constantly accessed by openshift itself

2013-05-10 Thread smoggy
Ok, apparently the commenting of option httpchk GET / like #option httpchk GET / solved the issue, now the logs do not get clogged with useless data. It was just the haproxy that failed to start. On Friday, May 10, 2013 1:37:27 AM UTC+1, smoggy wrote: > > I've checked ./haproxy-1.4/con

Re: [web2py] Re: How can Web2py prevent web scraping?

2013-05-10 Thread Alex Glaros
Advice doesn't have to be Web2py specific. Much appreciated, Alex On Fri, May 10, 2013 at 4:43 AM, LightDot wrote: > Some of those rogue robots / harvesters are really damaging. I've seen > them bring entire sites down. We are using mod_evasive and mod_bw for > apache and also permanently ban

Re: [web2py] Re: upgrade web2py

2013-05-10 Thread Richard Vézina
True! Here a post I made with a list of all the files that should be update on web2py update : https://groups.google.com/d/msg/web2py/tVyL7z7WHkw/mce13Vh-k3UJ I think we should create a Slice with it if not already done... Richard On Fri, May 10, 2013 at 7:13 AM, LightDot wrote: > We recent

[web2py] Re: jQuery and Web2py? Multiple vars problem

2013-05-10 Thread Anthony
It's not quite clear what your HTML looks like -- are you saying you have multiple forms (i.e., ) with the same web2py formname (i.e., same value in the hidden _formname field)? Or do you just have multiple elements with the same names (perhaps in separate forms, or outside of forms altogether

[web2py] How to build a db query for a many-to-many table given multiple constraints?

2013-05-10 Thread bracquet
How do I search for all products of a certain combination of filters in a many to many relationship? The products returned have to at least have the filters given. For example, if I had this many to many relationship: db.define_table('thefilter_products', Field('product', db.products),

Re: [web2py] Re: remove a class from an element in the form

2013-05-10 Thread António Ramos
*Note, form.element() returns the first matching element, so no need to do form.elements(...)[0].* * * This does not seem true if i remove [0] like this a['_class'] = 'label label-warning' i get the error TypeError: list indices must be integers, not str 2013/5/10 Anthony > Unless you are

[web2py] Re: How to build a db query for a many-to-many table given multiple constraints?

2013-05-10 Thread Niphlod
assuming that your filter is indeed myfilter = db(db.thefilter.name == 'Tops') all_products_that_are_tops = db(db.products.thefilter.belongs(myfilter. _select(db.thefilter.id))) this basically searches all the ids of the "thefilter" table that have a "name" == Tops. Then passes those id to th

[web2py] Voting system not working

2013-05-10 Thread sasogeek
Model db.define_table('content', Field('username'), Field('text', 'text'), Field('file', 'upload'), Field('userpicture'), Field('time', 'datetime', update=request.now), Field('userid', readable=False), Field('votesup', 'integer', default=0), Field('votesdown', 'integ

Re: [web2py] Re: remove a class from an element in the form

2013-05-10 Thread Anthony
Notice it is form.element(), not form.elements(). The first returns the first matching element -- the second returns a list (even if it contains only one match). Anthony On Friday, May 10, 2013 11:40:58 AM UTC-4, Ramos wrote: > > *Note, form.element() returns the first matching element, so no n

Re: [web2py] Re: remove a class from an element in the form

2013-05-10 Thread António Ramos
nice point. :) 2013/5/10 Anthony > Notice it is form.element(), not form.elements(). The first returns the > first matching element -- the second returns a list (even if it contains > only one match). > > Anthony > > On Friday, May 10, 2013 11:40:58 AM UTC-4, Ramos wrote: > >> *Note, form.eleme

[web2py] I'm using "selectable=True" in the sqlform.grid. This shows a checkbox in first column for all the r

2013-05-10 Thread Pawan Jha
I'm using "selectable=True" in the sqlform.grid. This shows a checkbox in first column for all the rows "except the header" and there is submit button i want to get all the Checked item id please reply ... -- --- You received this message because you are subscribed to the Google Groups "web2

[web2py] SQLFROM.GRID SELECTEBLE

2013-05-10 Thread Pawan Jha
Hi I am new developer with Web2py so getting problem to work on so please help I'm using "selectable=True" in the sqlform.grid. This shows a checkbox in first column for all the rows "except the header" and Submit Button i want to get all the Selected check box id on clicking on submit button

Re: [web2py] SQLFROM.GRID SELECTEBLE

2013-05-10 Thread Javier Pepe
Hi you have to use selectable = lambda ids: function(ids) def function(ids): ... ... ... On Fri, May 10, 2013 at 9:14 AM, Pawan Jha wrote: > Hi I am new developer with Web2py so getting problem to work on so please > help > > > I'm using "selectable=True" in the sqlform.grid. This shows a che

[web2py] Number format using represent

2013-05-10 Thread Omi Chiba
I'm trying to display ShipQty field value with correct number format such as 1,500 but it shows 1500. I don't know if my represent statement is wrong or because I'm using bootstrap table style... model db.define_table('shipping', Field('FullOrderNumber', length=11, label='

[web2py] Re: How to build a db query for a many-to-many table given multiple constraints?

2013-05-10 Thread bracquet
Hm.. Maybe I'm not understanding something. I thought the standard way of creating a many to many relationship was to create a table which holds the ids of the two things you're creating a relationship with. With this example, db.define_table('products', Field('name')) db.define_tab

[web2py] User application GUI

2013-05-10 Thread ArtDijk
LS I (am new and) want to develop a web business application. The user interface (gui) should look like a windows application, just like the pyside app I've build. How can this be done ? What library should I use ? Do you know of an example ? This library shows that it is possible. Can this libr

[web2py] Application GUI

2013-05-10 Thread ArtDijk
I want to develop a business web app. I want the user interface (gui) to be like a windows interface more or less the same as the app windows version build with qt (pyside). What gui library do I need ? Thanks Arthur -- --- You received this message because you are subscribed to the Google G

[web2py] Re: Voting system not working

2013-05-10 Thread sasogeek
I need help. On Friday, 10 May 2013 16:53:23 UTC+1, sasogeek wrote: > > Model > db.define_table('content', > Field('username'), > Field('text', 'text'), > Field('file', 'upload'), > Field('userpicture'), > Field('time', 'datetime', update=request.now), > Field('userid',

Re: [web2py] Re: Voting system not working

2013-05-10 Thread Vinicius Assef
What is exactly happening? The votesup field is not being added or the updated result is not being showed? Using some inspection tool, is your default/voteup() function being invoked? What did you already tried? Help us help you. On Fri, May 10, 2013 at 3:46 PM, sasogeek wrote: > I need help.

[web2py] Not good at making ajax calls from a view

2013-05-10 Thread Jordan Ladora
Hi, I'm trying to implement a drop-down based on the one at http://www.web2pyslices.com/slice/show/1467/cascading-drop-down-lists-with-ajax While the example above works great, I don't seem to be making a successful ajax call in my adaptation.. Basically, the second dropdown does not reload

[web2py] Re: How to build a db query for a many-to-many table given multiple constraints?

2013-05-10 Thread Niphlod
sorry, I didn't understood what you model was. So, let's say you have products table: id name 1 "foo" 2 "bar" and filters table: id name 1 "top" 2 "sweatshirt" 3 "hoodie" and a product_filter table id product_id filter_id 1 1 1 2 1 2 3 2 3 so, basically, wh

[web2py] Re: Number format using represent

2013-05-10 Thread Niphlod
represent is used in widgets only, it doesn't get called for "raw" representations such as {{=record.column}} if you want to leverage your model's represent, you have to call it {{=db.table.column.represent(record.column, record)}} On Friday, May 10, 2013 6:57:48 PM UTC+2, Omi Chiba wrote: > > I

[web2py] Re: Number format using represent

2013-05-10 Thread Omi Chiba
Thank you for the info! I finally solved it by referencing the previous post!! https://groups.google.com/forum/?fromgroups=#!searchin/web2py/Number$20format$20locale/web2py/51XIw3Lz74c/vLnyxa9gfmgJ model -- import locale locale.setlocale(locale.LC_NUMERIC, 'English') def number_format(nu

[web2py] Re: Number format using represent

2013-05-10 Thread Niphlod
warning... setlocale is NOT threadsafe. http://docs.python.org/2/library/locale.html use it wisely. On Friday, May 10, 2013 9:20:38 PM UTC+2, Omi Chiba wrote: > > Thank you for the info! > > I finally solved it by referencing the previous post!! > > https://groups.google.com/forum/?fromgroups=#!

[web2py] Re: Not good at making ajax calls from a view

2013-05-10 Thread Anthony
Maybe try: onchange="jQuery(district_select).remove(); ajax('%s', ['title_select'], 'shadow_clone');" % URL('default', 'maker') Anthony On Friday, May 10, 2013 2:18:55 PM UTC-4, Jordan Ladora wrote: > > Hi, > > I'm trying to implement a drop-down based on the one at > http://www.web2pyslices.c

[web2py] Re: How to build a db query for a many-to-many table given multiple constraints?

2013-05-10 Thread bracquet
Thanks for your patience. That's neat. I didn't know you could declare a linkage table like that. I don't think that scenario would fit into what I'm thinking. Please let me rephrase my example scenario. What about this scenario: id name 1 "foo" 2 "bar" 3 "hello" 4 "world" and filt

Re: [web2py] Re: Voting system not working

2013-05-10 Thread sasogeek
nothing happens, and i think it's because i didn't include layout... because when i do the exact same thing in the book, it works fine, but with the same example, when i remove the extend layout line, it doesn't work anymore i don't want to use the default layout though... what files should

[web2py] Re: jQuery and Web2py? Multiple vars problem

2013-05-10 Thread Mika Sjöman
Looks like a great solution! Thanks!! // mika On Friday, May 10, 2013 9:42:46 PM UTC+8, Anthony wrote: > > It's not quite clear what your HTML looks like -- are you saying you have > multiple forms (i.e., ) with the same web2py formname (i.e., > same value in the hidden _formname field)? Or do

[web2py] IS_IN_DB orderby natural sort?

2013-05-10 Thread rppowell
I have pre-populated a table of types by name: db.item_type.insert(name='Type1'...) db.item_type.insert(name='Type2'...) db.item_type.insert(name='Type3'...) ... db.item_type.insert(name='Type10'...) db.item_type.insert(name='Type11'...) ... I want to use the table as selection in an

[web2py] realpython for the web

2013-05-10 Thread Massimo Di Pierro
There is a nice course on Python, Sqlite, Wsgi, Flask and web2py: http://www.realpython.com/#pricing Check it out. Massimo -- --- 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

[web2py] Re: JQUERY as response in Ajax call?

2013-05-10 Thread Gergely Orosz
Hi Mika, Have you tried simply retunrning the jQuery string. I have some ajax calles in my projects and it is working fine for me. There are two difference I don't use: return false; when calling ajax and return the jQuery command not a variable I hope I could help Regargds Greg On Friday, 10

[web2py] Bootstrap tooltip

2013-05-10 Thread Annet
In an application created in a previous version of web2py, the Boostrap tooltip works fine. When create an application in web2py 2.4.6 the exact same code no longer works, the tooltip defaults to the ugly yellow one. in the view: test in web2py.js: function web2py_ajax_init(target) { jQue