[web2py] Prepping upload file browser

2016-02-19 Thread Dave S
Using SQLFORM for a table with a Field('x', 'upload'), is there a way to 
tell the file chooser widget what directory to start in (which will vary 
with client OS) ?  I'm interested in uploading files that are 
domain-specific, and which can be expected to be in certain places.

/dps



-- 
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] datestamp with SQLFORM

2016-02-19 Thread Dave S
I have an SQLFORM being used for a when-who-what type of function, for a 
table roughly like

db.define_table('stuff',
  FIELD('where', 'string'),
  FIELD('when',  'datetime'),
  FIELD('who',   'string'),
  FIELD('what',  'something'))# 'something'  is 'upload' in actual 
code, but I don't think that matters



And my controller does


def getit():
   response.flash = T("Hello, fill out the form")
   message = T("tell me stuff")
   form = SQLFORM(db.stuff, fields=['who', 'what'])
   form.vars.where = request.client
   if form.process().accepted:
 response.flash = "Yea!"
  else:
 response.flash = "Ooops!"
  return dict(form = form, message=message)



I'd like to get the db.stuff.when field updated with the time of 
*submission*..  Would I do that as I did the where field? (using* 
req.utcnow)*.  That gets the request time of the submitting, not the time 
the empty form is built when the user first decides to tell me stuff? 
(Normally, the difference isn't important, but if the user wanders off for 
a cuppa and sees Teddy using the copier and they start discussing the 
football pools .

/dps

-- 
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: Where does a login action go?

2016-02-19 Thread Anthony
Hmm, not sure what the problem is then.

On Friday, February 19, 2016 at 3:15:35 PM UTC-5, Dave S wrote:
>
>
>
> On Friday, February 19, 2016 at 7:38:34 AM UTC-8, Anthony wrote:
>>
>> Are you using SessionVariable to store and re-send the session cookie? 
>> web2py uses a session cookie to link the client with a session on the 
>> server, and the login status is stored in the session.
>>
>
> Yes, when I ask for app/default/user/login?_next ...  I use the 
> -SessionVariable dsvr (similar to the example page), being careful to use 
> one dash and no dollarsign.
>
> Then for the various URLs I try when submitting the form, I use 
> -WebSession $dsvr.
>
> When I ask PowerShell what the value of $dsvr is, I get
>
> PS C:\Users\develop2> $dsvr
>
> Headers   : {}
> Cookies   : System.Net.CookieContainer
> UseDefaultCredentials : False
> Credentials   :
> Certificates  :
> UserAgent : Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) 
> WindowsPowerShell/5.0.10586.0
> Proxy :
> MaximumRedirection: -1
>
>
> PS C:\Users\develop2>
>
>
> I must be missing something something in the cookie, because it doesn't 
> change when I submit the form.  (I've answered part of my original question 
> by using a browser to log in, and looking at httpserver.log for the URL in 
> that POST submit.  It goes back to app/user/login, but httpserver.log 
> doesn't show whether there were any tails to the URL ('#' or '?arg').
>
>
>> Anthony
>>
>>
> Thanks for helping.
>
> /dps
>  
>
>> On Thursday, February 18, 2016 at 11:04:04 PM UTC-5, Dave S wrote:
>>>
>>> I'm trying to futz around a user's problem on a Windows client, so I'm 
>>> learning about Invoke-WebRequest in PowerShell.
>>> https://technet.microsoft.com/en-us/library/hh849901.aspx>
>>>
>>> I'm following the Facebook login example on that page, but trying to log 
>>> into my app.  I can get the login form correctly (it appears), and I can 
>>> update the form fields in a way that seems to be acceptable (on both ends), 
>>> but the action is just '#', and I post to //host/app/default/user/login or 
>>> //host/app/default/user/login# I get a 200 response and a fresh copy of the 
>>> login form, rather than continuing to the _next page set in the form 
>>> (app/default/index).  If I try posting the form to app/default/index, I get 
>>> a 303 and back to the login form.
>>>
>>> Can someone who has a clue hit me with it?
>>>
>>> /dps
>>>
>>>

-- 
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: CAS with OpenSSL-Certificates

2016-02-19 Thread Frank Bunt
I'll give an older version a try. TIA.

On Tuesday, February 16, 2016 at 5:39:35 PM UTC+1, Niphlod wrote:
>
> imho 2.7.10 and its certificate validation done by default is messing the 
> consumer app. But you wouldn't absolutely be able to log in the consumer 
> app...
>
>

-- 
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: Where does a login action go?

2016-02-19 Thread Dave S


On Friday, February 19, 2016 at 7:38:34 AM UTC-8, Anthony wrote:
>
> Are you using SessionVariable to store and re-send the session cookie? 
> web2py uses a session cookie to link the client with a session on the 
> server, and the login status is stored in the session.
>

Yes, when I ask for app/default/user/login?_next ...  I use the 
-SessionVariable dsvr (similar to the example page), being careful to use 
one dash and no dollarsign.

Then for the various URLs I try when submitting the form, I use -WebSession 
$dsvr.

When I ask PowerShell what the value of $dsvr is, I get

PS C:\Users\develop2> $dsvr

Headers   : {}
Cookies   : System.Net.CookieContainer
UseDefaultCredentials : False
Credentials   :
Certificates  :
UserAgent : Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) 
WindowsPowerShell/5.0.10586.0
Proxy :
MaximumRedirection: -1


PS C:\Users\develop2>


I must be missing something something in the cookie, because it doesn't 
change when I submit the form.  (I've answered part of my original question 
by using a browser to log in, and looking at httpserver.log for the URL in 
that POST submit.  It goes back to app/user/login, but httpserver.log 
doesn't show whether there were any tails to the URL ('#' or '?arg').


> Anthony
>
>
Thanks for helping.

/dps
 

> On Thursday, February 18, 2016 at 11:04:04 PM UTC-5, Dave S wrote:
>>
>> I'm trying to futz around a user's problem on a Windows client, so I'm 
>> learning about Invoke-WebRequest in PowerShell.
>> https://technet.microsoft.com/en-us/library/hh849901.aspx>
>>
>> I'm following the Facebook login example on that page, but trying to log 
>> into my app.  I can get the login form correctly (it appears), and I can 
>> update the form fields in a way that seems to be acceptable (on both ends), 
>> but the action is just '#', and I post to //host/app/default/user/login or 
>> //host/app/default/user/login# I get a 200 response and a fresh copy of the 
>> login form, rather than continuing to the _next page set in the form 
>> (app/default/index).  If I try posting the form to app/default/index, I get 
>> a 303 and back to the login form.
>>
>> Can someone who has a clue hit me with it?
>>
>> /dps
>>
>>

-- 
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] Passing file through pvars on scheduler.queue_task() function

2016-02-19 Thread Edward Suárez
   file = request.post_vars["myfile"]
task = scheduler.queue_task(
"task",
task_name = "task_x",
pvars={
'file': file ,
},
start_time = request.now + datetime.timedelta(seconds=50),  
#datetime
stop_time = request.now + datetime.timedelta(seconds=70),
timeout = 3600*3, #seconds
prevent_drift=False,
retry_failed = 3,
period= 120,#seconds
immediate=False,
repeats = 1)

How can I pass a file to  a task function? My task function needs to send a 
post request with the file

-- 
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: Email not working

2016-02-19 Thread Dave S
On Friday, February 19, 2016 at 9:26:23 AM UTC-8, Tom Russell wrote:
>
> Yea I have the user/pw correct, the smtp settings seem pretty straight 
> forward as well so not sure what the root cause is.
>

Can you connect to the other end using telnet?  There are some examples on 
the web of general smtp debugging where the dialog is explained so you can 
sound like your computer to the other end.  Some may be on stackoverflow.

/dps

 

