[web2py] Re: web2py 2.13.3 is OUT

2015-12-26 Thread Massimo Di Pierro
good catch! we will have to refactor that to support earlier versions of 
python.

On Sunday, 27 December 2015 01:02:09 UTC-6, Lou C wrote:
>
> I am running version 2.13.4 on GAE which runs on python 2.7.5. The problem 
> arises when using the @auth.allows_jwt() decorator. The error I get is 
> AttributeError: 
> 'module' object has no attribute 'compare_digest'.  
> Which is being called in :
>
> def verify_signature(self, body, signature, secret):
> mauth = hmac.new(key=secret, msg=body, digestmod=self.digestmod)
> return hmac.compare_digest(self.jwt_b64e(mauth.digest()), 
> signature)
>
> I believe this is because hmac.py uses compare_digest in version 2.7.7. 
> Anyway to use jwt on GAE ?
>
> On Friday, December 25, 2015 at 9:04:11 PM UTC-8, Massimo Di Pierro wrote:
>>
>> This is issue is now fixed in 2.13.4. :-)
>>
>> On Friday, 25 December 2015 22:37:54 UTC-6, Πέτρος Χατζηλάμπρος wrote:
>>>
>>> Mrry Christmas
>>>
>>> I found the following bug in version 2.13.3:
>>>
>>> I am using linux mint and I have a folder named web2py on the ~/Desktop
>>> I was using to run web2py by opening terminal and giving the command 
>>> "python ~/Desktop/web2py/web2py.py -a "tsouras" -i 0.0.0.0".
>>> After the update to version 2.13.3 the following error appears
>>> Traceback (most recent call last):
>>>   File "/home/tsouras/Desktop/web2py/web2py.py", line 6, in 
>>> import gluon.widget
>>>   File "/home/tsouras/Desktop/web2py/gluon/widget.py", line 26, in 
>>> 
>>> import gluon.main as main
>>>   File "/home/tsouras/Desktop/web2py/gluon/main.py", line 125, in 
>>> 
>>> raise RuntimeError("Cannot determine web2py version")
>>> RuntimeError: Cannot determine web2py version
>>>
>>> So, I did some debugging and I found out 
>>> that global_settings.gluon_parent is "/home/tsouras" instead of being 
>>> "/home/tsouras/Desktop/web2py"
>>> I overcome this problem by opening terminal and giving command "cd 
>>> ~Desktop/web2py" before giving the command "python 
>>> ~/Desktop/web2py/web2py.py -a "tsouras" -i 0.0.0.0"
>>>
>>> I did not have this problem using the previous version of web2py
>>>
>>> On Thursday, December 24, 2015 at 5:21:42 PM UTC+2, Massimo Di Pierro 
>>> wrote:

 web2py 2.13.3 is out. MERRY CHRISTMAS EVERYBODY!!!

 It contains some bug fixes for bugs introduced in 2.13.1-2 and most 
 importantly it contains experimental support for JWT. Here is how it works:

 1) instantiate auth with

 auth = Auth(db, jwt = {'secret_key':'secret'})

 where 'secret' is your own secret string. 

 2) Secorate functions that require login but should accept the 
 JWT token credentials:

 @auth.allows_jwt()
 @auth.requires_login()
 def myapi(): return 'hello %s' % auth.user.email
 
 Notice jwt is allowed but not required. if user is logged in, 
 myapi is accessible.

 3) Use it!
 Now API users can obtain a token with

 http://.../app/default/user/jwt?username=...&password=

 (returns json object with a token attribute)
 API users can refresh an existing token with

 http://.../app/default/user/jwt?token=...

 they can authenticate themselves when calling http:/.../myapi 
 by injecting a header

 Authorization: Bearer 

 Any additional attributes in the jwt argument of Auth() below:

auth = Auth(db, jwt = {...})

 are passed to the constructor of class AuthJWT. Look there for 
 documentation.

 Thanks Niphlod again for implementing this. 
 Please help us check it so we will declare it stable in the next 
 release.

 Massimo




-- 
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: web2py 2.13.3 is OUT

