[web2py] Re: check url agrs / vars after #

2020-06-30 Thread Massimo Di Pierro
You cannot because the browser does not send those to the server. Your only option is to inject some JS in the page that reads it from window.location.hash and POST to an API, after the page is loaded. On Sunday, 28 June 2020 07:37:54 UTC-7, Ari Lion BR Sp wrote: > > > Hi, how to get / check >

[web2py] Re: Check box access

2018-12-09 Thread pradeep chauhan
yes if if auth.user.first_name ="string": On Sunday, December 9, 2018 at 1:48:35 PM UTC+5:30, 黄祥 wrote: > > think you can compare the logged in user with if else condition > *ref:* > > http://web2py.com/books/default/chapter/29/02/the-python-language#if-elif-else > http://web2py.com/books/def

[web2py] Re: Check box access

2018-12-09 Thread 黄祥
think you can compare the logged in user with if else condition *ref:* http://web2py.com/books/default/chapter/29/02/the-python-language#if-elif-else http://web2py.com/books/default/chapter/29/09/access-control http://web2py.com/books/default/chapter/29/07/forms-and-validators best regards, stifan

[web2py] Re: check boxes with is_in_set

2016-12-13 Thread 黄祥
it's work now, even in the tuple inside the list data type, my bad to treat the list data type in an unproper manner, hehe *is_in_set list checkboxes refer to rows table database * *e.g.* def attendance_form(): target_response = "jQuery('#attendance_checkout').get(0).reload()" rows_list_employee

[web2py] Re: check boxes with is_in_set

2016-12-12 Thread Jim Russell
In your example, list_chart is not a list of strings, it is a list of tuples. In my code, hostnames is just a list of hostnames. e.g. ('hostname1.example.com','hostname2.example.com') I assume that you are trying to make the checkboxes default to true. For me, they defaulted to being checked.

[web2py] Re: check boxes with is_in_set

