[web2py] Re: Belongs not working

2015-03-28 Thread Anthony
Yes, but you are doing the opposite here. You are not checking whether a field value belongs to a list - you are checking whether a list stored in a field contains a particular value. The book section on the list:-type fields specifically says to use .contains for this purpose. This is not a job

Re: [web2py] Re: Django models into web2py

2015-03-28 Thread Ron Chatterjee
I agree with Phyo. Syntax is lot better and readable and close to sql than ORM On Saturday, March 28, 2015 at 4:28:24 PM UTC-4, Phyo Arkar wrote: > > Web2py DAL is actually a lot more powerful. i use web2py DAL anywhere even > if it is not for web or non web2py project. > > On Sun, Mar 29, 2015

[web2py] Re: Web2py: Create a CSV file to download for an executesql result

2015-03-28 Thread Brian M
Here's an old post with the solution that I use for this https://groups.google.com/d/msg/web2py/4QhEULmJ8YE/aNBcJv81RocJ Yep, I've got a processing app that spits out all sorts of csv files based on data gathered from multiple sources. Here's a little helper function I use def csv_export(recor

[web2py] Re: Belongs not working

2015-03-28 Thread Leonardo Pires Felix
Even on documentation has belongs checking if a value(or iterable obj) is in the field: http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#belongs " belongs The SQL IN operator is realized via the belongs method which returns true when the field value belongs to the

[web2py] Re: Belongs not working

2015-03-28 Thread Anthony
If you want to see if a particular item is in the stored list, the correct method has always been .contains(), not .belongs(). Using the later doesn't really make sense in this context (.belongs() is for checking whether a single value stored in a database field is in a list of values -- we are

[web2py] Re: Belongs not working

2015-03-28 Thread Paolo Valleri
Which web2py version was working ? What was the sql output? As you mentioned, replacing belongs with contains fixed the problem. On Saturday, March 28, 2015 at 6:53:50 PM UTC+1, Leonardo Pires Felix wrote: > > Not working too on the version for testers, in this case using sqlite. > Example: > >

Re: [web2py] Re: Django models into web2py

2015-03-28 Thread Phyo Arkar
Web2py DAL is actually a lot more powerful. i use web2py DAL anywhere even if it is not for web or non web2py project. On Sun, Mar 29, 2015 at 1:47 AM, Ron Chatterjee wrote: > That will be great. Then we can also do django development using web2py > interface. you rock massimo! > > > > > On Satu

[web2py] Re: Django models into web2py