>
> On Friday, February 12, 2016 at 4:10:20 PM UTC-5, Dave S wrote:
>>
>>
>>
>> On Friday, February 12, 2016 at 12:17:57 PM UTC-8, Tom Russell wrote:
>>>
>>> Yea I am not trying to blame web2py but it just seems I am not having 
>>> any luck getting an email to send. I am using a smtp interface on the other 
>>> side.
>>>
>>> I am just at a loss as to what the issue is and how to solve it.
>>>
>>> Thanks,
>>>
>>> Tom
>>>
>>
>> FWIW, on my AWS Linux instance, I send email with server "localhost" and 
>> user "None" (I'm hoping that only works from local posts), using either 
>> auth's mailer or smtplib directly.  From reading this group for a while, 
>> the most common problem seems to be getting user/password right, especially 
>> with GMail and 2-factor authentication.
>>
>> /dps
>>
>>
>>
>>> On Friday, February 12, 2016 at 2:40:43 PM UTC-5, Niphlod wrote:

 web2py uses smtplib. as long as on the other side there's an 
 smtp-compatible interface, there's no reason to blame web2py :P

 On Friday, February 12, 2016 at 8:38:38 PM UTC+1, Tom Russell wrote:
>
> I have since my last time trying to get email sending working with the 
> built in registration process moved to Amazon AWS SES mail services which 
> I 
> know works well with other people. I have put in all the required info in 
> db.py needed but still cannot send an email. I have tried gmail, a few 
> other services and nothing so far seems to work.
>
> Has anyone tried an actual mail service that works, preferably free or 
> close to it. I am beginning to think that web2py has an issue doing this 
> task.
>
> I really need to get past this hurtle for a product launch soon.
>
> Thanks,
>
> Tom
>


-- 
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: creating tags and linking

2016-02-19 Thread Dave S


On Friday, February 19, 2016 at 10:06:51 AM UTC-8, Ron Chatterjee wrote:
>
> Was looking in the book for an example and can't seem to find it.
>
> Want to do something very similar to this with tags (postgresql 
>  java 
>  angularjs 
>  sass 
>  css 
> )
>
>
> http://careers.stackoverflow.com/jobs/107630/software-engineer-nest-financial
>
> I want to create tags and have links to them using the urls.
>
> my model:
> hobby_str = ['baseball', 'basketball', 'tennis', 'football', 'soccar']
> db.define_table("Post",
> Field("Title", "string", label='Give it a Title*', 
> requires=IS_NOT_EMPTY(),default=None),
> Field("body", "text", label='Say something', 
> requires=IS_NOT_EMPTY(),default=None),
> Field('game', 
> type='list:string',label='hobbies',requires=IS_IN_SET ((hobby_str), 
> multiple=True),widget=lambda field, value: 
> SQLFORM.widgets.multiple.widget(field, value, size=3, style='divs', 
> label=True)),
> Field('schedule',comment = 'Check all that applies', 
> requires=IS_EMPTY_OR(IS_IN_SET(('day','Night', 'weekend only','weekdays', 
> 'excluding holidays'),multiple=True)),widget=lambda field,  value: 
> SQLFORM.widgets.checkboxes.widget(field, value, style='divs', label=True, 
> _class='horizontal')),)
>
> control:
> def show_links():
> posts = []
> posts = db().select(db.Post.ALL)
> return locals()
>
> view:
> {{import numpy}}
>
> 
> Title
> Game
> Schedule
>
> {{for i in range(0,len(posts)):}}
> 
> {{=posts[i].Title}}
> {{=posts[i].game}}
> {{=posts[i].schedule}}
> 
> {{pass}}
> 
>
> All the fields that show up as football, baseball, excluding holidays. I 
> want them to behave as tags and by clicking them user can see the post 
> related to those events only. For example. If someone click on basketball, 
> all the posts related to basketball (s) will be grouped and shown together. 
> Any examples?
>
>

No, but isn't the key element doing the db query?  It would be something 
similar to this from the Simple Wiki example:


def search():
 """an ajax wiki search page"""
 return dict(form=FORM(INPUT(_id='keyword',_name='keyword',
 _onkeyup="ajax('callback', ['keyword'], 'target');")),
 target_div=DIV(_id='target'))


I think that when Massimo was last presenting in SoCal, he did a simple 
tagging demonstration, so you might look to see if he has that in one of 
the video examples, but now that you've done the star ratings, I think 
you've got the tools you need.

/dps




-- 
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: List in a db Request

2016-02-19 Thread Niphlod
dba(~dba.table.name.belongs(list)).select()

On Friday, February 19, 2016 at 7:50:13 PM UTC+1, Lucas Schreiber wrote:
>
> Hi there,
>
> is there a way to use a list in a db request? like this:
> list = [One, Two, Three]
>
> row_db = dba((dba.table.table_name!= list)).select()
>
>
> and getting every row, which doesnt have one of the emelents as a name?
>
>
> Thank you
>
>

-- 
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: variables available in view

2016-02-19 Thread Dave S


On Friday, February 19, 2016 at 10:13:31 AM UTC-8, Pierre wrote:
>
> hi everyone,
>
> I have a controller/function with different return cases:
> like :
>
> if condition1:
> return dict(var1=var1)
> elif condition2:
> return dict(var1=var1,var2=var2)
> .
>
> how do I know in the corresponding view which variables are accessible 
> (what's the case) ? do I have to return a case variable ?
>


Something like

{{ =var1 }}
{{ if 'var2' in globals():}} 
  {{ =var2 }}
{{ pass }}




/dps

-- 
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] List in a db Request

2016-02-19 Thread Lucas Schreiber
Hi there,

is there a way to use a list in a db request? like this:
list = [One, Two, Three]

row_db = dba((dba.table.table_name!= list)).select()


and getting every row, which doesnt have one of the emelents as a name?


Thank you

-- 
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] variables available in view

2016-02-19 Thread Pierre
hi everyone,

I have a controller/function with different return cases:
like :

if condition1:
return dict(var1=var1)
elif condition2:
return dict(var1=var1,var2=var2)
.

how do I know in the corresponding view which variables are accessible 
(what's the case) ? do I have to return a case variable ?

-- 
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] creating tags and linking

2016-02-19 Thread Ron Chatterjee
Was looking in the book for an example and can't seem to find it.

Want to do something very similar to this with tags:
http://careers.stackoverflow.com/jobs/107630/software-engineer-nest-financial

I want to create tags and have links to them using the urls.

my model:
hobby_str = ['baseball', 'basketball', 'tennis', 'football', 'soccar']
db.define_table("Post",
Field("Title", "string", label='Give it a Title*', 
requires=IS_NOT_EMPTY(),default=None),
Field("body", "text", label='Say something', 
requires=IS_NOT_EMPTY(),default=None),
Field('game', 
type='list:string',label='hobbies',requires=IS_IN_SET ((hobby_str), 
multiple=True),widget=lambda field, value: 
SQLFORM.widgets.multiple.widget(field, value, size=3, style='divs', 
label=True)),
Field('schedule',comment = 'Check all that applies', 
requires=IS_EMPTY_OR(IS_IN_SET(('day','Night', 'weekend only','weekdays', 
'excluding holidays'),multiple=True)),widget=lambda field,  value: 
SQLFORM.widgets.checkboxes.widget(field, value, style='divs', label=True, 
_class='horizontal')),)

control:
def show_links():
posts = []
posts = db().select(db.Post.ALL)
return locals()

view:
{{import numpy}}


Title
Game
Schedule
   
{{for i in range(0,len(posts)):}}

{{=posts[i].Title}}
{{=posts[i].game}}
{{=posts[i].schedule}}

{{pass}}


All the fields that show up as football, baseball, excluding holidays. I 
want them to behave as tags and by clicking them user can see the post 
related to those events only. For example. If someone click on basketball, 
all the posts related to basketball (s) will be grouped and shown together. 
Any examples?

-- 
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: CMS WEB2PY

2016-02-19 Thread Ron Chatterjee
I concur. You did a good job on that blog. It looks nice. 

On Friday, February 19, 2016 at 12:57:09 PM UTC-5, Carlos Cesar Caballero 
wrote:
>
> Hi Ron, CMSs allows to build web sites faster, but they usually lacks of 
> flexibility and performance compared with custom applications, I prefer to 
> stay in the middle and build custom applications with a core of pre made 
> modules for different functionalities, in that way I can balance the 
> project time, speed and flexibility.
>
> But it's just my opinion...
>
> Greetings.
>
> El 19/02/16 a las 11:02, Ron Chatterjee escribió:
>
> I didn't mean it like that. I meant to say, due to lack of CMS what would 
> be the best practice. Using of CMS or custom theme. Sorry about the 
> confusion.
>
> On Friday, February 19, 2016 at 10:25:59 AM UTC-5, LightDot wrote: 
>>
>> You're comparing two different categories. Web2py is a programming 
>> framework, Mezzanine is a CMS. Web2py is a tool you would use to build a 
>> CMS like a Mezzanine (same as Django is used in this particular case).
>>
>> In other words, what you should be comparing is Web2py vs Django, not 
>> Web2py vs projects built in Django.
>>
>> Regards
>>
>>
>> On Friday, February 19, 2016 at 4:13:15 PM UTC+1, Ron Chatterjee wrote: 
>>>
>>> Curious to know what would be best practice? Use CMS like Mezzanine or 
>>> use bootstrap and custom theme for each page? It just seem the look and 
>>> feel of CMS is nicer than out of box web2py app.  List are few things 
>>> Mezzanine offer. Most of it is fairly simple and offered via various web2py 
>>> plugins etc.
>>>
>>>
>>>- Custom templates 
>>>
>>>  
>>>per page or blog post 
>>>- Twitter Bootstrap  integration 
>>>- API for custom content types 
>>>
>>> 
>>>  
>>>- Search engine and API 
>>> 
>>>- Seamless integration with third-party Django apps 
>>>- Multi-device detection and template handling 
>>>- One step migration from other blogging engines 
>>>- Automated production provisioning and deployments 
>>>- Disqus  integration, or built-in threaded 
>>>comments 
>>>- Gravatar  integration 
>>>- Google Analytics  integration 
>>>- Twitter  feed integration 
>>>- bit.ly integration 
>>>- Akismet  spam filtering 
>>>- Built-in test suite 
>>>
>>>  
>>>- JVM  compatible 
>>>(via Jython ) 
>>>- SEO friendly URLs and meta data 
>>>- Ecommerce / Shopping cart module (Cartridge 
>>>) 
>>>- Configurable dashboard 
>>> 
>>>widgets 
>>>- Blog engine 
>>>- Tagging 
>>>- Free Themes , and a Premium 
>>>Themes  Marketplace 
>>>- User accounts and profiles with email verification 
>>>- Translated to over 35 languages 
>>>- Sharing via Facebook or Twitter 
>>>- Multi-lingual sites 
>>> 
>>>
>>>
>>>
>>>
>>> On Friday, February 19, 2016 at 2:54:02 AM UTC-5, Jörg Schneider wrote: 

 I was able to built a Custom-CMS for a refugee helper association only 
 by watching the videos an reading the manual. I do only have really basic 
 knowledge in programming and because Joomla and Wordpress didn't fit my 
 needs I started from the scratch with web2py which is really a cool 
 framework. 
 I just want to encourage you to go step by step and I promise that you 
 will have a steep learning curve.

 Am Dienstag, 13. Oktober 2015 16:11:20 UTC+2 schrieb Leonel Câmara: 
>
> I may actually have to make a web2py CMS quite soon. I have a bunch 
> requirements that off-the-shelf CMSes don't fulfill but I would be really 
> interested in seeing your code Carlos, give us a heads up when you 
> release.
>
 -- 
> 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+un...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://gi

Re: [web2py] Re: CMS WEB2PY

2016-02-19 Thread Carlos Cesar Caballero Díaz
Hi Ron, CMSs allows to build web sites faster, but they usually lacks of 
flexibility and performance compared with custom applications, I prefer 
to stay in the middle and build custom applications with a core of pre 
made modules for different functionalities, in that way I can balance 
the project time, speed and flexibility.