2015-12-26 Thread Lou C
I am running version 2.13.4 on GAE which runs on python 2.7.5. The problem 
arises when using the @auth.allows_jwt() decorator. The error I get is 
AttributeError: 
'module' object has no attribute 'compare_digest'.  
Which is being called in :

def verify_signature(self, body, signature, secret):
mauth = hmac.new(key=secret, msg=body, digestmod=self.digestmod)
return hmac.compare_digest(self.jwt_b64e(mauth.digest()), signature)

I believe this is because hmac.py uses compare_digest in version 2.7.7. 
Anyway to use jwt on GAE ?

On Friday, December 25, 2015 at 9:04:11 PM UTC-8, Massimo Di Pierro wrote:
>
> This is issue is now fixed in 2.13.4. :-)
>
> On Friday, 25 December 2015 22:37:54 UTC-6, Πέτρος Χατζηλάμπρος wrote:
>>
>> Mrry Christmas
>>
>> I found the following bug in version 2.13.3:
>>
>> I am using linux mint and I have a folder named web2py on the ~/Desktop
>> I was using to run web2py by opening terminal and giving the command 
>> "python ~/Desktop/web2py/web2py.py -a "tsouras" -i 0.0.0.0".
>> After the update to version 2.13.3 the following error appears
>> Traceback (most recent call last):
>>   File "/home/tsouras/Desktop/web2py/web2py.py", line 6, in 
>> import gluon.widget
>>   File "/home/tsouras/Desktop/web2py/gluon/widget.py", line 26, in 
>> 
>> import gluon.main as main
>>   File "/home/tsouras/Desktop/web2py/gluon/main.py", line 125, in 
>> raise RuntimeError("Cannot determine web2py version")
>> RuntimeError: Cannot determine web2py version
>>
>> So, I did some debugging and I found out 
>> that global_settings.gluon_parent is "/home/tsouras" instead of being 
>> "/home/tsouras/Desktop/web2py"
>> I overcome this problem by opening terminal and giving command "cd 
>> ~Desktop/web2py" before giving the command "python 
>> ~/Desktop/web2py/web2py.py -a "tsouras" -i 0.0.0.0"
>>
>> I did not have this problem using the previous version of web2py
>>
>> On Thursday, December 24, 2015 at 5:21:42 PM UTC+2, Massimo Di Pierro 
>> wrote:
>>>
>>> web2py 2.13.3 is out. MERRY CHRISTMAS EVERYBODY!!!
>>>
>>> It contains some bug fixes for bugs introduced in 2.13.1-2 and most 
>>> importantly it contains experimental support for JWT. Here is how it works:
>>>
>>> 1) instantiate auth with
>>>
>>> auth = Auth(db, jwt = {'secret_key':'secret'})
>>>
>>> where 'secret' is your own secret string. 
>>>
>>> 2) Secorate functions that require login but should accept the 
>>> JWT token credentials:
>>>
>>> @auth.allows_jwt()
>>> @auth.requires_login()
>>> def myapi(): return 'hello %s' % auth.user.email
>>> 
>>> Notice jwt is allowed but not required. if user is logged in, 
>>> myapi is accessible.
>>>
>>> 3) Use it!
>>> Now API users can obtain a token with
>>>
>>> http://.../app/default/user/jwt?username=...&password=
>>>
>>> (returns json object with a token attribute)
>>> API users can refresh an existing token with
>>>
>>> http://.../app/default/user/jwt?token=...
>>>
>>> they can authenticate themselves when calling http:/.../myapi by 
>>> injecting a header
>>>
>>> Authorization: Bearer 
>>>
>>> Any additional attributes in the jwt argument of Auth() below:
>>>
>>>auth = Auth(db, jwt = {...})
>>>
>>> are passed to the constructor of class AuthJWT. Look there for 
>>> documentation.
>>>
>>> Thanks Niphlod again for implementing this. 
>>> Please help us check it so we will declare it stable in the next release.
>>>
>>> Massimo
>>>
>>>
>>>

-- 
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: How to edit the menu bar so as to remove profile and name in front of welcome in the dropdown?

2015-12-26 Thread Massimo Di Pierro
Edit views/layout.html and remove {{=auth.navbar()}} which is 
responsible for drawing that part of the page. Then write your own code for 
it