2015-03-28 Thread Ron Chatterjee
That will be great. Then we can also do django development using web2py interface. you rock massimo! On Saturday, March 28, 2015 at 12:23:55 PM UTC-4, Massimo Di Pierro wrote: > > This is a backward compatibility problem in the latest web2py. Should be > fixed in the nightly build (for testers

Re: [web2py] Re: WEB2PY Certificate ?

2015-03-28 Thread Ron Chatterjee
I see. Thats a great idea. So people who will be certified will be able to post as a registered developer for web2py. That will be nice. Last time I went to a vet he almost took my kidney out, and all I was complaining about was an ankle twist! lol. you rock massimo! On Saturday, March 28, 201

[web2py] Re: Cannot check boolean field

2015-03-28 Thread Anthony
In many of the adapters, web2py converts booleans to and from strings with values "T" and "F". So, depending on the adapter, if you are writing SQL manually, you may need to use those values instead of True and False. Anthony On Saturday, March 28, 2015 at 12:14:44 PM UTC-4, Ruud Schroen wrote:

[web2py] Re: Belongs not working

2015-03-28 Thread Leonardo Pires Felix
Not working too on the version for testers, in this case using sqlite. Example: db.define_table("business_day", Field("description", notnull=True), Field("week_days", "list:integer", notnull=True)) db.business_day.insert(description='first week january 2015', week_d

[web2py] Re: Web2py security questions

2015-03-28 Thread Anthony
On Saturday, March 28, 2015 at 12:26:24 PM UTC-4, Massimo Di Pierro wrote: > > perhaps we should but being able to frame pages is something that people > always want as a feature. > The two header examples below allow framing if the ancestor page is from the same domain as the framed page. I wou

Re: [web2py] Re: Django models into web2py

2015-03-28 Thread Phyo Arkar
Thanks a lot massimo , i will try with latest nightly then. On Sat, Mar 28, 2015 at 10:53 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > This is a backward compatibility problem in the latest web2py. Should be > fixed in the nightly build (for testers) > > > On Friday, 27 March 2015

[web2py] Re: Write dynamic query in DAL without extra nested parentheses

2015-03-28 Thread Anthony
In this particular case, you should instead use .belongs(): query = db.product.id.belongs([list of ids]) It's an interesting problem, though. A somewhat hackish solution would be: query = ' OR '.join(str(db.product.id == i) for i in [list of ids]) The problem is that OR and AND operators always

[web2py] Re: Is web2py is good for below requirements?

2015-03-28 Thread JorgeH
Web2py meet those requirements easily. As for a comparison, I let that answer to others. On Saturday, March 28, 2015 at 11:14:44 AM UTC-5, Anandhakumar Radhakrishnan wrote: > > Hi, > > > I have planned to create a website with certain requirement please tell > whether this will support in web2p

[web2py] Re: Write dynamic query in DAL without extra nested parentheses

2015-03-28 Thread JorgeH
from Massimo, in another reply today (https://groups.google.com/forum/#!topic/web2py/RqSBO2dZU4E) : query &= db.flatpage.f==request.function is the same as query = query & (db.flatpage.f==request.function) Build a query from another query On Saturday, March 28, 2015 at 11:14:44 AM U

[web2py] Re: Help with two Python operators

2015-03-28 Thread Massimo Di Pierro
query &= db.flatpage.f==request.function is the same as query = query & (db.flatpage.f==request.function) Build a query from another query Instead alphabetical = User.first_name|User.last_name is the same as alphabetical = [User.first_name, User.last_name] makes a list of field

[web2py] Re: Table Migration on GAE

2015-03-28 Thread Massimo Di Pierro
http://web2py.com/examples/default/download On Saturday, 28 March 2015 11:14:44 UTC-5, Sébastien Loix wrote: > > Hello Massimo, > Where can I find the version for tester? > Also I am using SQL with MySQL with GAE through Cloud SQL, so the > check_reserved keywords is necessary right? > > Once I h

[web2py] Re: Belongs not working

2015-03-28 Thread Massimo Di Pierro
Can you please try the "for testers" version on the web site? Can you provide a simpler example to reproduce the problem? On Saturday, 28 March 2015 10:43:56 UTC-5, Leonardo Pires Felix wrote: > > Hi, > I think on last update the belongs stoped working. > I've a table that is defined like this: >

[web2py] Re: Belongs not working

2015-03-28 Thread Leonardo Pires Felix
Looks like that the belongs function to the "list:" has changed to the "contains", that's correct? Em sábado, 28 de março de 2015 12:43:56 UTC-3, Leonardo Pires Felix escreveu: > > Hi, > I think on last update the belongs stoped working. > I've a table that is defined like this: > db.define_tabl

[web2py] Re: Web2py security questions

2015-03-28 Thread Massimo Di Pierro
perhaps we should but being able to frame pages is something that people always want as a feature. On Saturday, 28 March 2015 09:52:58 UTC-5, Anthony wrote: > > On Friday, March 27, 2015 at 7:12:02 PM UTC-4, Scott Hunter wrote: >> >> 1. Does web2py employ, allow or support any anti-framing measur

[web2py] Re: Django models into web2py

2015-03-28 Thread Massimo Di Pierro
This is a backward compatibility problem in the latest web2py. Should be fixed in the nightly build (for testers) On Friday, 27 March 2015 15:56:05 UTC-5, Ron Chatterjee wrote: > > This is an old web2py blog. > > http://www.web2py.com/AlterEgo/default/show/189 > > Did anyone went through the step

Re: [web2py] Re: WEB2PY Certificate ?

2015-03-28 Thread Massimo Di Pierro
Since experts4solutions is now a registered company, I use it for consulting. I am planning to offer web2py certifications (I know I have said before but I am actually almost ready) and I plan to list certified developers and host the developers web pages. Massimo On Saturday, 28 March 2015 11

[web2py] Re: Ractive example

2015-03-28 Thread Massimo Di Pierro
yes it is orthogonal. In fact it uses very little of web2py, almost exclusively the DAL and marginally the web2py template language. On Thursday, 26 March 2015 02:48:05 UTC-5, Tim Richardson wrote: > > > > On Tuesday, 24 March 2015 13:55:25 UTC+11, Massimo Di Pierro wrote: >> >> Please look into

[web2py] Write dynamic query in DAL without extra nested parentheses

2015-03-28 Thread gb
What is the DAL Code to generate a query like this: SELECT * FROM product WHERE product.id=1 OR product.id=2 OR product.id=3 OR product.id product.id=4 OR product.id=5; or even: SELECT * FROM product WHERE (product.id=1) OR (product.id=2) OR (product.id=3) OR (product.id=4) OR (product.id=5); I'

[web2py] jQuery on button click

2015-03-28 Thread Diego R
Hello, I'm following instructions on video "16 Final Reddit clone improvements by Massimo" and I'm having problems calling jquery on button click: Here is my code: {{for post in row:}} + {{=post.votes}} -

[web2py] Re: fields strings to variable for fields=fields

2015-03-28 Thread Gray Kanarek
With the information here http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Run-time-field-and-table-modification you can do db['mytable']['field1']. So you'd want something like: field_list_split = [i.split(.) for i in field_list] fields = [db[table][field] for d

[web2py] Help with two python operators

2015-03-28 Thread Paul McDonald
In the web2py Application Development Cookbook: page 69 the | operator alphabetical = User.first_name|User.last_name *← | what is this doing??* page 82 the &= operator if not form: # search flatpage according to the current request query = db.flatpage.c==request.controller

Re: [web2py] Re: WEB2PY Certificate ?

2015-03-28 Thread Carlos Costa
And what is the future of experts4solutions ? 2015-03-25 0:19 GMT-03:00 Massimo Di Pierro : > Looks like you did. :-O > > Anyway, the point of a university is that we do not usually teach courses > about specific technologies. We use specific technologies to serve more > abstract purposes. For ex

Re: [web2py] Re: Git Clone : Seems bad first page

2015-03-28 Thread Vikash Sharma
Thanks, looks good now. I tried in IE, it was working, so then reset chrome cookies and it worked. Regards, Vikash Sharma vikash0...@gmail.com On Wed, Mar 25, 2015 at 10:01 AM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > it should not look like that. Either a css is missing or your

[web2py] Routes.py confusion

2015-03-28 Thread Grzegorz Dzień
I have web2py deployed behind Apache, and I am using routes: routers = dict( # base router BASE=dict( default_application='support', ), ) but it always lands me in support app's controller "default" I just can't use other controllers - what am I doing wrong? -- Resources:

[web2py] Re: Table Migration on GAE

2015-03-28 Thread Sébastien Loix
Hello Massimo, Where can I find the version for tester? Also I am using SQL with MySQL with GAE through Cloud SQL, so the check_reserved keywords is necessary right? Once I have the new version I will test it and report here. Thanks El martes, 24 de marzo de 2015, 17:32:09 (UTC+1), Massimo Di P

[web2py] Re: Web2py security questions

2015-03-28 Thread Gray Kanarek
This might help with the second question: http://stackoverflow.com/questions/32369/disable-browser-save-password-functionality This (and included links) might help with the first. On Friday, March 27, 2015 at 7:12:02 PM UTC-4, Scott Hunter wrote: > > 1. Does web2py employ, allow or support any

[web2py] Cannot check boolean field

2015-03-28 Thread Ruud Schroen
Hi, I have the following model: #Abstract category model, has references from multiple translations db.define_table('pitch_category') #No fields except for ID #The category translations db.define_table('pitch_category_translation', Field('pitch_category', db.pitch_category, requires=IS_IN_

[web2py] How to approach presenting API data in web2py ?

2015-03-28 Thread Gary Cowell
Hello Looking at writing a front end to an AWS orchestration tool in web2py, I already have the functionality required coded in python defs, so just looking at presenting things nicely. One thing I'll have to do a lot of, is present grids and dropdowns of data that have come from lists and dic

[web2py] Re: Team of admin/devellopers with different permissions

2015-03-28 Thread Tom Clerckx
You can always create multiple instances of web2py (each with their own applications directory). But for developers, wouldn't it be easier if they just have there local version of web2py and the application they're working on and use subversion/git/or any other version control system to check in

[web2py] Is web2py is good for below requirements?

2015-03-28 Thread Anandhakumar Radhakrishnan
Hi, I have planned to create a website with certain requirement please tell whether this will support in web2py. 1. Dynamic Page 2. Multi Vendors like olx.com 3. Email Services 4. Comparison charts And please tell why the web2py is best compare to other frame works in python. -- Resources:

[web2py] Multiple checkboxes representation

2015-03-28 Thread gliporace
Hi, I have a model like this: db.registro_donazioni( Field('cognome', 'string', length=100), Field('nome', 'string', length=100), Field('gruppo_sanguigno', 'integer'), Field('fattore_rh', 'integer'), Field('sierologia', 'list:integer', label='Sierologia') ) gruppo_sanguigno_set = {

[web2py] Help with two Python operators

2015-03-28 Thread Paul McDonald
In the Web2py Application Development Cookbook: p82the &= operators if not form: # search flatpage according to the current request query = db.flatpage.c==request.controller query &= db.flatpage.f==request.function *<- what is going on here?* if request.args: query &= db.

[web2py] Re: WEB2PY Certificate ?

2015-03-28 Thread KPlusPlus
What do you think of lunching an independent repository for tutorials/guides/tricks of web2py ,, web2py School ? On Wednesday, March 25, 2015 at 11:08:57 PM UTC+3, Ron Chatterjee wrote: > > Regarding what you mentioned, "10 topics people want to cover in > details...short videos". I would like

[web2py] Minor issue when trying to download plugins from admin application

2015-03-28 Thread Michel Krav
Hi, I'm facing a minor issue when trying to install ckeditor plugin , so I report it : When using Download plugins from repository button in the admin application interface as I cannot access the url web2slices.com the exception is caught and the following happen : Version web2py™ Version

[web2py] Web2py: Create a CSV file to download for an executesql result

2015-03-28 Thread Adam Scarlat
Hi, I use an external mysql database in my application and use the executesql(str(query), as_dict=True)) to run queries on it. I want to have a download link for a csv files of different queries in my application. If I were to work locally I would have used the following mysql command: 'SELEC

[web2py] Re: saving and dumping variables

2015-03-28 Thread Ron Chatterjee
Actually, I figured it out. All I needed to do is CD to the directory where web2py source code is located and do: from gluon import * Thats it. Then if I do c = cPickle.load(open('C:\Users\Ron\Desktop\web2py_src\myfile.pickle', 'rb')) DAL object shows up as stand alone. Now I can do anything

[web2py] Belongs not working

2015-03-28 Thread Leonardo Pires Felix
Hi, I think on last update the belongs stoped working. I've a table that is defined like this: db.define_table("regra_entrada", Field("descricao", notnull=True, represent=nome, requires=[ IS_NOT_EMPTY(), IS_UPPER()]), Field("data_inicial", "date", widget=SQLFORM.widg

[web2py] Re: fields strings to variable for fields=fields

2015-03-28 Thread Anthony
On Friday, March 27, 2015 at 3:39:38 PM UTC-4, LoveWeb2py wrote: > > Hi JorgeH, > > I didn't want to use eval due to code injection, but here is what I ended > up using and it worked. > > field_list = ['db.mytable.field1', 'db.mytable.field2'] > > fields = [getattr(db.mytable, i.split(".")[-1] fo

[web2py] Re: saving and dumping variables

2015-03-28 Thread Anthony
You are simply saving the dump to a variable, which does not persist across separate Python processes. If you want to be able to re-load the object, you need some form of persistence, such as writing to a file or saving to a database. Anthony On Saturday, March 28, 2015 at 9:21:18 AM UTC-4, Ro

Re: [web2py] Re: IMPORTANT - WEB2PY CONSULTING

2015-03-28 Thread DJ
Hey Kiran, Thanks for pointing that out! Just added a link to Web2Py on my site. -Sebastian On Tuesday, March 17, 2015 at 1:44:06 PM UTC-4, Kiran Subbaraman wrote: > > This seems to be the site: http://10biosystems.com > > Also, *Sebastian*, it would be helpful if you can refer to web2py on you

[web2py] Re: IMPORTANT - WEB2PY CONSULTING

2015-03-28 Thread DJ
Hi Dave, We are based in New York City since 2009. www.10biosystems.com -Sebastian On Tuesday, March 17, 2015 at 1:39:00 PM UTC-4, Dave S wrote: > > > > On Monday, March 16, 2015 at 6:57:54 PM UTC-7, DJ wrote: >> >> Hi Massimo, >> >> 10Biosystems.com has been doing web2Py consulting & bioinfor

[web2py] Re: Web2py security questions

2015-03-28 Thread Anthony
On Friday, March 27, 2015 at 7:12:02 PM UTC-4, Scott Hunter wrote: > > 1. Does web2py employ, allow or support any anti-framing measures, to > prevent "an attack that can trick the user into clicking on the link by > framing the original page and showing a layer on top of it with dummy > buttons

[web2py] saving and dumping variables

2015-03-28 Thread Ron Chatterjee
Wondering how to save and dump variables from web2py to a static python ide. In other words, >>> import cPickle >>> b = cPickle.dumps(a) >>> c = cPickle.loads(b) That seems to work only inside a web2py session. Once I close the web2py application and if I want to load up the saved variable u

[web2py] Re: Web2py security questions

2015-03-28 Thread Scott Hunter
I did; it says nothing about the specific things I asked about (or if it does, I cannot tell); that is why I asked. If that section of the book *does* address my questions, could someone point me to where in that section it does so? For example, there is a reference to preventing CSRF, but not