2016-12-12 Thread 黄祥
trying the tricks but got error when the checkbox is empty (1 or all checkbox is empty, when all checkbox is on its work) : *e.g.* def test_form(): redirect_url = 'test' list_chart = [(True, 'line'), (True, 'pie'), (True, 'bar') ] form = SQLFORM.factory( Field('chart', 'list:string', defau

[web2py] Re: check boxes with is_in_set

2016-12-08 Thread Jim Russell
Rob, I used this code to get a list with checkboxes. form=SQLFORM.factory( Field('hostnames',"list:string", default=hostnames,widget=SQLFORM.widgets.checkboxes.widget,requires=[IS_IN_SET(hostnames,multiple=True),IS_NOT_EMPTY()])) hostnames is a list containing strings. -- Resource

Re: [web2py] Re: Check to establish whether or not a record exists

2016-11-25 Thread Massimo Di Pierro
db.mytable(name=s) is shortcut for db(db.mytable.name==s).select(limitby=(0,1)).first() On Monday, 21 November 2016 09:58:01 UTC-6, Ramos wrote: > > I used this compact way and i noticed it only returns one record. > > for example > > table db.badass > id name value > 1trump 10 > 2

Re: [web2py] Re: Check to establish whether or not a record exists

2016-11-21 Thread António Ramos
I used this compact way and i noticed it only returns one record. for example table db.badass id name value 1trump 10 2trump 20 3hilary30 db.badass(name="trump") only returns record with id =1 Regards António 2016-11-21 15:47 GMT+00:00 Massimo Di Pierro : > It depends

[web2py] Re: Check to establish whether or not a record exists

2016-11-21 Thread Massimo Di Pierro
It depends a query is always field==value so you can do query = db.table.field == value row = db(query).select(limitby=(0,10)).first() or row = db.table(query) (they are equivalent) But db.table(...) can take an "implicit query" db.table(fieldname=value) which is a more compact

[web2py] Re: Check to establish whether or not a record exists

2016-11-20 Thread Meinolf
Hi Massimo Just came across this post and got a bit alarmed, so when i check if a record exists i don't have to use the usual '==' but instead '=' ? On Monday, October 10, 2011 at 3:55:27 PM UTC+2, Massimo Di Pierro wrote: > > row = db.postcode_cache(postcode=postcode) > if not row: > db.postc

[web2py] Re: Check to see if a field is in another table in a computed field

2016-02-12 Thread Greg White
At our facility we order a lot of unique items but also have an inventory of some items. I am trying to add some logic that when ordering an item, there is a check to see if the ordered item name is in the inventory (inventory.name). Then person ordering is made aware that a similar item is in

[web2py] Re: Check to see if a field is in another table in a computed field

2016-02-11 Thread Anthony
What are you trying to do? Do you want to store this information in the POrequest table, or do you want to prevent inserts if the item is not in the db.inventory table? If the latter, IS_IN_DB will certainly work, but note that validators only get run if you are using SQLFORM or if you call .va

[web2py] Re: Check to see if a field is in another table in a computed field

2016-02-11 Thread Greg White
I should have mentioned that I tried IS_IN_DB first off and it didn't work On Wednesday, February 10, 2016 at 4:25:48 PM UTC-7, Dave S wrote: > > > > On Wednesday, February 10, 2016 at 2:01:52 PM UTC-8, Greg White wrote: >> >> Want a computed field to show whether or not a field value exists in >

[web2py] Re: Check to see if a field is in another table in a computed field

2016-02-11 Thread Anthony
On Wednesday, February 10, 2016 at 5:01:52 PM UTC-5, Greg White wrote: > > Want a computed field to show whether or not a field value exists in > another table > > started with this... > > db.define_table( > 'inventory', > Field('name'), > Field('qty', label='Quantity'), > Field('M

[web2py] Re: Check to see if a field is in another table in a computed field

2016-02-10 Thread Dave S
On Wednesday, February 10, 2016 at 2:01:52 PM UTC-8, Greg White wrote: > > Want a computed field to show whether or not a field value exists in > another table > I'm not sure that is the right approach. I think that the standard validator IS_IN_DB() is what you want, instead. http://web2py.

[web2py] Re: Check file size before upload process

2015-03-10 Thread William Chen
I believe you can use 'onvalidation' to check the file size before upload. http://web2py.com/books/default/chapter/29/07/forms-and-validators#onvalidation -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.go

[web2py] Re: Check is user is the owner of row (help with db query)

2014-09-10 Thread Anthony
> db((db.task.id == 5) & (db.task.ref_to_job == db.job.id) & > (db.job.ref_to_project == db.project.id) & (db.project.owner == > auth.user_id)) > > I tried it and it works, but I am not sure how different it is from the > one Leonel suggested. How does this work? > The above does a join, so i

[web2py] Re: Check is user is the owner of row (help with db query)

2014-09-10 Thread desta
Thanks Anthony, indeed I will have to evaluate the tradeoff of speed for complexity. I don't think that our site will have the amount of traffic that this would be a problem but its always good to know good practices! A friend suggested to use db((db.task.id == 5) & (db.task.ref_to_job == db.job

[web2py] Re: Check is user is the owner of row (help with db query)

2014-09-08 Thread Anthony
On Monday, September 8, 2014 4:47:57 AM UTC-4, Leonel Câmara wrote: > > Frankly, I would just store the user as the owner in all of those tables. > Probably using auth.signature(). > > You could do a very inefficient recursive select but I don't see any > advantage. > > Something like: > > task =

Re: [web2py] Re: Check is user is the owner of row (help with db query)

2014-09-08 Thread desta
Thank you guys for your valuable answers. On Monday, September 8, 2014 2:51:56 PM UTC+3, Marin Pranjić wrote: > > Make sure to read Authorization chapter in book: > > http://web2py.com/books/default/chapter/29/09/access-control#Authorization > > -- Resources: - http://web2py.com - http://web2py.

Re: [web2py] Re: Check is user is the owner of row (help with db query)

2014-09-08 Thread Marin Pranjić
Make sure to read Authorization chapter in book: http://web2py.com/books/default/chapter/29/09/access-control#Authorization -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (R

[web2py] Re: Check is user is the owner of row (help with db query)

2014-09-08 Thread Leonel Câmara
It's not exactly bad practice, quite the contrary, usually you want to start with a database without redundancy. This is just a case where denormalization really yields fruits as it is very inefficient to have to query the jobs and projects table to know who is the owner of a task. An alter

[web2py] Re: Check is user is the owner of row (help with db query)

2014-09-08 Thread desta
Thank you, so you mean is bad practice the way I implemented the tables? When I designed it like that, I thought it would be convenient in altering the relations between the records. On Monday, September 8, 2014 11:47:57 AM UTC+3, Leonel Câmara wrote: > > Frankly, I would just store the user as

[web2py] Re: Check is user is the owner of row (help with db query)

2014-09-08 Thread Leonel Câmara
Frankly, I would just store the user as the owner in all of those tables. Probably using auth.signature(). You could do a very inefficient recursive select but I don't see any advantage. Something like: task = db.tasks[5] if task.job.project.owner != auth.user_id: # You are doing a select fo

[web2py] Re: Check to delete glitch in 2.9.6 and 2.9.7

2014-09-06 Thread Ide
Great, fixed on my server now. 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 the Google

[web2py] Re: Check to delete glitch in 2.9.6 and 2.9.7

2014-09-05 Thread Massimo Di Pierro
Good catch! fixed in trunk. On Friday, 5 September 2014 08:07:42 UTC-5, Ide wrote: > > I have 2 applications which both seem to have a problem with the 'check to > delete' option in 2.9.6 and 2.9.7. The 'check to delete' label on this tick > box is now showing up as 'Check to deleteNone'. I don;

[web2py] Re: Check file size before upload process

2014-01-26 Thread Massimo Di Pierro
You cannot check before it is uploaded. If you use apache or nginx, then can check and block large uploads, but you would get a web server error, not a web2py error. On Sunday, 26 January 2014 13:32:16 UTC-6, lesssugar wrote: > > I'm using IS_LENGTH in my model to validate file size of uploaded

[web2py] Re: check if db field is empty

2014-01-22 Thread Anthony
How about: if db((db.script.id == id_skripte) & (db.script.sc_engine != None)).select (): Anthony On Wednesday, January 22, 2014 9:30:45 AM UTC-5, Yebach wrote: > > I tryied with > > eng_out = db(db.script.id == > id_skripte).select(db.script.sc_engine_output)[0]['sc_engine_output'] > prin

[web2py] Re: check if db field is empty

2014-01-22 Thread Yebach
I tryied with eng_out = db(db.script.id == id_skripte).select(db.script.sc_engine_output)[0]['sc_engine_output'] print "eng_out ", eng_out if eng_out is None: print "Ni podatkov" but I am sure there has to be a better way. thanx again -- Resources: - http://web2py.com

[web2py] Re: Check it out: PURE AJAX file uploads :D

2013-04-24 Thread select
so i basically missed what is going on right now because I did not looked at the problem for half a year http://caniuse.com/xhr2 xhr2 is supported by almost all browsers and xhr2 supports sending files :D implementations are here http://stackoverflow.com/a/10811427/1436151 http://stackoverflow.c

[web2py] Re: Check it out: PURE AJAX file uploads :D

2013-04-24 Thread select
so what do these drop loaders do to make pure ajax file uploads, i was not aware of that o_O On Wednesday, April 24, 2013 6:19:09 PM UTC+2, Niphlod wrote: > > it's not that I don't like the use of native js api, but if the tradeoff > is transmitting as base64 that's not an implementation I want

[web2py] Re: Check it out: PURE AJAX file uploads :D

2013-04-24 Thread Niphlod
it's not that I don't like the use of native js api, but if the tradeoff is transmitting as base64 that's not an implementation I want to use (given that there are plenty of "drop-loaders" out there). Base64 the contents means wasting a net 33% of bandwith. -- --- You received this message b

[web2py] Re: Check it out: PURE AJAX file uploads :D

2013-04-24 Thread select
readAsBinaryString and readAsArrayBuffer and readAsText did not work, i just tested, but if you have a hint on how to make them work I would be very interested On Wednesday, April 24, 2013 5:53:33 PM UTC+2, Niphlod wrote: > > why the base64 ? I want my files submitted as binaries, if possibile...

[web2py] Re: Check it out: PURE AJAX file uploads :D

2013-04-24 Thread Niphlod
why the base64 ? I want my files submitted as binaries, if possibile. On Wednesday, April 24, 2013 5:31:48 PM UTC+2, select wrote: > > in your client side js code use the js file api (this is for one file, but > multi file upload can be done too) > > $('#datafile-uploadfield').change(function

[web2py] Re: Check if exist table (dal)

2013-04-17 Thread damufo
Hi, Thanks. My solution was: if self.table_name not in db._migrated: self.install() Best regards. On Tuesday, April 16, 2013 3:31:12 PM UTC+2, dam...@gmail.com wrote: > > > Hi, > In my init class have a install() with create table. > When creates second instance, fail. > >

[web2py] Re: Check if exist table (dal)

2013-04-16 Thread Niphlod
if you leverage db.define_table that doesn't happen. If you do it all by hand, either you try: select 1 from table except: pass or you do what you're doing (or you store somewhere that you don't need to "install()" every time ^_^) On Tuesday, April 16, 2013 3:31:12 PM UTC+2, dam...@gmai

Re: [web2py] Re: Check if a from's boolean is true or false from the controller

2012-12-05 Thread Niphlod
and why should you need it ? you can always do: newthing = {} if something: newthing = form.vars dowhatever with newthing (it's an empty dict that in theory shouldn't hurt) On Wednesday, December 5, 2012 1:49:00 AM UTC+1, Daniele wrote: > > How can I blank out all the **form.vars in the ev

Re: [web2py] Re: Check if a from's boolean is true or false from the controller

2012-12-04 Thread Daniele Pestilli
There's some problem with what I'm doing now. I have form = SQLFORM.factory() with all the fields in my controller. In my db.py file, I am extending auth with auth.settings.extra_fields['auth_user']= [ Field ('t_image'), Field

Re: [web2py] Re: Check if a from's boolean is true or false from the controller

2012-12-04 Thread Daniele Pestilli
How can I blank out all the **form.vars in the event that the form.vars.is_tutor returns false? Is there a simple way to do this or should I manually put in None for all the fields? On Tue, Dec 4, 2012 at 8:16 PM, Niphlod wrote: > depends on where do you use that kind of logic. If the user is a

[web2py] Re: Check if a from's boolean is true or false from the controller

2012-12-04 Thread Niphlod
depends on where do you use that kind of logic. If the user is already logged, you need to UPDATE the corresponding "auth_user" row with the data inserted, something among the lines of db(db.auth_user.id == auth.user_id).update(**form.vars) If instead you are requesting the user to fill that fo

[web2py] Re: Check if a from's boolean is true or false from the controller

2012-12-04 Thread Daniele
And the same goes for db.auth_user.insert() ... does it imply the logged user or not? On Monday, December 3, 2012 2:27:29 PM UTC, Daniele wrote: > > Hey guys, I'm wondering if there's a way from the controller to know > whether a form's boolean field (checkbox) is selected or not. I only want >

[web2py] Re: Check if a from's boolean is true or false from the controller

2012-12-04 Thread Daniele
Another question has come to mind...I have the following code in my controller now: if tform.process().accepted: if tform.vars.is_tutor: auth.add_membership('Tutors') db.auth_user.insert( a_bunch_of_fields = tform.vars.a_bunch_of_fields) els

[web2py] Re: Check if a from's boolean is true or false from the controller

2012-12-04 Thread Daniele
Thanks that was super helpful! On Tuesday, December 4, 2012 4:31:08 PM UTC, Niphlod wrote: > > if form.process().accepted: > if form.vars.is_tutor: > ...whatever, e.g. db.table.insert(**form.vars) > > How do you structure your db to save this data is up to your application: > if y

[web2py] Re: Check if a from's boolean is true or false from the controller

2012-12-04 Thread Niphlod
if form.process().accepted: if form.vars.is_tutor: ...whatever, e.g. db.table.insert(**form.vars) How do you structure your db to save this data is up to your application: if you need this stored next to the auth_user table the recommended way is extending auth_user with auth.set

[web2py] Re: Check if a from's boolean is true or false from the controller

2012-12-04 Thread Daniele
OK. So I removed what I had before (tables in a database) and moved to SQLFORM.factory. I now have this in my controller: form = SQLFORM.factory( Field('is_tutor', 'boolean'), Field('image', 'upload', requires=IS_EMPTY_OR(IS_IMAGE(extensions=('jpeg', 'jpg', 'png', 'gif',

[web2py] Re: Check if a from's boolean is true or false from the controller

2012-12-03 Thread Niphlod
if it's checked the corresponding var would be True. If the form is submitted the controller will receive that field as request.vars.fieldname or as form.vars.fieldname if you are using a form. When you "get to" the form.process() line the value has been already been "shipped" to the database.

[web2py] Re: Check for a value in a table

2012-09-18 Thread lcamara
There are lots of better ways, one would be: count_value = db(db.table.fieldname == value)..count() if not count_value: # Value isn't in db do something Terça-feira, 18 de Setembro de 2012 11:36:11 UTC+1, Hassan Alnatour escreveu: > > Dear ALL , > > How can a check if a value for a Field in

[web2py] Re: Check to delete:False

2012-03-29 Thread Annet
Hi Alan and Anthony, I upgraded to 1.99.7 from 1.99.2 to solve my represent problem, to solve the check to delete problem I had to change separator=False to separator='' @Anthony, thanks for your explanation. Seems like I chose the wrong solution on 02/08/2011 to solve the colon problem in SQLF

[web2py] Re: Check to delete:False

2012-03-29 Thread Anthony
SQLFORM takes "delete_label" and "separator" arguments. Previously (at least up to 1.99.2), delete_label defaulted to "Check to delete:", and the separater was not appended. At some point since 1.99.2, it was changed -- now delete_label defaults to "Check to delete", and separator (which defaul

[web2py] Re: Check to delete:False

2012-03-29 Thread Alan Etkin
Looks like an error when typing or something like that. For me it should be only "Check to delete" On Thursday, March 29, 2012 4:49:08 AM UTC-3, Annet wrote: > > After upgrading from 1.99.2 to 1.99.7 the "check to delete" label has > changed to "check to delete: False" > > Check to > delete:Fa

Re: [web2py] Re: Check out my new site! (also trouble with routes.py)

2012-03-27 Thread Jonathan Lundell
On Mar 27, 2012, at 7:35 AM, Anthony wrote: > Routes looks OK -- is that the entire routes.py file? Any app-specific routes? It does look OK, though keep in mind that setting the default a/c/f in a parametric router is subtly different from setting them outside the router. Do you get any more in

[web2py] Re: Check out my new site! (also trouble with routes.py)

2012-03-27 Thread Anthony
> > I kept having trouble after I took the routes.py out, and I think my > issue was that web2py wasn't always figuring out my > redirect(URL('pagename'))'s correctly. I explicitly added in the app > and controller names to all the redirects and it solved whatever was > happening. When you d

[web2py] Re: Check out my new site! (also trouble with routes.py)

2012-03-27 Thread vtgorilla
That was the entire file. I only have the one public facing app, so I didn't try to do anything fancy with it yet. I kept having trouble after I took the routes.py out, and I think my issue was that web2py wasn't always figuring out my redirect(URL('pagename'))'s correctly. I explicitly added in t

[web2py] Re: Check out my new site! (also trouble with routes.py)

2012-03-27 Thread Anthony
Nice. Just added to http://web2py.com/poweredby. Routes looks OK -- is that the entire routes.py file? Any app-specific routes? Anthony On Tuesday, March 27, 2012 7:46:02 AM UTC-4, vtgorilla wrote: > > I just launched it this morning: http://RosterBrain.com > > I was having a lot of trouble ge

[web2py] Re: Check out my new site! (also trouble with routes.py)

2012-03-27 Thread Massimo Di Pierro
:-) On Tuesday, 27 March 2012 06:46:02 UTC-5, vtgorilla wrote: > > I just launched it this morning: http://RosterBrain.com > > I was having a lot of trouble getting routes.py to work with my form > submits so I just stripped it for the time being. Is there anything > wrong with the following sy

[web2py] Re: Check out my new site! (also trouble with routes.py)

2012-03-27 Thread vtgorilla
Yes, but I borrowed inspiration heavily from another design. On Mar 27, 8:15 am, lyn2py wrote: > Very nice theme! > Did you design it yourself? > > > > > > > > On Tuesday, March 27, 2012 7:46:02 PM UTC+8, vtgorilla wrote: > > > I just launched it this morning:http://RosterBrain.com > > > I was ha

[web2py] Re: Check out my new site! (also trouble with routes.py)

2012-03-27 Thread lyn2py
Very nice theme! Did you design it yourself? On Tuesday, March 27, 2012 7:46:02 PM UTC+8, vtgorilla wrote: > > I just launched it this morning: http://RosterBrain.com > > I was having a lot of trouble getting routes.py to work with my form > submits so I just stripped it for the time being. Is

[web2py] Re: Check if request method is post

2012-02-20 Thread Alan Etkin
This command returns a string with the method name (uppercase) request.env.request_method On 20 feb, 17:26, Hassan Alnatour wrote: > Dear All , > > How can i check if the request method is post ?

[web2py] Re: Check if request method is post

2012-02-20 Thread Anthony
Also, if request.post_vars is not None, then it is a post request -- so you could do something like: if request.post_vars: [do something with POST request variables] Note, request.vars contains both request.get_vars and request.post_vars. Anthony On Monday, February 20, 2012 3:35:23 PM UTC

[web2py] Re: Check if request method is post

2012-02-20 Thread Niphlod
the method is stored into request.env.request_method . So request.env.request_method == 'POST' is what you're looking for

Re: [web2py] Re: Check to establish whether or not a record exists

2011-10-10 Thread Chris Rowson
Thank you Massimo :-) Chris On Mon, Oct 10, 2011 at 2:55 PM, Massimo Di Pierro wrote: > row = db.postcode_cache(postcode=postcode) > if not row: > db.postcode_cache.insert(postcode=postcode,nearset=nearest) > elif not row.nearest: row.update_record(nearset=nearest) > else: pass # do nothing > >

[web2py] Re: Check to establish whether or not a record exists

2011-10-10 Thread Massimo Di Pierro
row = db.postcode_cache(postcode=postcode) if not row: db.postcode_cache.insert(postcode=postcode,nearset=nearest) elif not row.nearest: row.update_record(nearset=nearest) else: pass # do nothing On Oct 10, 8:22 am, Chris Rowson wrote: > Hi list, > > I have a database table which looks like this:

[web2py] Re: Check out my new web2py website

2011-08-01 Thread weheh
ninjaui looks good. but i'm using jquery ui On Aug 1, 3:43 pm, Bruno Rocha wrote: > are you using ninjaui?http://ninjaui.com/objects > > On Mon, Aug 1, 2011 at 9:06 AM, weheh wrote: > > I want to keep this low profile for now because there is still much to > > do. But if anyone is interested in

[web2py] Re: Check out my new web2py website

2011-08-01 Thread Christopher Steel
Looks very promising weheh. Chris

[web2py] Re: Check

2011-07-06 Thread beedge
Apologises. Stupid. Double (differeing) definition of db in the model file, before and after some custom auth tables. Hence, app was pulling in my apps tables, but I couldn't see the auth stuff and odd behaviour.

[web2py] Re: Check

2011-07-06 Thread ron_m
If you started with a copy of the Welcome app did you change the database name? If both apps have the same database URL originally defined in the Welcome app in file models/db.py they will share tables.

[web2py] Re: Check

2011-07-06 Thread Anthony
That doesn't sound right. Can you reproduce the behavior? Are you using CAS ( https://groups.google.com/d/topic/web2py/Qcw6B1Y89JM/discussion), or regular Auth? Anthony On Wednesday, July 6, 2011 3:20:37 PM UTC-4, beedge wrote: > Thanks for responses. Point about definition of objects in th

Re: [web2py] Re: check if len error in view

2011-05-13 Thread Stifan Kristi
it's my fault, thank you so much for corrected me pbreit. On Sat, May 14, 2011 at 10:16 AM, pbreit wrote: > If you're going to do it in the view, you need some {{pass}} statements to > close up the "for" and the "if" blocks.

[web2py] Re: check if len error in view

2011-05-13 Thread pbreit
If you're going to do it in the view, you need some {{pass}} statements to close up the "for" and the "if" blocks.

[web2py] Re: Check if file has unsaved changes before loading new page

2011-04-14 Thread Massimo Di Pierro
Thank you Drise, This is definitively possible. Could you please open a ticket on google code so the request gets queued? On Apr 14, 4:34 pm, Drise wrote: > In the past week, I have come to really love Web2Py and thank Massimo > for his work. One thing I would find useful is when editing a file

[web2py] Re: Check if a user has already rated

2011-04-11 Thread Drise
I will try that. On Apr 11, 11:59 am, pbreit wrote: > Either way. But I think the point is to just use a db().select() operation > to determine if the users hasrated.

[web2py] Re: Check if a user has already rated

2011-04-11 Thread Arun K.Rajeevan
Have you tried http://www.web2pyslices.com/main/slices/take_slice/112 I remember it did check for already done rating and doesn't allow rate twice by the same user on same object. May be you can just use it or look at the code and adapt it to your application. That's really not that big, only a

[web2py] Re: Check if a user has already rated

2011-04-11 Thread Arun K.Rajeevan
Have you tried http://www.web2pyslices.com/main/slices/take_slice/112 I remember it did check for already done rating and doesn't allow rate twice by the same user on same object. May be you can just use it or look at the code and adapt it to your application. That's really not that big, only a

[web2py] Re: Check if a user has already rated

2011-04-11 Thread pbreit
Either way. But I think the point is to just use a db().select() operation to determine if the users hasrated.

[web2py] Re: Check if a user has already rated

2011-04-11 Thread Drise
Hm.. so you are saying that I should store the "has rated" with the user, and not the comment? On Apr 11, 11:08 am, Kenneth Lundström wrote: > On 11.4.2011 18:59, Drise wrote:> How would I go by doing that? > > > On Apr 11, 10:42 am, pbreit  wrote: > >> I wasn't aware that validators could be use

Re: [web2py] Re: Check if a user has already rated

2011-04-11 Thread Kenneth Lundström
On 11.4.2011 18:59, Drise wrote: How would I go by doing that? On Apr 11, 10:42 am, pbreit wrote: I wasn't aware that validators could be used like that. Perhaps just query the db? Hello, as pbreit commented validators can´t be used like that. They are used when you are using forms, to val

[web2py] Re: Check if a user has already rated

2011-04-11 Thread Drise
How would I go by doing that? On Apr 11, 10:42 am, pbreit wrote: > I wasn't aware that validators could be used like that. Perhaps just query > the db?

[web2py] Re: 'check exists' option for reseting password

2011-04-11 Thread Brian Will
That seems to do it. On Apr 11, 1:42 am, Brian Will wrote: > I'd rather my password reset form not check the db for the existence > of the email and just blindly give an 'an email has been sent' message > regardless of what email address is entered. > > In Auth.request_reset_password(), this shou

[web2py] Re: check if file in form

2011-03-02 Thread LightOfMooN
thanks! On 2 мар, 20:56, Massimo Di Pierro wrote: > if isinstance(request.vars.image, cgi.FieldStorage) and > request.vars.image.file: >      redirect(URL('structure',args=['it', 'works'])) > > On Mar 2, 9:23 am, LightOfMooN wrote: > > > > > > > > > How can I check if there is file in the sent f

[web2py] Re: check if file in form

2011-03-02 Thread Massimo Di Pierro
if isinstance(request.vars.image, cgi.FieldStorage) and request.vars.image.file:     redirect(URL('structure',args=['it', 'works'])) On Mar 2, 9:23 am, LightOfMooN wrote: > How can I check if there is file in the sent form? > > if request.vars.image: >     redirect(URL('structure',args=['it', '