{{if auth.user:}}
logout
{{else:}}
login
register
{{pass}}

add html as needed depending on how you want it to look.

On Saturday, 26 December 2015 13:38:34 UTC-6, RAGHIB R wrote:
>
> for example here, I want to remove profile in this pic and name in front 
> of welcome. how 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/d/optout.


web2py@googlegroups.com

2015-12-26 Thread Tom Campbell
Cleaner versions in tutorial style at pyguy 

 
and and web2pyslices 
.
 
Criticism warmly welcomed.

-- 
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: datatables.net fail: "Uncaught SyntaxError: Unexpected token &" ANSWERED

2015-12-26 Thread Tom Campbell
After a day of messing this, 

*of course I answered it myself moments after posting!*Answer was to define 
columns used and to use {{=XML}} helper:a


$(document).ready(function(){
$("#person-table").DataTable({
"data":  {{=XML(results)}},
columns: [
{ data: 'first_name' },
{ data: 'last_name' },
{ data: 'id' }
]
})
});


-- 
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: Have a more complex organize of controller files

2015-12-26 Thread Anthony
No, you cannot organize controller files into subfolders. However, you can 
make controller functions that are simply routers to functions that you 
organize in modules (you can use URL args to determine the routing).

Anthony

On Saturday, December 26, 2015 at 5:36:37 PM UTC-5, Alessio Varalta wrote:
>
> Hi, I have a problem with my logicI want to know if is possibile to 
> have  this structure
>
> different folders-with the files controller.py and in this case how the 
> url work? Usually the url is name of controller file+name of function but 
> in this case?
>
> Because for example i have the entity Coperative and i have differents 
> page that work with this entity ..so I want to have a folder. 
> Coperative-and inside this the controllers..For me this is a good logic. 
>
> Now in this moment i have one page controller Coperative with 7 or 8 
> functions that use module and class:
>
> 1)But i note that is not so good to have many functions in one page
> 2)I want folder because create many files without folder not help the 
> organisation
>
> Is possibile?For example
>
> folder Coperative/controller.py ??Works?
>
> I read that is not possibile to have subfolders? Is real??? Because i 
> think is better to have a check in subfolder that don't have the 
> maintainability of the application. Ok you put the logic in the module 
> but you have or 100 file controller without folder or you have little files 
> with 100 functions...This is a disaster for the logic..I hope that I can 
> use subfolders
>
> I have read old post and in these the advice is to use module...This is 
> not a solution because you don't have a logic structure of controllers..you 
> have or 1000 files or you have one files with 1000 function that use 
> models..This is not a good solution!!
> If I use a framework for my work and for the money I can not use old 
> pratice that are not so far too php without framework solution that don't 
> go under a solid framework structure.Use module is not a solution! You have 
> a mess in a controller or you have mess in the directory
>  
> Thanks in advance
>
>
>
>

-- 
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@googlegroups.com

2015-12-26 Thread Tom Campbell
Trying to display rows using the datatables.net DataTable() function by 
converting query results to JSON, but getting error "Uncaught SyntaxError: 
Unexpected token &". Though the raw data displays correctly in the view 
below, when I look at the results in the web console debugger I see that 
the generated program seems to show the JSON converted back to XML:


$(document).ready(function(){
$("#person-table").DataTable({
"aaData":  [{"first_name": "Super", 
"last_name": "Man", "id": 1}, 
{"first_name": "Massimo", "last_name": 
"Di Pierro", "id": 2}]) 
 
})
});

in model db.py:
db.define_table('person',Field('last_name'), Field('first_name'))
db.person.update_or_insert(last_name='Man',first_name='Super')
db.person.update_or_insert(last_name='Di Pierro',first_name='Massimo')

in controller default.py:
def index():
import json
people = json.dumps(db(db.person).select().as_list())
return dict(results=people)

In view index.html:
   


ID
First name
Last name



 ...
Raw data

 results: {{=results}}



$(document).ready(function(){
$("#person-table").DataTable({
"aaData":  $.parseJSON({{=results}})   
   
})
});