But it's just my opinion...

Greetings.

El 19/02/16 a las 11:02, Ron Chatterjee escribió:
I didn't mean it like that. I meant to say, due to lack of CMS what 
would be the best practice. Using of CMS or custom theme. Sorry about 
the confusion.


On Friday, February 19, 2016 at 10:25:59 AM UTC-5, LightDot wrote:

You're comparing two different categories. Web2py is a programming
framework, Mezzanine is a CMS. Web2py is a tool you would use to
build a CMS like a Mezzanine (same as Django is used in this
particular case).

In other words, what you should be comparing is Web2py vs Django,
not Web2py vs projects built in Django.

Regards


On Friday, February 19, 2016 at 4:13:15 PM UTC+1, Ron Chatterjee
wrote:

Curious to know what would be best practice? Use CMS like
Mezzanine or use bootstrap and custom theme for each page? It
just seem the look and feel of CMS is nicer than out of box
web2py app.  List are few things Mezzanine offer. Most of it
is fairly simple and offered via various web2py plugins etc.

  * Custom templates


per page or blog post
  * Twitter Bootstrap  integration
  * API for custom content types


  * Search engine and API

  * Seamless integration with third-party Django apps
  * Multi-device detection and template handling
  * One step migration from other blogging engines
  * Automated production provisioning and deployments
  * Disqus  integration, or built-in
threaded comments
  * Gravatar  integration
  * Google Analytics 
integration
  * Twitter  feed integration
  * bit.ly  integration
  * Akismet  spam filtering
  * Built-in test suite


  * JVM 
compatible (via Jython )
  * SEO friendly URLs and meta data
  * Ecommerce / Shopping cart module (Cartridge
)
  * Configurable dashboard

widgets
  * Blog engine
  * Tagging
  * Free Themes , and a
Premium Themes  Marketplace
  * User accounts and profiles with email verification
  * Translated to over 35 languages
  * Sharing via Facebook or Twitter
  * Multi-lingual sites





On Friday, February 19, 2016 at 2:54:02 AM UTC-5, Jörg
Schneider wrote:

I was able to built a Custom-CMS for a refugee helper
association only by watching the videos an reading the
manual. I do only have really basic knowledge in
programming and because Joomla and Wordpress didn't fit my
needs I started from the scratch with web2py which is
really a cool framework.
I just want to encourage you to go step by step and I
promise that you will have a steep learning curve.

Am Dienstag, 13. Oktober 2015 16:11:20 UTC+2 schrieb
Leonel Câmara:

I may actually have to make a web2py CMS quite soon. I
have a bunch requirements that off-the-shelf CMSes
don't fulfill but I would be really interested in
seeing your code Carlos, give us a heads up when you
release.

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




--
Este mensaj

Re: [web2py] Re: CMS WEB2PY

2016-02-19 Thread Carlos Cesar Caballero Díaz
Hi, because of our needs, the time available and the workload, we decide 
to postpone our work in a complete CMS solution, and concentrate in 
modules (web2py plugins) with CMS capabilities that can be reused and 
integrated in an app depending the needs.


I can share the code that supports www.daxab.com but it need some work 
and I am so busy right now (and the next two weeks) because of this: 
http://www.uci.cu/sites/default/files/II%20Convocatoria%20Escuela%20de%20Invierno%202016%20V4.pdf


If in three weeks from now there is no news from me (that could be 
because I forgot this, or I implode because the workload), plese sendme 
a message (privatly or public) to remember...


Greetings.


El 18/02/16 a las 12:14, Ron Chatterjee escribió:

Carlos,

Where can I download "www.daxslab.com 
,"?




On Tuesday, October 13, 2015 at 9:17:20 AM UTC-4, Carlos Cesar 
Caballero wrote:


I am working on a site that is builded using custom made CMS, I am
planning to release it to github when it's finished (the cms),
right now you can see the site (work in progress) at
www.daxslab.com , suggestions and
criticism are very welcomed

El 12/10/15 a las 06:09, Paolo Amboni escribió:

Are there some contraindications to use web2py with php based cms
like joomla?

Il giorno sabato 10 ottobre 2015 18:34:55 UTC+2, Anthony ha scritto:

If it has to be Python, there are several Django based CMSes
-- Wagtail looks like a nice one
(there's also Mezzanine and Django CMS).

Anthony

On Saturday, October 10, 2015 at 3:32:22 AM UTC-4, Paolo
Amboni wrote:

After some research i finally concluded that there is no
stable and structured CMS made for web2py (tell me if i'm
wrong).
Which is a python cms that better can be put beside a
web2py site (already made)?
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 Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to web2py+un...@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.




--
Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
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: Email not working

2016-02-19 Thread Tom Russell
Yea I have the user/pw correct, the smtp settings seem pretty straight 
forward as well so not sure what the root cause is.

On Friday, February 12, 2016 at 4:10:20 PM UTC-5, Dave S wrote:
>
>
>
> On Friday, February 12, 2016 at 12:17:57 PM UTC-8, Tom Russell wrote:
>>
>> Yea I am not trying to blame web2py but it just seems I am not having any 
>> luck getting an email to send. I am using a smtp interface on the other 
>> side.
>>
>> I am just at a loss as to what the issue is and how to solve it.
>>
>> Thanks,
>>
>> Tom
>>
>
> FWIW, on my AWS Linux instance, I send email with server "localhost" and 
> user "None" (I'm hoping that only works from local posts), using either 
> auth's mailer or smtplib directly.  From reading this group for a while, 
> the most common problem seems to be getting user/password right, especially 
> with GMail and 2-factor authentication.
>
> /dps
>
>
>
>> On Friday, February 12, 2016 at 2:40:43 PM UTC-5, Niphlod wrote:
>>>
>>> web2py uses smtplib. as long as on the other side there's an 
>>> smtp-compatible interface, there's no reason to blame web2py :P
>>>
>>> On Friday, February 12, 2016 at 8:38:38 PM UTC+1, Tom Russell wrote:

 I have since my last time trying to get email sending working with the 
 built in registration process moved to Amazon AWS SES mail services which 
 I 
 know works well with other people. I have put in all the required info in 
 db.py needed but still cannot send an email. I have tried gmail, a few 
 other services and nothing so far seems to work.

 Has anyone tried an actual mail service that works, preferably free or 
 close to it. I am beginning to think that web2py has an issue doing this 
 task.

 I really need to get past this hurtle for a product launch soon.

 Thanks,

 Tom

>>>

-- 
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: charts on web2py

2016-02-19 Thread Ron Chatterjee
No, you are fine. I am sorry that my eyes fooled me and I kept thinking 
like google chart this one also loads up the js from external site. I 
wasn't paying attention. That's why google chart is slow in the browser 
setting. Thank you so much. This is a great help and the charts looks 
really nice!

On Friday, February 19, 2016 at 11:18:10 AM UTC-5, Junior Phanter wrote:
>
> This is the advantagem of the highchart over Google Charts. You can use 
> him in local server (offline).
>
> Happy in help.
> Sorry my bad englhis. ;)
>
> 2016-02-19 11:21 GMT-03:00 Ron Chatterjee  >:
>
>> For a moment I thought they are downloading directly from the page.  I 
>> didn't notice. Thank you. 
>>
>> On Thursday, February 18, 2016 at 10:22:57 PM UTC-5, Junior Phanter wrote:
>>>
>>> Download the developer's site the highcharts.js and exporting.js file 
>>> and place the js folder of the your application. (I put in Attached w2p 
>>> example)
>>>
>>> replace YOUR_APP by the name of the your aplication (e.g. chart)
>>>
>>> >> type="text/javascript">>> src="/YOUR_APP/static/js/exporting.js" type="text/javascript">
>>>
>>>
>>> you can do
>>>
>>>
>>> >> type="text/javascript">>> src="/YOUR_APP/static/js/exporting.js" type="text/javascript">
>>>
>>> see changes:
>>>
>>>
>>>
>>> ​
>>>
>>> Attached is w2p example
>>>
>>>
>>>
>>> 2016-02-18 22:40 GMT-03:00 Ron Chatterjee :
>>>

 I stumbled into this post and I also got a blank screen. Attached is my 
 w2p. This is a same replication of the example you posted. Am I missing 
 something?



 On Wednesday, February 17, 2016 at 8:27:15 AM UTC-5, Carlos Cesar 
 Caballero wrote:

> Highcharts is very good. I am using right now c3.js (http://c3js.org/) 
> a good MIT licence option.
>
> Greetings.
>
> El 16/02/16 a las 12:54, Junior Phanter escribió:
>
> Use highcharts
> http://www.highcharts.com
>
> Example:
>
> *ON CONTROLLER*
>
> def chart():
>
> dados_chart="[{name: 'Batata', y: 12},{name: 'Tomate', y: 
> 8},{name: 'Mamão', y: 12}]" #Change this dynamically
>
> dados_map={}
> dados_map["dados"]=dados_chart
>
> chart="""
> 
> Highcharts.setOptions({
> lang:{
> downloadJPEG: "Download em imagem JPG",
> downloadPDF: "Download em documento PDF",
> downloadPNG: "Download em imagem PNG",
> downloadSVG: "Download em vetor SVG",
> loading: "Lendo...",
> noData: "Sem dados para mostrar",
> printChart: "Imprimir Gráfico",
> }
> });
>
> // Build the chart
> $('#chart').highcharts({
> chart: {
> plotBackgroundColor: null,
> plotBorderWidth: null,
> plotShadow: false,
> type: 'pie'
> },
> title: {
> text: 'Meu Gráfico'
> },
> tooltip: {
> pointFormat: '{series.name}: 
> {point.percentage:.1f}%%'
> },
> plotOptions: {
> pie: {
> allowPointSelect: true,
> cursor: 'pointer',
> dataLabels: {
> enabled: false
> },
> showInLegend: true
> }
> },
> credits:{enabled:false},
> series: [{
> name: 'Vendar por porcentagem',
> colorByPoint: true,
> data: %(dados)s
> }]
> });
> 
>
> """ %dados_map
> return dict(chart=XML(chart))
>
> *ON VIEW*
>
> {{extend 'layout.html'}}
>  type="text/javascript">
>  type="text/javascript">
> 
> 
> {{=chart}}
>
> 2016-02-15 12:52 GMT-03:00 :
>
>> I used google charts using a simple bar chart since I couldn't find a 
>> workable example on the slice using pygal etc. But google chart seems 
>> little slow in loading on the browser and I believe it may be due to 
>> loading the js file from the remote site. Does anyone have the same 
>> experience? If so, how did they resolve it. I tried to load the js file 
>> locally but was unable to make that to work. 
>>
>>   
>>
>> On Monday, January 25, 2016 at 8:32:01 AM UTC-5, Diego Tostes wrote: 
>>>
>>> thanks!
>>>
>>>
>>> 2016-01-22 1:10 GMT-02:00 Junior Phanter :
>>>
 Example using just google chart api, without google-charts-plug-in

 on controller

 def chart():
 title="My Chart"
 data=XML('[ ["item", "value"], ["apple", 1], ["potato", 1.5], 
 ["watermelon", 0.5]]') #convert list in

