[web2py] Re: bad image and word Validator

2012-08-15 Thread Derek
As far as image filtering is concerned, these are commonly implemented as 'MTurk' tasks. Take a look at "Amazon Mechanical Turk" if you want this feature. You generally want to have a photo viewed 3x and get at least 2 agreements that it is a prohibited type of image. Those that disagree get a

Re: [web2py] Re: bad image and word Validator

2012-08-15 Thread Rob_McC
*Note:* I didn't know what *.compile* was used. *Now I do:* http://docs.python.org/library/re.html re.compile(*pattern*, *flags=0*) Compile a regular expression pattern into a regular expression object, which can be used for matching using its match()

Re: [web2py] Re: bad image and word Validator

2012-08-15 Thread Rob_McC
Anthony: *>As I mentioned earlier, replace BADWORDS.match(value) with BADWORDS.search(value). *. Sorry I missed that, you made it perfectly clear... *> add word boundaries r'\b' to the RE, >.. Though he said he explicitly did not want to do that. *. Sorry I wasn't clear on that but the word

Re: [web2py] Re: bad image and word Validator

2012-08-15 Thread Jonathan Lundell
On 15 Aug 2012, at 10:02 AM, Anthony wrote: > You'd also want to add word boundaries r'\b' to the RE, to avoid false > positives on eg 'assert'. > > Though he said he explicitly did not want to do that. > Ah, well. --

Re: [web2py] Re: bad image and word Validator

2012-08-15 Thread Anthony
> > You'd also want to add word boundaries r'\b' to the RE, to avoid false > positives on eg 'assert'. > Though he said he explicitly did not want to do that. Anthony --

Re: [web2py] Re: bad image and word Validator

2012-08-15 Thread Anthony
> > *but.. > *as noted in my comments, > if * asdf* is a racial slur, > then > *youasdf* > should NOT be allowed as a username, even if *youasdf *is somehow taken > in another context, in a real name or word. User will have to pick > another username. > > What do I need to do the the reg ex to

Re: [web2py] Re: bad image and word Validator

2012-08-15 Thread Rob_McC
Thanks guys! I appreciate it Here is my code, which works, *but.. *as noted in my comments, if * asdf* is a racial slur, then *youasdf* should NOT be allowed as a username, even if *youasdf *is somehow taken in another context, in a real name or word. User will have to pick another use

Re: [web2py] Re: bad image and word Validator

2012-08-15 Thread Jonathan Lundell
On 15 Aug 2012, at 8:39 AM, Anthony wrote: > In that case, you'd want: > > BADWORDS = re.compile(r'ass|jerk|otherbadword|etc') > > or if you already have a list or want to use the list in other places: > > badlist = ['ass', 'jerk', 'etc'] > BADWORDS = re.compile(r'|'.join(badlist)) > > Anthony

[web2py] Re: bad image and word Validator

2012-08-15 Thread Anthony
In that case, you'd want: BADWORDS = re.compile(r'ass|jerk|otherbadword|etc') or if you already have a list or want to use the list in other places: badlist = ['ass', 'jerk', 'etc'] BADWORDS = re.compile(r'|'.join(badlist)) Anthony On Wednesday, August 15, 2012 11:22:21 AM UTC-4, Rob_McC wrote

[web2py] Re: bad image and word Validator

2012-08-15 Thread Rob_McC
thanks once again. -1- I'll move to a module as you suggested. -2- The code is just the .py file (below), To test out, I just through it in *layout.html* {{=IS_BAD()('badass')}} Here is badword.py, from post above import base64, re BADWORDS=re.compile(base64.b64decode( """KGFob

[web2py] Re: bad image and word Validator

2012-08-15 Thread Anthony
> > *Q1*- I placed this code in db.py - Is that where it is suppose to go? > If it's only needed for registration, maybe put it in a module and import in the user() function when request.args(0)=='registration' (assuming you're using the standard user() function). > > *Q2*- I thought the py

[web2py] Re: bad image and word Validator

2012-08-15 Thread Rob_McC
I have badwords.py working. I want to use as a badwords filter for username, so (lower case, no spaces), just as google accounts do. Just a couple questions: * Q1*- I placed this code in db.py - Is that where it is suppose to go? *Q2*- I thought the python *.match* would work the way I want, b