The view prints out an empty Datatable, followed by correctly formed JSON 
in the "Raw Data" portion:

  ID First name Last name

  Raw data
  results: [{"first_name": "Super", "last_name": "Man", "id": 1}, 
{"first_name": "Massimo", "last_name": "Di Pierro", "id": 2}]



-- 
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] Have a more complex organize of controller files

2015-12-26 Thread Alessio Varalta
Hi, I have a problem with my logicI want to know if is possibile to 
have in the controller this structure

folder(main)/with the file py and this case how the url work

Because for example i have the enttity Coperative and i have different page 
that work with this entity ..so I want to have a folder 

Coperative-and inside this the controllers..For me this is a good logic. 
Now in this moment i have one page controller Coperative with 7 or 8 
functions that use module and class. But i note that is not so good to have 
many controllers, create many file that are not in a folder that divide the 
files is not so good. So is possibile this operatiion?

folder Coperative/controller.py ??Works?

Thanks in advance?



-- 
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] DB design

2015-12-26 Thread Val K
I'm not IT-specialist, but I know any theory has own root-idea that may be 
explained by fingers. I was looking for it in DB theory and I've found it 
for myself! It is "PerformanceDBA" 's articles at StackOverflow. I think 
these articles may be very useful for everyone.

-- 
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: Possibilità di interazione tra Applicazione Mobile e applicazione principale e viste grafiche miglio

2015-12-26 Thread Alessandro Leonetti
Perfetto!!! Grazie mille ancora Massimo!!!
Consiglierò Web2py a tutti coloro che mi chiederanno informazioni su 
sistemi di sviluppo per web application!
Complimenti anche per le videoguide che hai realizzato, mi sono state 
davvero utilissime!

A presto, Buone feste e Buon Anno
Alessandro Leonetti

-- 
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 to edit the menu bar so as to remove profile and name in front of welcome in the dropdown?

2015-12-26 Thread RAGHIB R
for example here, I want to remove profile in this pic and name in front of 
welcome. how 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/d/optout.


[web2py] Re: how do I write a field in database such that its default is first name in auth.user?

2015-12-26 Thread Massimo Di Pierro
I think you want:

Field('first_name',default=auth.user and auth.user.first_name)



On Saturday, 26 December 2015 09:48:37 UTC-6, RAGHIB R wrote:
>
>
> look at this, i need the first name in the auth as first name in the info
> On Saturday, December 26, 2015 at 6:33:02 PM UTC+5:30, RAGHIB R wrote:
>>
>> For id it is auth.user_id, what for first name?
>
>

-- 
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: Why am I getting validation error in RESIZE here? I have installed PIL and uploaded images.py module

2015-12-26 Thread Massimo Di Pierro
Your second screenshot clearly shows you are running web2py.exe (the 
windows binary) and not the web2py.py (the source version). As I said, you 
have to run web2py from source. The windows binary comes with its own 
version of Python and it does not include PIL.

On Saturday, 26 December 2015 09:46:22 UTC-6, RAGHIB R wrote:
>
> I did it. Please check the screenshots and then tell me the error I might 
> be facing. I have installed python and updated the registry too with the 
> PIL.
>
> On Sat, Dec 26, 2015 at 9:14 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> RESIZE requires PIL installed. The windows binary version of web2py does 
>> not come with PIL. You have to install python 2.7. Then install PIL. Then 
>> run web2py from source.
>>
>> Massimo
>>
>>
>> On Saturday, 26 December 2015 09:19:37 UTC-6, RAGHIB R wrote:
>>>
>>> db1.py reads as:
>>>
>>> from images import RESIZE
>>> db.define_table('info',
>>> 
>>> Field('info_id',default=auth.user_id,writable=False,readable=False),
>>> Field('first_name'),
>>> Field('last_name'),
>>> Field('dp','upload'),
>>> Field('back','upload',requires=RESIZE(100,100)),
>>> Field('hometown'),
>>> Field('country'),
>>> 
>>> Field('dob','datetime',default=request.now,requires=IS_DATE(format=('%d-%m-%Y'))),
>>> Field('about','text'),
>>> )
>>>
>>>
>>> eroor ticket says:
>>> Error ticket for "Site"Ticket ID
>>>
>>> 127.0.0.1.2015-12-26.20-29-44.a454583a-f445-435a-a8da-788f2d417165
>>>  Validation error, field:back 
>>> Version
>>> web2py™Version 2.12.3-stable+timestamp.2015.08.19.00.18.03PythonPython 
>>> 2.7.9: D:\web2py\web2py.exe (prefix: )
>>>
>>>
>>>
>>>
>>>
>>>
>>> and
>>> images.py is same as D:\web2py\gluon\contrib\imageutils.py
>>>
>> -- 
>> 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/vRxQH1wH8mY/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: how do I write a field in database such that its default is first name in auth.user?