[web2py] Re: Old field value returns in custom select widget

2016-02-19 Thread Ian W. Scott
Okay, here's the core of the code. First, this is the function that creates 
the form (in a component and submitted via ajax). It's a generic form for 
editing db records based on a url arg supplying the table name. You'll 
notice that I have to use a hack at the moment to get the values from my 
custom form (AjaxSelect) to submit. The widget code is below:


def editform(self, rargs=None, rvars=None):
"""
"""
db = current.db

flash = ''
rjs = ''
duplink = ''
default_vars = {}

if rargs is not None:
tablename = rargs[0]
showid = rvars['showid'] or True
dbio = False if 'dbio' in rvars.keys() and rvars['dbio'] == 
'False' else True
formstyle = rvars['formstyle'] or 'ul'
deletable = rvars['deletable'] or True
copylabel = rvars['copylabel'] or SPAN(_class='glyphicon 
glyphicon-file')
orderby = rvars['orderby'] or 'id'
restrictor = rvars['restrictor'] or None
collation = rvars['collation'] or None
postprocess = rvars['postprocess'] or None

if len(rargs) > 1:  # editing specific item
rowid = rargs[1]
formname = '{}/{}'.format(tablename, rowid)
formargs = [db[tablename], rowid]

# create a link for adding a new row to the table
duplink = A(copylabel,
_href=URL('plugin_listandedit',
  'dupAndEdit.load',
  args=[tablename, rowid],
  vars=rvars),
_class='plugin_listandedit_duplicate',
cid='viewpane')

elif len(rargs) == 1:  # creating new item
formname = '{}/create'.format(tablename)
default_vars = {k: v for k, v in rvars.iteritems()
if hasattr(db[tablename], k)}
formargs = [db[tablename]]

form = self._myform(formargs,
deletable=deletable,
showid=showid,
formstyle=formstyle)
# print {'default_vars': default_vars}
# for k in default_vars: form.vars.setitem(k, default_vars[k])
for k in default_vars: form.vars[k] = default_vars[k]

# FIXME: ajaxselect field values have to be added manually
# FIXME: this check will fail if ajaxselect widget is for field 
indx[1]
if db[tablename].fields[1] in rvars.keys():
extras = [f for f in db[tablename].fields
  if f not in form.vars.keys()]
for e in extras:
form.vars[e] = rvars[e] if e in rvars.keys() \
else ''
if 'id' in form.vars.keys() and form.vars['id'] in (None, ''
):
del(form.vars['id'])
else:
pass
# print 'form vars in editform 
-'
# pprint(form.vars)

if form.process(formname=formname, dbio=dbio).accepted:
flash = ''
if postprocess:
flash += '{} '.format(self._post_process(form.vars, 
postprocess))
if dbio:
flash += 'The changes were recorded successfully.'

# either redirect or refresh the list pane
if 'redirect' in rvars and 'True' == rvars['redirect']:
redirect(URL(rvars['redirect_c'], rvars['redirect_a']))
else:
the_url = URL('plugin_listandedit', 'itemlist.load',
  args=[tablename], vars={'orderby': orderby
,
  'restrictor': 
restrictor,
  'collation': 
collation})
rjs = "window.setTimeout(web2py_component('{}', " \
  "'listpane'), 500);".format(the_url)
elif form.errors:
print '\n\nlistandedit form errors:'
pprint({k: v for k, v in form.errors.iteritems()})
print '\n\nlistandedit form vars'
pprint({k: v for k, v in form.vars.iteritems()})
print '\n\nlistandedit request vars'
pprint({k: v for k, v in rvars.iteritems()})
flash = 'Sorry, there was an error processing ' \
'the form. The changes have not been 
recorded.'

else:
pass

else:
flash = 'Sorry, you need to specify a type of record before' \
 'I can list the records.'
form = None

return form, duplink, flash, rjs


Now here's the first bit of the cus

Re: [web2py] Re: Session variables and multiple browser tabs

2016-02-19 Thread Jim Steil
I was thinking of that but then couldn't figure out how I'd handle clicking
the back button in the browser.

Doing a little research we've found a plugin for Firefox called MultiFox
that does what I want.  We are also going to play later today with the
multi-personality features of chrome and firefox to see if that is an
alternative for us.

On Fri, Feb 19, 2016 at 9:17 AM, Niphlod  wrote:

> the less session you use, the more your app is scalable. that being said,
> it's pretty clear that you can't leverage in python something that is only
> available on javascript.
> maybe but just maybe you can POST back to web2py a variable that is stored
> on the sessionstorage (i.e. the current date if sessionstorage.currentdate
> does not exist yet) and use it to namespace your session key names (hence,
> values) amongst tabs.
>
> On Friday, February 19, 2016 at 2:20:14 PM UTC+1, Jim S wrote:
>>
>> Thanks for the reply.  However, I'm unclear on how I might use it
>> effectively.
>>
>> My scenario in my app:
>>
>> I have a python object that I pass around to different pages.  At the end
>> of each of my controller methods I do the following:
>>
>> wo = Workorder(auth.user.id, workorder_id)
>>
>>
>> #  save to the session
>> session.workorder = cPickle.dumps(wo.to_dict())
>>
>>
>> Then, at the beginning of each controller method I do:
>>
>> wo = Workorder(auth.user.id)
>> wo.from_dict(cPickle.loads(session.workorder))
>>
>>
>> So, with my limited javascript knowledge, I don't see how I'd be able to
>> convert this to sessionstorage.  And actually, I don't know if what I'm
>> doing with pickling/unpickling dicts is a smart thing to do.  If anyone has
>> any pointers/comments, I'd appreciate it.  However, it seems as though I
>> may need to rethink my strategy.
>>
>> Thanks for taking a look.
>>
>> -Jim
>>
>>
>> On Friday, February 19, 2016 at 2:45:05 AM UTC-6, Niphlod wrote:
>>>
>>> every browser considers tabs as belonging to the same session in regards
>>> to cookies. there's no way to separate those using web2py code.
>>> you can leverage sessionstorage in javascript that keeps values alive -
>>> and compartimentalized - to a single living tab.
>>>
>>> On Friday, February 19, 2016 at 4:56:21 AM UTC+1, Jim S wrote:

 Hi

 Is there a way to keep independent session variables between two open
 browser tabs?

 Example

 1.  write a session variable in tab 2
 2.  switch to tab 1 and execute the same page setting the session
 variable to a different value
 3.  go back to tab 2 and request page that reads the session variable
 and gets the value set from tab 1

 Is there any way to force each tab to have it's own session variables?

 -Jim

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


Re: [web2py] Re: charts on web2py

2016-02-19 Thread Junior Phanter
This is the advantagem of the highchart over Google Charts. You can use him
in local server (offline).

Happy in help.
Sorry my bad englhis. ;)

2016-02-19 11:21 GMT-03:00 Ron Chatterjee :

> For a moment I thought they are downloading directly from the page.  I
> didn't notice. Thank you.
>
> On Thursday, February 18, 2016 at 10:22:57 PM UTC-5, Junior Phanter wrote:
>>
>> Download the developer's site the highcharts.js and exporting.js file and
>> place the js folder of the your application. (I put in Attached w2p example)
>>
>> replace YOUR_APP by the name of the your aplication (e.g. chart)
>>
>> > type="text/javascript">> src="/YOUR_APP/static/js/exporting.js" type="text/javascript">
>>
>>
>> you can do
>>
>>
>> > type="text/javascript">> src="/YOUR_APP/static/js/exporting.js" type="text/javascript">
>>
>> see changes:
>>
>>
>>
>> ​
>>
>> Attached is w2p example
>>
>>
>>
>> 2016-02-18 22:40 GMT-03:00 Ron Chatterjee :
>>
>>>
>>> I stumbled into this post and I also got a blank screen. Attached is my
>>> w2p. This is a same replication of the example you posted. Am I missing
>>> something?
>>>
>>>
>>>
>>> On Wednesday, February 17, 2016 at 8:27:15 AM UTC-5, Carlos Cesar
>>> Caballero wrote:
>>>
 Highcharts is very good. I am using right now c3.js (http://c3js.org/)
 a good MIT licence option.

 Greetings.

 El 16/02/16 a las 12:54, Junior Phanter escribió:

 Use highcharts
 http://www.highcharts.com

 Example:

 *ON CONTROLLER*

 def chart():

 dados_chart="[{name: 'Batata', y: 12},{name: 'Tomate', y: 8},{name:
 'Mamão', y: 12}]" #Change this dynamically

 dados_map={}
 dados_map["dados"]=dados_chart

 chart="""
 
 Highcharts.setOptions({
 lang:{
 downloadJPEG: "Download em imagem JPG",
 downloadPDF: "Download em documento PDF",
 downloadPNG: "Download em imagem PNG",
 downloadSVG: "Download em vetor SVG",
 loading: "Lendo...",
 noData: "Sem dados para mostrar",
 printChart: "Imprimir Gráfico",
 }
 });

 // Build the chart
 $('#chart').highcharts({
 chart: {
 plotBackgroundColor: null,
 plotBorderWidth: null,
 plotShadow: false,
 type: 'pie'
 },
 title: {
 text: 'Meu Gráfico'
 },
 tooltip: {
 pointFormat: '{series.name}:
 {point.percentage:.1f}%%'
 },
 plotOptions: {
 pie: {
 allowPointSelect: true,
 cursor: 'pointer',
 dataLabels: {
 enabled: false
 },
 showInLegend: true
 }
 },
 credits:{enabled:false},
 series: [{
 name: 'Vendar por porcentagem',
 colorByPoint: true,
 data: %(dados)s
 }]
 });
 

 """ %dados_map
 return dict(chart=XML(chart))

 *ON VIEW*

 {{extend 'layout.html'}}
 >>> type="text/javascript">
 >>> type="text/javascript">
 
 
 {{=chart}}

 2016-02-15 12:52 GMT-03:00 :