2015-12-26 Thread RAGHIB R

look at this, i need the first name in the auth as first name in the info
On Saturday, December 26, 2015 at 6:33:02 PM UTC+5:30, RAGHIB R wrote:
>
> For id it is auth.user_id, what for first name?

-- 
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: Why am I getting validation error in RESIZE here? I have installed PIL and uploaded images.py module

2015-12-26 Thread RAGHIB R
I did it. Please check the screenshots and then tell me the error I might
be facing. I have installed python and updated the registry too with the
PIL.

On Sat, Dec 26, 2015 at 9:14 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> RESIZE requires PIL installed. The windows binary version of web2py does
> not come with PIL. You have to install python 2.7. Then install PIL. Then
> run web2py from source.
>
> Massimo
>
>
> On Saturday, 26 December 2015 09:19:37 UTC-6, RAGHIB R wrote:
>>
>> db1.py reads as:
>>
>> from images import RESIZE
>> db.define_table('info',
>>
>> Field('info_id',default=auth.user_id,writable=False,readable=False),
>> Field('first_name'),
>> Field('last_name'),
>> Field('dp','upload'),
>> Field('back','upload',requires=RESIZE(100,100)),
>> Field('hometown'),
>> Field('country'),
>>
>> Field('dob','datetime',default=request.now,requires=IS_DATE(format=('%d-%m-%Y'))),
>> Field('about','text'),
>> )
>>
>>
>> eroor ticket says:
>> Error ticket for "Site"Ticket ID
>>
>> 127.0.0.1.2015-12-26.20-29-44.a454583a-f445-435a-a8da-788f2d417165
>>  Validation error, field:back
>> Version
>> web2py™Version 2.12.3-stable+timestamp.2015.08.19.00.18.03PythonPython
>> 2.7.9: D:\web2py\web2py.exe (prefix: )
>>
>>
>>
>>
>>
>>
>> and
>> images.py is same as D:\web2py\gluon\contrib\imageutils.py
>>
> --
> 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/vRxQH1wH8mY/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: Why am I getting validation error in RESIZE here? I have installed PIL and uploaded images.py module

2015-12-26 Thread Massimo Di Pierro
RESIZE requires PIL installed. The windows binary version of web2py does 
not come with PIL. You have to install python 2.7. Then install PIL. Then 
run web2py from source.

Massimo

On Saturday, 26 December 2015 09:19:37 UTC-6, RAGHIB R wrote:
>
> db1.py reads as:
>
> from images import RESIZE
> db.define_table('info',
> 
> Field('info_id',default=auth.user_id,writable=False,readable=False),
> Field('first_name'),
> Field('last_name'),
> Field('dp','upload'),
> Field('back','upload',requires=RESIZE(100,100)),
> Field('hometown'),
> Field('country'),
> 
> Field('dob','datetime',default=request.now,requires=IS_DATE(format=('%d-%m-%Y'))),
> Field('about','text'),
> )
>
>
> eroor ticket says:
> Error ticket for "Site"Ticket ID
>
> 127.0.0.1.2015-12-26.20-29-44.a454583a-f445-435a-a8da-788f2d417165
>  Validation error, field:back 
> Version
> web2py™Version 2.12.3-stable+timestamp.2015.08.19.00.18.03PythonPython 
> 2.7.9: D:\web2py\web2py.exe (prefix: )
>
>
>
>
>
>
> and
> images.py is same as D:\web2py\gluon\contrib\imageutils.py
>

-- 
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: how do I write a field in database such that its default is first name in auth.user?

2015-12-26 Thread Massimo Di Pierro
Do not understand the requirement, can you make an example?

On Saturday, 26 December 2015 07:03:02 UTC-6, RAGHIB R wrote:
>
> For id it is auth.user_id, what for first name?

-- 
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] Why am I getting validation error in RESIZE here? I have installed PIL and uploaded images.py module

2015-12-26 Thread RAGHIB R
db1.py reads as:

from images import RESIZE
db.define_table('info',

Field('info_id',default=auth.user_id,writable=False,readable=False),
Field('first_name'),
Field('last_name'),
Field('dp','upload'),
Field('back','upload',requires=RESIZE(100,100)),
Field('hometown'),
Field('country'),

Field('dob','datetime',default=request.now,requires=IS_DATE(format=('%d-%m-%Y'))),
Field('about','text'),
)


eroor ticket says:
Error ticket for "Site"Ticket ID

127.0.0.1.2015-12-26.20-29-44.a454583a-f445-435a-a8da-788f2d417165
 Validation error, field:back 
Versionweb2py™Version 
2.12.3-stable+timestamp.2015.08.19.00.18.03PythonPython 2.7.9: 
D:\web2py\web2py.exe (prefix: )






and
images.py is same as D:\web2py\gluon\contrib\imageutils.py

-- 
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 write a field in database such that its default is first name in auth.user?

2015-12-26 Thread RAGHIB R
For id it is auth.user_id, what for first name?

-- 
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: Web2py con UDOO

2015-12-26 Thread Vinny Mautone
Si il mio scopo è quello di far leggere a python ad intervalli regolari i 
vari sensori e farlo andare a scrivere sul db, poi quando apro l'app web2py 
ho la possibiltà di visualizzare i dati scritti sul db, ma mi occorre anche 
che dall'app posso andare a scrivere anche su arduino, nel senso che vorrei 
creare delle slidebar per aumentare o diminuire la luminosità o 
l'impostazione della temperatura quindi utilizzando queste slidebar 
sull'interfaccia web comando arduino.

Grazie

Il giorno sabato 26 dicembre 2015 10:55:52 UTC+1, Vinny Mautone ha scritto:
>
> Ciao a tutti sto cercando di creare qualcosa per le automatizzazioni del 
> mio acquario ho acquistato una UDOO quad e sto iniziando a testare arduino, 
> ma il mio scopo è quello di creare un'interfaccia web dalla quale leggere i 
> vari dati messi a disposizione delle sonde che collegherò ad arduino e in 
> più eseguire operazioni diciamo manuali, "cambio livello di illuminazione, 
> fermare la pompa del filtro, ecc." ovviamente tutte queste saranno fatte da 
> arduino. Le varie sonde andranno a scrivere su un database mysql.
> La mia domanda è questa, potendo comandare arduino con Python tramite la 
> libreria Pyserial posso creare un'app completa con web2py che legga e 
> scriva da seriale su arduino, oppure devo creare un programma a parte che 
> faccia tutto il lavoro per arduino e con web2py creare un app che legga dal 
> database e mi visualizzi i valori?
>
> Grazie
>
>
> Hello everyone I am trying to create something for the automations of my 
> aquarium I bought a udoo quad and I'm starting to test Arduino, but my aim 
> is to create a web interface from which to read the various data made 
> available to the probes I will connect to arduino and more perform manual 
> say, "change illumination level, stop the filter pump, and so on." 
> Obviously all of these will be made by Arduino. The various probes'll write 
> on a mysql database.
> My question is this, being able to control Arduino with Python via the 
> library pySerial can create an app complete with web2py that read and write 
> to serial Arduino, or should I create a separate program that does all the 
> work for Arduino and create web2py an app that I read from the database and 
> displays the values?
>
> Thank you
>
> P.S. This is an on-line translation
>
>

-- 
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: How do I change readable of an entry to true in view or controller?

2015-12-26 Thread Massimo Di Pierro
def index():
  db.mytable.myfeld.readable = True #or False
  db.mytable.myfeld.writable = True #or False
  form = SQLFORM(db.mytable).process()
  return dict(form=form)