> I used google charts using a simple bar chart since I couldn't find a
> workable example on the slice using pygal etc. But google chart seems
> little slow in loading on the browser and I believe it may be due to
> loading the js file from the remote site. Does anyone have the same
> experience? If so, how did they resolve it. I tried to load the js file
> locally but was unable to make that to work.
>
>
>
> On Monday, January 25, 2016 at 8:32:01 AM UTC-5, Diego Tostes wrote:
>>
>> thanks!
>>
>>
>> 2016-01-22 1:10 GMT-02:00 Junior Phanter :
>>
>>> Example using just google chart api, without google-charts-plug-in
>>>
>>> on controller
>>>
>>> def chart():
>>> title="My Chart"
>>> data=XML('[ ["item", "value"], ["apple", 1], ["potato", 1.5],
>>> ["watermelon", 0.5]]') #convert list in string and string in XML
>>> return dict(title=title, data=data)
>>>
>>> on view (chart.html)
>>>
>>> {{extend 'layout.html'}}
>>>
>>> 
>>>
>>> https://www.gstatic.com/charts/loader.js>
>>> https://www.gstatic.com/charts/loader.js";>
>>>
>>> 
>>>   google.charts.load('current', {'packages':['corechart']});
>>>   google.charts.setOnLoadCallback(drawChart);
>>>   function drawChart() {
>>>
>>> var data

Re: [web2py] Re: problem with sessions2trash.py

2016-02-19 Thread peter

>
> Good point thanks
>
Peter 

-- 
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: CMS WEB2PY

2016-02-19 Thread Ron Chatterjee
I didn't mean it like that. I meant to say, due to lack of CMS what would 
be the best practice. Using of CMS or custom theme. Sorry about the 
confusion.

On Friday, February 19, 2016 at 10:25:59 AM UTC-5, LightDot wrote:
>
> You're comparing two different categories. Web2py is a programming 
> framework, Mezzanine is a CMS. Web2py is a tool you would use to build a 
> CMS like a Mezzanine (same as Django is used in this particular case).
>
> In other words, what you should be comparing is Web2py vs Django, not 
> Web2py vs projects built in Django.
>
> Regards
>
>
> On Friday, February 19, 2016 at 4:13:15 PM UTC+1, Ron Chatterjee wrote:
>>
>> Curious to know what would be best practice? Use CMS like Mezzanine or 
>> use bootstrap and custom theme for each page? It just seem the look and 
>> feel of CMS is nicer than out of box web2py app.  List are few things 
>> Mezzanine offer. Most of it is fairly simple and offered via various web2py 
>> plugins etc.
>>
>>
>>- Custom templates 
>> 
>>per page or blog post
>>- Twitter Bootstrap  integration
>>- API for custom content types 
>>
>> 
>>- Search engine and API 
>>
>>- Seamless integration with third-party Django apps
>>- Multi-device detection and template handling
>>- One step migration from other blogging engines
>>- Automated production provisioning and deployments
>>- Disqus  integration, or built-in threaded 
>>comments
>>- Gravatar  integration
>>- Google Analytics  integration
>>- Twitter  feed integration
>>- bit.ly integration
>>- Akismet  spam filtering
>>- Built-in test suite 
>>
>>- JVM  compatible 
>>(via Jython )
>>- SEO friendly URLs and meta data
>>- Ecommerce / Shopping cart module (Cartridge 
>>)
>>- Configurable dashboard 
>> 
>>widgets
>>- Blog engine
>>- Tagging
>>- Free Themes , and a Premium Themes 
>> Marketplace
>>- User accounts and profiles with email verification
>>- Translated to over 35 languages
>>- Sharing via Facebook or Twitter
>>- Multi-lingual sites 
>>
>>
>>
>>
>>
>> On Friday, February 19, 2016 at 2:54:02 AM UTC-5, Jörg Schneider wrote:
>>>
>>> I was able to built a Custom-CMS for a refugee helper association only 
>>> by watching the videos an reading the manual. I do only have really basic 
>>> knowledge in programming and because Joomla and Wordpress didn't fit my 
>>> needs I started from the scratch with web2py which is really a cool 
>>> framework.
>>> I just want to encourage you to go step by step and I promise that you 
>>> will have a steep learning curve.
>>>
>>> Am Dienstag, 13. Oktober 2015 16:11:20 UTC+2 schrieb Leonel Câmara:

 I may actually have to make a web2py CMS quite soon. I have a bunch 
 requirements that off-the-shelf CMSes don't fulfill but I would be really 
 interested in seeing your code Carlos, give us a heads up when you release.

>>>

-- 
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: problem with sessions2trash.py

2016-02-19 Thread Richard Vézina
Don't forget to update web2py app files, which a simple update don't
 address :

https://groups.google.com/d/msg/web2py/tVyL7z7WHkw/mce13Vh-k3UJ

but session2trash not part of that I think...

Richard


On Fri, Feb 19, 2016 at 7:48 AM, peter  wrote:

> Upgrading my web2py to the latest verision 2.13.4 did sort out the problem.
>
> I used the automatic upgrade. This produced a ticket, but restarting
> web2py sorted this out.
>
> Web2py's maintaining backwards compatability is great.
>
> Peter
>
> --
> 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.
>

-- 
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: Flash message if before_insert fail

2016-02-19 Thread Anthony

>
> db.poc.Name.requires = [IS_UPPER 
> (), CRYPT 
> (),
> IS_NOT_IN_DB(db(db.poc.Birthday == 
> request.vars.Birthday), 'poc.Name')]
>
>
>
> I've tried but this doesn't work properly and adds duplicated data. I 
> figured out  that is probably because I'm using CRYPT() and I get a 
> LazyCrypt Object but IS_NOT_IN_DB expects a string
>

Try:

db.poc.Name.requires = [IS_UPPER 
(), lambda v: (str(CRYPT 
()(v)[0]), None),
IS_NOT_IN_DB(db(db.poc.Birthday == 
request.vars.Birthday), 'poc.Name')]

 

> Where can'I find the source code for _before_insert?
>

https://github.com/web2py/pydal/blob/master/pydal/objects.py#L729 

A few additional tips:
>
>
>- form.process() accepts a "message_onsuccess" argument, so you can 
>use that instead of checking if the form is accepted and explicitly 
> setting 
>response.flash.
>
> Tried and this prevent  "record added" message but I'm still unable to 
> show a duplicate error message.
>

That wasn't intended as a solution to this particular problem, just a tip 
for when you do need to set an onsuccess flash message.

Anthony

>

-- 
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: Where does a login action go?

2016-02-19 Thread Anthony
Are you using SessionVariable to store and re-send the session cookie? 
web2py uses a session cookie to link the client with a session on the 
server, and the login status is stored in the session.

Anthony

On Thursday, February 18, 2016 at 11:04:04 PM UTC-5, Dave S wrote:
>
> I'm trying to futz around a user's problem on a Windows client, so I'm 
> learning about Invoke-WebRequest in PowerShell.
> https://technet.microsoft.com/en-us/library/hh849901.aspx>
>
> I'm following the Facebook login example on that page, but trying to log 
> into my app.  I can get the login form correctly (it appears), and I can 
> update the form fields in a way that seems to be acceptable (on both ends), 
> but the action is just '#', and I post to //host/app/default/user/login or 
> //host/app/default/user/login# I get a 200 response and a fresh copy of the 
> login form, rather than continuing to the _next page set in the form 
> (app/default/index).  If I try posting the form to app/default/index, I get 
> a 303 and back to the login form.
>
> Can someone who has a clue hit me with it?
>
> /dps
>
>

-- 
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: Session variables and multiple browser tabs

2016-02-19 Thread Anthony
I think the idea is you would not use the web2py server-side session but 
would instead handle things on the browser side.

An alternative would be to generate some kind of unique key for each 
page/tab to use as a namespace within the server-side session, and then 
either put that key in the URL (as an arg or in the query string), or 
handle page updates exclusively via Ajax and pass the key with each Ajax 
request (of course, when making post requests, you can pass the key via the 
posted data, but that doesn't help for non-post requests).

Also, note that the session is pickled automatically, so there is no need 
to pickle a dictionary before adding it to the session.

Anthony

On Friday, February 19, 2016 at 8:20:14 AM UTC-5, Jim S wrote:
>
> Thanks for the reply.  However, I'm unclear on how I might use it 
> effectively.
>
> My scenario in my app:
>
> I have a python object that I pass around to different pages.  At the end 
> of each of my controller methods I do the following:
>
> wo = Workorder(auth.user.id, workorder_id)
>
>
> #  save to the session
> session.workorder = cPickle.dumps(wo.to_dict())
>
>
> Then, at the beginning of each controller method I do:
>
> wo = Workorder(auth.user.id)
> wo.from_dict(cPickle.loads(session.workorder))
>
>
> So, with my limited javascript knowledge, I don't see how I'd be able to 
> convert this to sessionstorage.  And actually, I don't know if what I'm 
> doing with pickling/unpickling dicts is a smart thing to do.  If anyone has 
> any pointers/comments, I'd appreciate it.  However, it seems as though I 
> may need to rethink my strategy.
>
> Thanks for taking a look.
>
> -Jim
>
>
> On Friday, February 19, 2016 at 2:45:05 AM UTC-6, Niphlod wrote:
>>
>> every browser considers tabs as belonging to the same session in regards 
>> to cookies. there's no way to separate those using web2py code.
>> you can leverage sessionstorage in javascript that keeps values alive - 
>> and compartimentalized - to a single living tab.
>>
>> On Friday, February 19, 2016 at 4:56:21 AM UTC+1, Jim S wrote:
>>>
>>> Hi
>>>
>>> Is there a way to keep independent session variables between two open 
>>> browser tabs?
>>>
>>> Example
>>>
>>> 1.  write a session variable in tab 2
>>> 2.  switch to tab 1 and execute the same page setting the session 
>>> variable to a different value
>>> 3.  go back to tab 2 and request page that reads the session variable 
>>> and gets the value set from tab 1
>>>
>>> Is there any way to force each tab to have it's own session variables?
>>>
>>> -Jim
>>>
>>

-- 
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: CMS WEB2PY

2016-02-19 Thread LightDot
You're comparing two different categories. Web2py is a programming 
framework, Mezzanine is a CMS. Web2py is a tool you would use to build a 
CMS like a Mezzanine (same as Django is used in this particular case).

In other words, what you should be comparing is Web2py vs Django, not 
web2py vs projects built in Django.

Regards


On Friday, February 19, 2016 at 4:13:15 PM UTC+1, Ron Chatterjee wrote:
>
> Curious to know what would be best practice? Use CMS like Mezzanine or use 
> bootstrap and custom theme for each page? It just seem the look and feel of 
> CMS is nicer than out of box web2py app.  List are few things Mezzanine 
> offer. Most of it is fairly simple and offered via various web2py plugins 
> etc.
>
>
>- Custom templates 
> 
>per page or blog post
>- Twitter Bootstrap  integration
>- API for custom content types 
>
> 
>- Search engine and API 
>
>- Seamless integration with third-party Django apps
>- Multi-device detection and template handling
>- One step migration from other blogging engines
>- Automated production provisioning and deployments
>- Disqus  integration, or built-in threaded 
>comments
>- Gravatar  integration
>- Google Analytics  integration
>- Twitter  feed integration
>- bit.ly integration
>- Akismet  spam filtering
>- Built-in test suite 
>
>- JVM  compatible 
>(via Jython )
>- SEO friendly URLs and meta data
>- Ecommerce / Shopping cart module (Cartridge 
>)
>- Configurable dashboard 
> 
>widgets
>- Blog engine
>- Tagging
>- Free Themes , and a Premium Themes 
> Marketplace
>- User accounts and profiles with email verification
>- Translated to over 35 languages
>- Sharing via Facebook or Twitter
>- Multi-lingual sites 
>
>
>
>
>
> On Friday, February 19, 2016 at 2:54:02 AM UTC-5, Jörg Schneider wrote:
>>
>> I was able to built a Custom-CMS for a refugee helper association only by 
>> watching the videos an reading the manual. I do only have really basic 
>> knowledge in programming and because Joomla and Wordpress didn't fit my 
>> needs I started from the scratch with web2py which is really a cool 
>> framework.
>> I just want to encourage you to go step by step and I promise that you 
>> will have a steep learning curve.
>>
>> Am Dienstag, 13. Oktober 2015 16:11:20 UTC+2 schrieb Leonel Câmara:
>>>
>>> I may actually have to make a web2py CMS quite soon. I have a bunch 
>>> requirements that off-the-shelf CMSes don't fulfill but I would be really 
>>> interested in seeing your code Carlos, give us a heads up when you release.
>>>
>>

-- 
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: How to install web2py on CentOS 6.5 with Apache?

2016-02-19 Thread Fabiano Almeida
I'm a Debian user / Ubuntu, CentOS testing for the first time ...

Thanks!

2016-02-19 12:57 GMT-02:00 Jim S :

> I'm not a CentOS guy, but there are a couple scripts (although not for
> 6.5) in the /scripts directory that may give you clues as to what needs to
> happen.
>
> -Jim
>
>
> On Friday, February 19, 2016 at 8:48:59 AM UTC-6, Fabiano Almeida wrote:
>>
>> Hi all,
>>
>> How to install web2py on CentOS 6.5 with Apache?
>>
>> Tks!
>>
>> Fabiano.
>>
> --
> 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.
>

-- 
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: Session variables and multiple browser tabs

2016-02-19 Thread Niphlod
the less session you use, the more your app is scalable. that being said, 
it's pretty clear that you can't leverage in python something that is only 
available on javascript.
maybe but just maybe you can POST back to web2py a variable that is stored 
on the sessionstorage (i.e. the current date if sessionstorage.currentdate 
does not exist yet) and use it to namespace your session key names (hence, 
values) amongst tabs.

On Friday, February 19, 2016 at 2:20:14 PM UTC+1, Jim S wrote:
>
> Thanks for the reply.  However, I'm unclear on how I might use it 
> effectively.
>
> My scenario in my app:
>
> I have a python object that I pass around to different pages.  At the end 
> of each of my controller methods I do the following:
>
> wo = Workorder(auth.user.id, workorder_id)
>
>
> #  save to the session
> session.workorder = cPickle.dumps(wo.to_dict())
>
>
> Then, at the beginning of each controller method I do:
>
> wo = Workorder(auth.user.id)
> wo.from_dict(cPickle.loads(session.workorder))
>
>
> So, with my limited javascript knowledge, I don't see how I'd be able to 
> convert this to sessionstorage.  And actually, I don't know if what I'm 
> doing with pickling/unpickling dicts is a smart thing to do.  If anyone has 
> any pointers/comments, I'd appreciate it.  However, it seems as though I 
> may need to rethink my strategy.
>
> Thanks for taking a look.
>
> -Jim
>
>
> On Friday, February 19, 2016 at 2:45:05 AM UTC-6, Niphlod wrote:
>>
>> every browser considers tabs as belonging to the same session in regards 
>> to cookies. there's no way to separate those using web2py code.
>> you can leverage sessionstorage in javascript that keeps values alive - 
>> and compartimentalized - to a single living tab.
>>
>> On Friday, February 19, 2016 at 4:56:21 AM UTC+1, Jim S wrote:
>>>
>>> Hi
>>>
>>> Is there a way to keep independent session variables between two open 
>>> browser tabs?
>>>
>>> Example
>>>
>>> 1.  write a session variable in tab 2
>>> 2.  switch to tab 1 and execute the same page setting the session 
>>> variable to a different value
>>> 3.  go back to tab 2 and request page that reads the session variable 
>>> and gets the value set from tab 1
>>>
>>> Is there any way to force each tab to have it's own session variables?
>>>
>>> -Jim
>>>
>>

-- 
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: CMS WEB2PY

2016-02-19 Thread Ron Chatterjee
Curious to know what would be best practice? Use CMS like Mezzanine or use 
bootstrap and custom theme for each page? It just seem the look and feel of 
CMS is nicer than out of box web2py app.  List are few things Mezzanine 
offer. Most of it is fairly simple and offered via various web2py plugins 
etc.


   - Custom templates 
    
   per page or blog post
   - Twitter Bootstrap  integration
   - API for custom content types 
   

   - Search engine and API 
   
   - Seamless integration with third-party Django apps
   - Multi-device detection and template handling
   - One step migration from other blogging engines
   - Automated production provisioning and deployments
   - Disqus  integration, or built-in threaded comments
   - Gravatar  integration
   - Google Analytics  integration
   - Twitter  feed integration
   - bit.ly integration
   - Akismet  spam filtering
   - Built-in test suite 
   
   - JVM  compatible 
   (via Jython )
   - SEO friendly URLs and meta data
   - Ecommerce / Shopping cart module (Cartridge 
   )
   - Configurable dashboard 
    
   widgets
   - Blog engine
   - Tagging
   - Free Themes , and a Premium Themes 
    Marketplace
   - User accounts and profiles with email verification
   - Translated to over 35 languages
   - Sharing via Facebook or Twitter
   - Multi-lingual sites 
   




On Friday, February 19, 2016 at 2:54:02 AM UTC-5, Jörg Schneider wrote:
>
> I was able to built a Custom-CMS for a refugee helper association only by 
> watching the videos an reading the manual. I do only have really basic 
> knowledge in programming and because Joomla and Wordpress didn't fit my 
> needs I started from the scratch with web2py which is really a cool 
> framework.
> I just want to encourage you to go step by step and I promise that you 
> will have a steep learning curve.
>
> Am Dienstag, 13. Oktober 2015 16:11:20 UTC+2 schrieb Leonel Câmara:
>>
>> I may actually have to make a web2py CMS quite soon. I have a bunch 
>> requirements that off-the-shelf CMSes don't fulfill but I would be really 
>> interested in seeing your code Carlos, give us a heads up when you release.
>>
>

-- 
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 install web2py on CentOS 6.5 with Apache?

2016-02-19 Thread Jim S
I'm not a CentOS guy, but there are a couple scripts (although not for 6.5) 
in the /scripts directory that may give you clues as to what needs to 
happen.

-Jim

On Friday, February 19, 2016 at 8:48:59 AM UTC-6, Fabiano Almeida wrote:
>
> Hi all,
>
> How to install web2py on CentOS 6.5 with Apache?
>
> Tks!
>
> Fabiano.
>

-- 
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 install web2py on CentOS 6.5 with Apache?

2016-02-19 Thread Fabiano Almeida
Hi all,

How to install web2py on CentOS 6.5 with Apache?

Tks!

Fabiano.

-- 
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: charts on web2py

2016-02-19 Thread Ron Chatterjee
For a moment I thought they are downloading directly from the page.  I 
didn't notice. Thank you. 

On Thursday, February 18, 2016 at 10:22:57 PM UTC-5, Junior Phanter wrote:
>
> Download the developer's site the highcharts.js and exporting.js file and 
> place the js folder of the your application. (I put in Attached w2p example)
>
> replace YOUR_APP by the name of the your aplication (e.g. chart)
>
>  type="text/javascript"> src="/YOUR_APP/static/js/exporting.js" type="text/javascript">
>
>
> you can do
>
>
>  type="text/javascript"> src="/YOUR_APP/static/js/exporting.js" type="text/javascript">
>
> see changes:
>
>
>
> ​
>
> Attached is w2p example
>
>
>
> 2016-02-18 22:40 GMT-03:00 Ron Chatterjee  >:
>
>>
>> I stumbled into this post and I also got a blank screen. Attached is my 
>> w2p. This is a same replication of the example you posted. Am I missing 
>> something?
>>
>>
>>
>> On Wednesday, February 17, 2016 at 8:27:15 AM UTC-5, Carlos Cesar 
>> Caballero wrote:
>>
>>> Highcharts is very good. I am using right now c3.js (http://c3js.org/) 
>>> a good MIT licence option.
>>>
>>> Greetings.
>>>
>>> El 16/02/16 a las 12:54, Junior Phanter escribió:
>>>
>>> Use highcharts
>>> http://www.highcharts.com
>>>
>>> Example:
>>>
>>> *ON CONTROLLER*
>>>
>>> def chart():
>>>
>>> dados_chart="[{name: 'Batata', y: 12},{name: 'Tomate', y: 8},{name: 
>>> 'Mamão', y: 12}]" #Change this dynamically
>>>
>>> dados_map={}
>>> dados_map["dados"]=dados_chart
>>>
>>> chart="""
>>> 
>>> Highcharts.setOptions({
>>> lang:{
>>> downloadJPEG: "Download em imagem JPG",
>>> downloadPDF: "Download em documento PDF",
>>> downloadPNG: "Download em imagem PNG",
>>> downloadSVG: "Download em vetor SVG",
>>> loading: "Lendo...",
>>> noData: "Sem dados para mostrar",
>>> printChart: "Imprimir Gráfico",
>>> }
>>> });
>>>
>>> // Build the chart
>>> $('#chart').highcharts({
>>> chart: {
>>> plotBackgroundColor: null,
>>> plotBorderWidth: null,
>>> plotShadow: false,
>>> type: 'pie'
>>> },
>>> title: {
>>> text: 'Meu Gráfico'
>>> },
>>> tooltip: {
>>> pointFormat: '{series.name}: 
>>> {point.percentage:.1f}%%'
>>> },
>>> plotOptions: {
>>> pie: {
>>> allowPointSelect: true,
>>> cursor: 'pointer',
>>> dataLabels: {
>>> enabled: false
>>> },
>>> showInLegend: true
>>> }
>>> },
>>> credits:{enabled:false},
>>> series: [{
>>> name: 'Vendar por porcentagem',
>>> colorByPoint: true,
>>> data: %(dados)s
>>> }]
>>> });
>>> 
>>>
>>> """ %dados_map
>>> return dict(chart=XML(chart))
>>>
>>> *ON VIEW*
>>>
>>> {{extend 'layout.html'}}
>>> >> type="text/javascript">
>>> >> type="text/javascript">
>>> 
>>> 
>>> {{=chart}}
>>>
>>> 2016-02-15 12:52 GMT-03:00 :
>>>
 I used google charts using a simple bar chart since I couldn't find a 
 workable example on the slice using pygal etc. But google chart seems 
 little slow in loading on the browser and I believe it may be due to 
 loading the js file from the remote site. Does anyone have the same 
 experience? If so, how did they resolve it. I tried to load the js file 
 locally but was unable to make that to work. 

   

 On Monday, January 25, 2016 at 8:32:01 AM UTC-5, Diego Tostes wrote: 
>
> thanks!
>
>
> 2016-01-22 1:10 GMT-02:00 Junior Phanter :
>
>> Example using just google chart api, without google-charts-plug-in
>>
>> on controller
>>
>> def chart():
>> title="My Chart"
>> data=XML('[ ["item", "value"], ["apple", 1], ["potato", 1.5], 
>> ["watermelon", 0.5]]') #convert list in string and string in XML
>> return dict(title=title, data=data)
>>
>> on view (chart.html)
>>
>> {{extend 'layout.html'}}
>>
>> 
>>
>> https://www.gstatic.com/charts/loader.js>
>> https://www.gstatic.com/charts/loader.js";>
>>
>> 
>>   google.charts.load('current', {'packages':['corechart']});
>>   google.charts.setOnLoadCallback(drawChart);
>>   function drawChart() {
>>
>> var data = google.visualization.arrayToDataTable({{=data}});
>>
>> var options = {
>>   title: '{{=title}}'
>> };
>>
>> var chart = new 
>> google.visualization.PieChart(document.getElementById('my_chart'));
>>
>> chart.draw(data, options);
>>   }
>> 
>>
>>>

[web2py] Generator for web2py - part 2

2016-02-19 Thread Graham Ranson
I see that the web2pyslices still doesn't have the entry I posted a few days 
ago and neither has my reply to Carlos' posting. The latter may be because I 
don't/cannot use google groups because Google don't want to let me create a 
user, which is fine by me if they want to be like that...