On Saturday, 26 December 2015 03:30:20 UTC-6, RAGHIB R wrote:
>
>

-- 
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: Web2py con UDOO

2015-12-26 Thread Massimo Di Pierro
My assumption is that you want to read your sensors at periodic time 
intervals, whether or not you are looking at them from the web interface. 
You can do this with the web2py scheduler but I think it is overkill. I 
would just create a process that loops and records he sensors in your 
database (or perhaps a CSV file). Then your web app just reads the data 
displays it to the user and makes plots.

Massimo

On Saturday, 26 December 2015 03:55:52 UTC-6, Vinny Mautone wrote:
>
> Ciao a tutti sto cercando di creare qualcosa per le automatizzazioni del 
> mio acquario ho acquistato una UDOO quad e sto iniziando a testare arduino, 
> ma il mio scopo è quello di creare un'interfaccia web dalla quale leggere i 
> vari dati messi a disposizione delle sonde che collegherò ad arduino e in 
> più eseguire operazioni diciamo manuali, "cambio livello di illuminazione, 
> fermare la pompa del filtro, ecc." ovviamente tutte queste saranno fatte da 
> arduino. Le varie sonde andranno a scrivere su un database mysql.
> La mia domanda è questa, potendo comandare arduino con Python tramite la 
> libreria Pyserial posso creare un'app completa con web2py che legga e 
> scriva da seriale su arduino, oppure devo creare un programma a parte che 
> faccia tutto il lavoro per arduino e con web2py creare un app che legga dal 
> database e mi visualizzi i valori?
>
> Grazie
>
>
> Hello everyone I am trying to create something for the automations of my 
> aquarium I bought a udoo quad and I'm starting to test Arduino, but my aim 
> is to create a web interface from which to read the various data made 
> available to the probes I will connect to arduino and more perform manual 
> say, "change illumination level, stop the filter pump, and so on." 
> Obviously all of these will be made by Arduino. The various probes'll write 
> on a mysql database.
> My question is this, being able to control Arduino with Python via the 
> library pySerial can create an app complete with web2py that read and write 
> to serial Arduino, or should I create a separate program that does all the 
> work for Arduino and create web2py an app that I read from the database and 
> displays the values?
>
> Thank you
>
> P.S. This is an on-line translation
>
>

-- 
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] Web2py con UDOO

2015-12-26 Thread Vinny Mautone
Ciao a tutti sto cercando di creare qualcosa per le automatizzazioni del 
mio acquario ho acquistato una UDOO quad e sto iniziando a testare arduino, 
ma il mio scopo è quello di creare un'interfaccia web dalla quale leggere i 
vari dati messi a disposizione delle sonde che collegherò ad arduino e in 
più eseguire operazioni diciamo manuali, "cambio livello di illuminazione, 
fermare la pompa del filtro, ecc." ovviamente tutte queste saranno fatte da 
arduino. Le varie sonde andranno a scrivere su un database mysql.
La mia domanda è questa, potendo comandare arduino con Python tramite la 
libreria Pyserial posso creare un'app completa con web2py che legga e 
scriva da seriale su arduino, oppure devo creare un programma a parte che 
faccia tutto il lavoro per arduino e con web2py creare un app che legga dal 
database e mi visualizzi i valori?

Grazie


-- 
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 change readable of an entry to true in view or controller?

2015-12-26 Thread RAGHIB R
-- 
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] why you should upgrade to web2py 2.13.4

2015-12-26 Thread Massimo Di Pierro
There are many reasons you should upgrade, depending on which version you 
are using now:

- to help us make sure we did not break backward compatibility. If your 
existing app does not work with 2.13.4 (and it should) you give us a chance 
to fix the problem. If no, any potential incompatibility will propagate 
forward making it more difficult for us to fix it later, and more difficult 
for you to upgrade.

- to take advantage of new features. For example the awesome JWT feature 
that allows to create API tokens and use them for authentication without 
hitting the database.

- there is also an important security bug fix in 2.13.4 related to 
auth.settings.registration_requires_approval=True. The bug allows a newly 
registered user to bypass the approval process and approve himself/herself. 
Under come conditions. This is now fixed.

Massimo

-- 
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.