so just go to

http://www.olympic.co.uk/pythondev/

to download and read through the how to use document at least. I'll use that 
web page in the future for updates.

I will, yet again, point out that this is a work in progress with lots of 
gaps and almost certainly a few bugs and certainly with a lot of diagnostics 
that really will go soon. My excuse is that I really haven't had a lot of 
tmie to work on it over the past three months or so - blame that on the 
warmest and wettest December (probably bot since records began...) which has 
had an impact on some of my other horticultural and small-scale sheep 
raising activities - fortunately most of the plants and sheep have 
survived...

And again, don't be too concerned about the quality of the code: firstly it 
will be changed quite a lot in the not too distant future; and secondly it 
is my first Python program.

If anyone is interested then please let me have your comments and ideas.

graham


-- 
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: daily scheduler task

2016-02-19 Thread Brian M
Oddly enough I actually had this happen this past weekend. I have a daily 
task that sends plant status update emails and the view template that 
renders the email body was choking because of an unexpected dividide by 
zero. The first day after the bad data was entered the scheduled run did 
simply fail when it hit that record and stop. However, the next day it did 
just keep trying over and over again and by the time I checked my email it 
had run several hundred times and I had a thousand plus emails from the 
part of the scheduler task prior to location with the error. I have had 
this sort of thing happen a few other times as well.

Brian 

On Wednesday, February 3, 2016 at 1:43:26 PM UTC-6, Niphlod wrote:
>
> it really doesn't change that much if it's bad code or good one, it's 
> executed in web2py env that traps the exception. Unless you're overriding 
> multiprocessing, datetime, etc etc etc (but this is just shooting really 
> high with the fantasy) the whole scheduler would die (not just the task) 
> but in that case you won't see it marked as failed and surely the 
> times_failed counter wouldn't go up.
>
> On Wednesday, February 3, 2016 at 5:51:35 PM UTC+1, Alex wrote:
>>
>> yeah, it's very unusual. This only happened a few times in the last 4 
>> years for me. But one of the reasons is that it only occurs when the task 
>> raises an exception or runtime error. Usually my tasks run fine but a few 
>> times I deployed "bad" code with failed tasks. And when the task fails it's 
>> not so uncommon anymore.
>>
>> On Tuesday, February 2, 2016 at 9:31:39 PM UTC+1, Tim Richardson wrote:
>>>
>>>
> But of course it would be good to know what's going on here and why 
> this can happen.
>

>>> Must be unusual. I've been doing something similar for about two years 
>>> over various web2py versions (on windows and ubuntu) and haven't seen this 
>>> behaviour. 
>>>
>>

-- 
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: Session variables and multiple browser tabs

2016-02-19 Thread Jim S
Thanks for the reply.  However, I'm unclear on how I might use it 
effectively.

My scenario in my app:

I have a python object that I pass around to different pages.  At the end 
of each of my controller methods I do the following:

wo = Workorder(auth.user.id, workorder_id)


#  save to the session
session.workorder = cPickle.dumps(wo.to_dict())


Then, at the beginning of each controller method I do:

wo = Workorder(auth.user.id)
wo.from_dict(cPickle.loads(session.workorder))


So, with my limited javascript knowledge, I don't see how I'd be able to 
convert this to sessionstorage.  And actually, I don't know if what I'm 
doing with pickling/unpickling dicts is a smart thing to do.  If anyone has 
any pointers/comments, I'd appreciate it.  However, it seems as though I 
may need to rethink my strategy.

Thanks for taking a look.

-Jim


On Friday, February 19, 2016 at 2:45:05 AM UTC-6, Niphlod wrote:
>
> every browser considers tabs as belonging to the same session in regards 
> to cookies. there's no way to separate those using web2py code.
> you can leverage sessionstorage in javascript that keeps values alive - 
> and compartimentalized - to a single living tab.
>
> On Friday, February 19, 2016 at 4:56:21 AM UTC+1, Jim S wrote:
>>
>> Hi
>>
>> Is there a way to keep independent session variables between two open 
>> browser tabs?
>>
>> Example
>>
>> 1.  write a session variable in tab 2
>> 2.  switch to tab 1 and execute the same page setting the session 
>> variable to a different value
>> 3.  go back to tab 2 and request page that reads the session variable and 
>> gets the value set from tab 1
>>
>> Is there any way to force each tab to have it's own session variables?
>>
>> -Jim
>>
>

-- 
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: problem with sessions2trash.py

2016-02-19 Thread peter
Upgrading my web2py to the latest verision 2.13.4 did sort out the problem.

I used the automatic upgrade. This produced a ticket, but restarting web2py 
sorted this out.

Web2py's maintaining backwards compatability is great.

Peter

-- 
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: download pandas dataframe

2016-02-19 Thread Niphlod
you can write to stringIO and then serve it. Attention: using StringIO will 
consume memory, so a dataframe weighting 100MB will raise your's app memory 
to something in the range of 250MB or so for EVERY request of download 
(counting 100MB for the original dataframe, another 100MB or so for the 
stringio csv representation and 50megs of normal utilization). It'd be a 
lot better to store the contents on a temp file that you delete some time 
later if you can write to the disk and if the dataframes are "huge".

On Friday, February 19, 2016 at 10:34:35 AM UTC+1, Paolo Amboni wrote:
>
> I've a pandas dataframe that i want to download as a csv file.
> I know that i can output a dataframe to a csv file : 
> dataframe.to_scv(path,sep)
> But how can a user download his generated file?
> Should i write it in a static directory, perhaps with the username prefix?
> Is there a way to generate a virtual file to download?
> 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 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: What happens to these if I don't use link rel for css and js in default layout and use a new layout?

2016-02-19 Thread Niphlod
calendar just needs jquery.js, calendar.js and calendar.css 

On Friday, February 19, 2016 at 12:26:03 PM UTC+1, RAGHIB R wrote:
>
> I used both. Still what losses am I having?
>
> On Friday, February 19, 2016 at 2:47:42 PM UTC+5:30, Niphlod wrote:
>>
>> you need BOTH the js and the css file.
>>
>> On Friday, February 19, 2016 at 9:56:19 AM UTC+1, RAGHIB R wrote:
>>>
>>> For example I am not getting calendar even though I used its link rel by 
>>> putting css file under it. 
>>>
>>> On Friday, February 19, 2016 at 2:22:10 PM UTC+5:30, RAGHIB R wrote:

 1) form (will just design change or even the functionalities change)
 2) calender and ajax stuffs
 3) another changes?

>>>

-- 
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] For fastmail.com mail set up in web2py what should be mail.settings.server?

2016-02-19 Thread RAGHIB R
Please tell the thing I need to write there.

-- 
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: What happens to these if I don't use link rel for css and js in default layout and use a new layout?

2016-02-19 Thread RAGHIB R
I used both. Still what losses am I having?

On Friday, February 19, 2016 at 2:47:42 PM UTC+5:30, Niphlod wrote:
>
> you need BOTH the js and the css file.
>
> On Friday, February 19, 2016 at 9:56:19 AM UTC+1, RAGHIB R wrote:
>>
>> For example I am not getting calendar even though I used its link rel by 
>> putting css file under it. 
>>
>> On Friday, February 19, 2016 at 2:22:10 PM UTC+5:30, RAGHIB R wrote:
>>>
>>> 1) form (will just design change or even the functionalities change)
>>> 2) calender and ajax stuffs
>>> 3) another changes?
>>>
>>

-- 
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] download pandas dataframe

2016-02-19 Thread Paolo Amboni
I've a pandas dataframe that i want to download as a csv file.
I know that i can output a dataframe to a csv file : 
dataframe.to_scv(path,sep)
But how can a user download his generated file?
Should i write it in a static directory, perhaps with the username prefix?
Is there a way to generate a virtual file to download?
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 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: What happens to these if I don't use link rel for css and js in default layout and use a new layout?

2016-02-19 Thread Niphlod
you need BOTH the js and the css file.

On Friday, February 19, 2016 at 9:56:19 AM UTC+1, RAGHIB R wrote:
>
> For example I am not getting calendar even though I used its link rel by 
> putting css file under it. 
>
> On Friday, February 19, 2016 at 2:22:10 PM UTC+5:30, RAGHIB R wrote:
>>
>> 1) form (will just design change or even the functionalities change)
>> 2) calender and ajax stuffs
>> 3) another changes?
>>
>

-- 
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: What happens to these if I don't use link rel for css and js in default layout and use a new layout?

2016-02-19 Thread RAGHIB R
For example I am not getting calendar even though I used its link rel by 
putting css file under it. 

On Friday, February 19, 2016 at 2:22:10 PM UTC+5:30, RAGHIB R wrote:
>
> 1) form (will just design change or even the functionalities change)
> 2) calender and ajax stuffs
> 3) another changes?
>

-- 
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] What happens to these if I don't use link rel for css and js in default layout and use a new layout?

2016-02-19 Thread RAGHIB R
1) form (will just design change or even the functionalities change)
2) calender and ajax stuffs
3) another changes?

-- 
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: Session variables and multiple browser tabs

2016-02-19 Thread Niphlod
every browser considers tabs as belonging to the same session in regards to 
cookies. there's no way to separate those using web2py code.
you can leverage sessionstorage in javascript that keeps values alive - and 
compartimentalized - to a single living tab.

On Friday, February 19, 2016 at 4:56:21 AM UTC+1, Jim S wrote:
>
> Hi
>
> Is there a way to keep independent session variables between two open 
> browser tabs?
>
> Example
>
> 1.  write a session variable in tab 2
> 2.  switch to tab 1 and execute the same page setting the session variable 
> to a different value
> 3.  go back to tab 2 and request page that reads the session variable and 
> gets the value set from tab 1
>
> Is there any way to force each tab to have it's own session variables?
>
> -Jim
>

-- 
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] What will happen to these if I use the link rel for css and js from my layout and use a new layout?

2016-02-19 Thread RAGHIB R
1) form (will just design change or even the functionalities change)
2) calender and ajax stuffs
3) another changes?

-- 
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: Flash message if before_insert fail

2016-02-19 Thread Ivan Gazzola
Thx Anthony !

Il giorno giovedì 18 febbraio 2016 21:22:05 UTC+1, Anthony ha scritto:
>
> .. 
>
>
> db.poc.Name.requires = [IS_UPPER 
> (), CRYPT 
> (),
> IS_NOT_IN_DB(db(db.poc.Birthday == 
> request.vars.Birthday), 'poc.Name')]
>
>
>
I've tried but this doesn't work properly and adds duplicated data. I 
figured out  that is probably because I'm using CRYPT() and I get a 
LazyCrypt Object but IS_NOT_IN_DB expects a string

Where can'I find the source code for _before_insert?

 

> A few additional tips:
>
>
>- form.process() accepts a "message_onsuccess" argument, so you can 
>use that instead of checking if the form is accepted and explicitly 
> setting 
>response.flash.
>
> Tried and this prevent  "record added" message but I'm still unable to 
show a duplicate error message.


>- If your callback function already has the proper signature (i.e., 
>accepts the arguments that will be passed when called), there is no need 
> to 
>wrap it in a lambda. Just do 
>db.poc._before_insert.append(controlla_record).
>
> Good
 

>
>- If you want to determine whether a given value exists in a 
>particular database field, you should not loop through all the records in 
>Python but instead simply let the database do the work:
>
> if not db((db.poc.Birthday == dati.get("Birthday")) &
>   (db.poc.Name == CRYPT()(request.vars.get('Name', 
> '').upper())[0])).isempty():
> return 'error'
>
>
Got it ...
 

>  
>
>
>- If you are going to loop through a set of records, don't recalculate 
>the same value over and over inside the loop (i.e., in your callback, you 
>would move the transformation of the Name via CRYPT outside the loop, as 
>you only need to do it once).
>
>  Correct !




> Anthony
>
> On Thursday, February 18, 2016 at 12:13:55 PM UTC-5, Ivan Gazzola wrote:
>>
>> ### Controller for poc form
>>
>>
>> def insert_poc():
>> form=SQLFORM(db.poc)
>> if form.process().accepted:
>>response.flash = T('Record added')
>> return dict(form=form)
>>
>>
>> I've posted the full model, the function is colled in _before_insert:
>>
>> db.poc._before_insert.append(lambda dati: controlla_record(dati))
>>
>>
>> Il giorno giovedì 18 febbraio 2016 17:28:15 UTC+1, Anthony ha scritto:
>>
>> We need to see the full code, including the controller. In particular, 
>> you show a callback function, but you do not show where it is called.
>>
>> Anthony
>>
>> On Thursday, February 18, 2016 at 8:55:49 AM UTC-5, Ivan Gazzola wrote:
>>
>>
>> db.define_table('poc',
>> Field 
>> ('Name',required=True),
>> Field 
>> ('Birthday','date',widget=bsdatepicker_widget(),required=True),
>> Field 
>> ('Angle_Class_Dx',label=T 
>> ("Angle's Class Dx")),
>> Field 
>> ('Angle_Class_Sn',label=T 
>> ("Angle's Class Sn")),
>> Field 
>> ('Facial_Type'),
>> Field 
>> ('Overjet'),
>> Field 
>> ('Overbite'),
>> Field ('Sex'),
>> Field 
>> ('Ratial'),
>> Field 
>> ('Cot1','upload',required=True),
>> Field 
>> ('Cot2','upload'),
>> Field 
>> ('Cot3','upload'),
>> Field 
>> ('Clench','upload',required=True),
>> Field 
>> ('Chewing_dx','upload',required=True),
>> Field 
>> ('Chewing_sn','upload',required=True),
>> Field 
>> ('Lateral_Ceph','upload'),
>> Field 
>> ('Dental_Formula','text'),
>> auth.signature
>> )
>>
>>
>>
>> def controlla_record(dati):
>> nascite=db(db.poc.Birthday==dati.get("Birthday")).select()
>> for soggetto in nascite:
>> if CRYPT ()(request 
>> .vars.get("Name",'').upper())[0]==soggetto.Name:
>>   response.flash=T("Duplicate Records Not Allowed") 
>>   return "errore"
>>