[web2py] Re: from devel list

2013-09-26 Thread Gour
On Thu, 26 Sep 2013 14:40:54 -0700 (PDT)
Cliff Kachinske  wrote:

Hi Cliff,

> Gour,
> 
> Do you mean something like Drupal?

No, I mean Mezzanine (http://mezzanine.jupo.org/ &
http://cartridge.jupo.org/) based on Django framework which was created
and developed by a single guy.

THe project is, according to Bitbucket created on 2010-06-08 and it has,
according to github ~3k commits, 139 contributors, a337 stargazers,
impressive set of features and decent list of sites built with it
(http://mezzanine.jupo.org/sites/)

I know about the argument that Django is older and/or more mature than
web2py, but, according to the web2py site, the project had version 1.0
in 2007, and in comparison with Mezzanine, I believe it's old enough to
get some decent CMS enabling people to choose it as preferred platform
(instead of using WP, Joomla, Drupal...) for building *geneneral* web
sites which can be easily customized/tailored according to the client's
needs.

Mezzanine also has fair number of 3rd party add-ons
(https://github.com/stephenmcd/mezzanine) filling the potential gaps of
the core app.

Sometimes within the Django community it was heard that there are no
'general' CMS solutions 'cause it is too easy to build one from the
scratch.

Fortunately, such concept is not prevailing any longer and there are
several apps available: https://www.djangopackages.com/grids/g/cms/

If there is no value in abstracting some common features and make it
'general' CMS, then one can reason that there is no value to abstract
some tasks and make them into full-featured framework.

Shortly, my point is that at the moment web2py is filling specific niche
of being mostly used in intranet and/or smaller apps, but by having
general CMS/ecommerce app ala Mezzanine/Cartridge, the usage of the
framework could exponentially increase considering other 'pros' of the
framework.


Sincerely,
Gour

-- 
Thus the wise living entity's pure consciousness becomes covered by 
his eternal enemy in the form of lust, which is never satisfied and 
which burns like fire.

http://www.atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


-- 
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/groups/opt_out.


Re: [web2py] Re: batch script - best way to reopen a closed database connection?

2013-09-26 Thread Ricardo Cárdenas
@michele, @niphlod, @Derek

My solution oddly turned out to be a combination of all of your 
suggestions! :)

On Postgres, Michele's snippet below works for me too. On MySQL it works, 
but then raises an exception (attached below). Apparently, upon exit web2py 
tries to close the dead MySQL connection, and MySQL complains (even though 
the connection had no outstanding transactions). The PostgreSQL behavior 
seems different; web2py is silent when trying to close a dead connection 
with no outstanding transactions.

So I tried db._adapter.close() right after the db.commit(). That eliminated 
the MySQL exception. In fact, if there are no pending transactions, 
db._adapter.close() is all that is needed.

Problem solved for me. But I wonder whether the dev's might consider 
exposing an explicit db.close() and db.open() to avoid calling 
db._adapter.close() 
and then DAL(...auto_import=True), for the use case where a script does a 
lot of processing sans database, and then resumes database use.

Sorry if this was TL;DR for most people... best regards -Ricardo



Traceback (most recent call last):
  File "/home/rcardenas/web2py/gluon/shell.py", line 231, in run
BaseAdapter.close_all_instances('commit')
  File "/home/rcardenas/web2py/gluon/dal.py", line 560, in 
close_all_instances
db._adapter.close(action)
  File "/home/rcardenas/web2py/gluon/dal.py", line 540, in close
getattr(self, action)()
  File "/home/rcardenas/web2py/gluon/dal.py", line 1740, in commit
if self.connection: return self.connection.commit()
OperationalError: (2013, 'Lost connection to MySQL server during query')

Traceback (most recent call last):
  File "web2py.py", line 33, in 
gluon.widget.start(cron=True)
  File "/home/rcardenas/web2py/gluon/widget.py", line 1120, in start
import_models=options.import_models, startfile=options.run)
  File "/home/rcardenas/web2py/gluon/shell.py", line 235, in run
BaseAdapter.close_all_instances('rollback')
  File "/home/rcardenas/web2py/gluon/dal.py", line 560, in 
close_all_instances
db._adapter.close(action)
  File "/home/rcardenas/web2py/gluon/dal.py", line 540, in close
getattr(self, action)()
  File "/home/rcardenas/web2py/gluon/dal.py", line 1743, in rollback
if self.connection: return self.connection.rollback()
_mysql_exceptions.OperationalError: (2006, 'MySQL server has gone away')



On Wednesday, September 25, 2013 8:36:01 AM UTC-5, Michele Comitini wrote:
>
>  
>
> -- Forwarded message --
> From: Michele Comitini >
> Date: 2013/9/25
> Subject: Re: [web2py] Re: batch script - best way to reopen a closed 
> database connection?
> To: Ricardo Cárdenas 
>
> Try using the auto_import
>
> see the following:
>
> db.commit()
> sleep(20) # <-- here I stop and restart the postgresql service
> db=DAL('postgres://script:script@localhost/script',pool_size=1, 
> check_reserved=['all'], auto_import=True)
> print db(db.people).count()
>
>
>
> 2013/9/25 Ricardo Cárdenas >
>
>> Hi Michele, you're right, it's better to instantiate the connection when 
>> needed.
>>
>>  Since I have all the DAL() and define_tables() calls in db.py, I 
>> shouldn't have to rewrite the code elsewhere. I tried "import db" after the 
>> wait, but I guess it's not possible to import models/* because I got an 
>> import error. How do you suggest I implement your suggestion?
>>
>> thanks -Ricardo
>>
>> On Wednesday, September 25, 2013 4:50:38 AM UTC-5, Michele Comitini wrote:
>>
>>> Yes, but the connection in the pool will get dropped anyway.  After some 
>>> thought IMHO the correct way for you to fix the problem is:
>>> 
>>> ...wait...wait...
>>> db = DAL(...) 
>>> 
>>> db.commit() #<- commit or rollback as soon as possible
>>> ...wait...wait...
>>> db = DAL(...) 
>>> 
>>> db.commit() #<- commit or rollback as soon as possible
>>> 
>>>
>>> i.e. init the db instance right before using it.  This should avoid 
>>> timing out connections, with consequent data loss.  
>>> It fixes also the problem that keeping transactions open for such a long 
>>> time is no good for anything else trying to work on that database it could 
>>> cause all other connections/applications to stop until the transaction is 
>>> closed or timedout!
>>>
>>>
>>> 2013/9/25 Ricardo Cárdenas 
>>>
>>> @michele - No, I'm not doing a db.commit() -- because I don't use the db 
 connection at all, until many minutes later, when it fails.

 However, you bring up an interesting point. Does this mean that if I 
 db.commit() at the very beginning of my script (even if there is no 
 outstanding transaction), I will in effect be pushing a connection to 
 sleep?

 Ricardo


 On Tuesday, September 24, 2013 5:16:20 PM UTC-5, Michele Comitini wrote:

> Did you remember to do a commit at each round?
>
> A long running script / daemon can do:
>
> db=DAL...
> 
>
> while True:
>
>db.commit()
>sleep(1000) # <- just for exampl i.e. do

Re: [web2py] Re: Error in SQLFORM.grid after updating to Version 2.6.4-stable+timestamp.2013.06.26.11.24.52

2013-09-26 Thread Massimo Di Pierro
Thanks for checking this. It was a small but critical change.

On Thursday, 26 September 2013 14:12:26 UTC-5, Jim S wrote:
>
> Works now.   Thanks for the prompt response.
>
> -Jim
>
>
> On Thu, Sep 26, 2013 at 2:10 PM, Massimo Di Pierro 
> 
> > wrote:
>
>> Please try once more.
>>
>>
>> On Thursday, 26 September 2013 13:55:47 UTC-5, Jim S wrote:
>>
>>> I just did a hg pull from 
>>> https://code.google.com/p/**web2pyand got 
>>> no changes found.
>>>
>>>
>>> On Thu, Sep 26, 2013 at 1:36 PM, Massimo Di Pierro <
>>> massimo@gmail.com> wrote:
>>>
 The problem is not the grid. We are working on a new feature and it 
 will break existing sessions. 
 I just committed a change to trunk that should fix the problem.

 massimo


 On Thursday, 26 September 2013 11:55:51 UTC-5, Jim S wrote:
>
> All of my SQLFORM.grids are failing when I click on the EDIT button 
> with this traceback, pointing to sqlform.html.  Add's fail as well.
>
> Traceback (most recent call last):
>   File "C:\dev\web2py\gluon\**restricte**d.py", line 217, in restricted
>
>
> exec ccode in environment
>   File 
> "C:/dev/web2py/applications/**si**deboard/controllers/**maintenanc**e.py" 
> ,
>  line 1245, in 
>
>
>   File "C:\dev\web2py\gluon\globals.**p**y", line 372, in 
>
>
> self._caller = lambda f: f()
>
>
>   File "C:\dev\web2py\gluon\tools.py", line 3235, in f
>
>
> return action(*a, **b)
>   File 
> "C:/dev/web2py/applications/**si**deboard/controllers/**maintenanc**e.py" 
> ,
>  line 1237, in tickets
>
>
> paginate=linesPerPage, maxtextlength=45,)
>
>
>   File "C:\dev\web2py\gluon\sqlhtml.**p**y", line 2038, in grid
>
>
> next=referrer)
>   File "C:\dev\web2py\gluon\html.py", line 2215, in process
>
>
> self.validate(**kwargs)
>   File "C:\dev\web2py\gluon\html.py", line 2154, in validate
>
>
> if self.accepts(**kwargs):
>   File "C:\dev\web2py\gluon\sqlhtml.**p**y", line 1324, in accepts
>
>
> **kwargs
>   File "C:\dev\web2py\gluon\html.py", line 2024, in accepts
>
>
> if not formkeys or formkey not in formkeys:
>
> TypeError: 'in ' requires string as left operand, not NoneType
>
>
> -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/e9tGCO9T70A/**unsubscribe
 .
  To unsubscribe from this group and all its topics, send an email to 
 web2py+un...@**googlegroups.com.

 For more options, visit 
 https://groups.google.com/**groups/opt_out
 .

>>>
>>>  -- 
>> 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/e9tGCO9T70A/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: How can I give google map javascript api marker title a suitably encoded string?

2013-09-26 Thread Christian Foster Howes
Niphlod is most likely right herei do so much on google app engine 
where their version JSON is faster since i can't upload a custom c lib.


thanks for the correction!

cfh

On 9/26/13 15:04 , Niphlod wrote:

simplejson is always faster, make sure it's upgraded with pip
install --upgrade simplejson

On Thursday, September 26, 2013 11:50:18 PM UTC+2, Christian Foster Howes
wrote:


i agree that if the data is from user input you want to make sure it is
escaped.  the JSON might work for you.  one tip - if you are using
python 2.7 it comes with a json lib (import json) that is written in c
and probably faster then simplejson.

cfh






--
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/groups/opt_out.


Re: [web2py] Re: How can I give google map javascript api marker title a suitably encoded string?

2013-09-26 Thread Niphlod
simplejson is always faster, make sure it's upgraded with pip 
install --upgrade simplejson

On Thursday, September 26, 2013 11:50:18 PM UTC+2, Christian Foster Howes 
wrote:
>
> i agree that if the data is from user input you want to make sure it is 
> escaped.  the JSON might work for you.  one tip - if you are using 
> python 2.7 it comes with a json lib (import json) that is written in c 
> and probably faster then simplejson. 
>
> cfh 
>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: Deploy on Apache with psycopg2

2013-09-26 Thread ewong1111
Oh and just to clarify, I know I can't just plop over my python with 
psycopg2 folder somewhere else--it's already part of a packagish thingy 
that can be easily built/installed in each network.

On Thursday, September 26, 2013 2:45:10 PM UTC-7, ewon...@gmail.com wrote:

>  Aw poo, there's no easier way to do this?  I'm using suse btw.
>  
> The difficulties are that I would need to get virtualenv approved first, 
> which would definitely not happen until after my deadline.
>  
> I also thought about asking them to just install psycopg2 but that could 
> also take a long time and additionally I may have to deploy this on other 
> networks.  So I was hoping I could just transfer over my web2py and python 
> (with psycopg2) folders to future networks.  Otherwise, I would need to 
> wait for them to install psycopg2 on every network I want to deploy to.
>  
>
> On Thursday, September 26, 2013 1:59:39 PM UTC-7, Richard wrote:
>
>> Yeah I would suggest also virtualenv if you did that yourself (python dir 
>> stuff)... virtualenv are exactly to manage differents environnements for 
>> differents projects : 
>>
>> http://simononsoftware.com/virtualenv-tutorial/
>> http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
>>
>> From accepted answer : 
>> http://stackoverflow.com/questions/5844869/comprehensive-beginners-virtualenv-tutorial
>>
>> Richard
>>
>>
>> On Thu, Sep 26, 2013 at 4:30 PM, Cliff Kachinske wrote:
>>
>>> What distro? They're all different.
>>>
>>> Can you ask the admin to install psycopg2? If (s)he does it psycopg2 
>>> will probably go into the proper site-packages directory.
>>>
>>> You might also look into virtualenv. 
>>>  
>>>
>>> On Thursday, September 26, 2013 3:39:27 PM UTC-4, ewon...@gmail.comwrote: 

  Hi,
 How can I get my web2py deployed on apache to use psycopg2 (on linux)?
  
 My "default" python does not have psycopg2 installed.  However, I have 
 a separate directory containing python with psycopg2 installed.  I got it 
 working when I developed on the Rocket server by adding this directory to 
 my path prior to starting up web2py.  But for the deployment on apache, I 
 am not the one who starts up the server/web2py so *I* cannot add the 
 directory to the path prior to its launch.  Do you have any suggestions of 
 what to do?

>>>  -- 
>>> 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/groups/opt_out.
>>>
>>
>>

-- 
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/groups/opt_out.


Re: [web2py] Re: How can I give google map javascript api marker title a suitably encoded string?

2013-09-26 Thread Christian Foster Howes
i agree that if the data is from user input you want to make sure it is 
escaped.  the JSON might work for you.  one tip - if you are using 
python 2.7 it comes with a json lib (import json) that is written in c 
and probably faster then simplejson.


cfh

On 9/26/13 14:37 , User wrote:

Looking online people seem to suggest json encoding.  So what I'm doing now
is

def view():
 import gluon.contrib.simplejson.encoder
 myobject = db(db.objects.id == request.args(0)).select().first()
 myobject.nameJson = gluon.contrib.simplejson.encoder.encode_basestring(
myobject.name)
 return dict(myobject=myobject)


(Not sure if that's the correction json method to use) And then in the view
using XML as suggested by Christian.  This seems to properly escape
embedded quotes.  However as I am new to web2py I would appreciate others
input about the correctness of this.


On Thursday, September 26, 2013 5:14:40 PM UTC-4, User wrote:


Yes I by viewing source I could see that generated javascript string had
the character entity in it, so I knew the question was how to get web2py to
output it correctly.  Using XML works! thank you. By using XML the
generated string becomes "John's Place"

My next question is why? And is it still safe from user injected code?  At
first glance it looks like someone could possibly inject something (
myobject.name ultimately comes from user input).  Maybe I can just strip
out double quotes to make sure they can't close the string?

On Thursday, September 26, 2013 12:02:55 PM UTC-4, Christian Foster Howes
wrote:


can you use an inspector to see the actual generated javascript?  it's
possible that web2py is escaping the apostrophe.  you can try {{=XML(
myobject.name)}}

On Tuesday, September 24, 2013 5:26:29 PM UTC-7, User wrote:


I'm using the google map javascript api (v3). I have a google map in one
of my views.  I want to display the location name as the marker title (used
when hovering over the marker).  I'm using the following code in my view:

{{block head}}

 function init_map() {
 var myLatlng = new google.maps.LatLng({{=myobject.lat}}, {{=
myobject.lng}});
 var mapOptions = {
 center: myLatlng,
 zoom: 12,
 mapTypeId: google.maps.MapTypeId.ROADMAP
 };
 var map = new google.maps.Map(document.getElementById(
"map-canvas"),
 mapOptions);
 var marker = new google.maps.Marker({
 position: myLatlng,
 map: map,
 title: "{{=myobject.name}}"
 });
 }
 google.maps.event.addDomListener(window, 'load', init_map);

{{end}}



This works to output a map but when I mouse over the marker, the
character encoding is not right.  For example, if  myobject.namecontains the string 
"John's Place" then the marker tooltip will literally
display "John's Place" (that is, with the ampersand and hash).  How
can I get it to display the string as "John's Place" in a web safe manner?










--
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/groups/opt_out.


Re: [web2py] Re: Deploy on Apache with psycopg2

2013-09-26 Thread ewong1111
Aw poo, there's no easier way to do this?  I'm using suse btw.
 
The difficulties are that I would need to get virtualenv approved first, 
which would definitely not happen until after my deadline.
 
I also thought about asking them to just install psycopg2 but that could 
also take a long time and additionally I may have to deploy this on other 
networks.  So I was hoping I could just transfer over my web2py and python 
(with psycopg2) folders to future networks.  Otherwise, I would need to 
wait for them to install psycopg2 on every network I want to deploy to.
 

On Thursday, September 26, 2013 1:59:39 PM UTC-7, Richard wrote:

> Yeah I would suggest also virtualenv if you did that yourself (python dir 
> stuff)... virtualenv are exactly to manage differents environnements for 
> differents projects : 
>
> http://simononsoftware.com/virtualenv-tutorial/
> http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
>
> From accepted answer : 
> http://stackoverflow.com/questions/5844869/comprehensive-beginners-virtualenv-tutorial
>
> Richard
>
>
> On Thu, Sep 26, 2013 at 4:30 PM, Cliff Kachinske 
> 
> > wrote:
>
>> What distro? They're all different.
>>
>> Can you ask the admin to install psycopg2? If (s)he does it psycopg2 will 
>> probably go into the proper site-packages directory.
>>
>> You might also look into virtualenv. 
>>  
>>
>> On Thursday, September 26, 2013 3:39:27 PM UTC-4, ewon...@gmail.comwrote: 
>>>
>>>  Hi,
>>> How can I get my web2py deployed on apache to use psycopg2 (on linux)?
>>>  
>>> My "default" python does not have psycopg2 installed.  However, I have a 
>>> separate directory containing python with psycopg2 installed.  I got it 
>>> working when I developed on the Rocket server by adding this directory to 
>>> my path prior to starting up web2py.  But for the deployment on apache, I 
>>> am not the one who starts up the server/web2py so *I* cannot add the 
>>> directory to the path prior to its launch.  Do you have any suggestions of 
>>> what to do?
>>>
>>  -- 
>> 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/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.


[web2py] Re: from devel list (was Re: [web2py-dev] Here they come...)

2013-09-26 Thread Cliff Kachinske
Gour,

Do you mean something like Drupal?

On Thursday, September 26, 2013 2:49:38 PM UTC-4, Gour wrote:
>
> On Tue, 24 Sep 2013 07:39:40 -0500 
> Massimo DiPierro 
> > wrote: 
>
> > I posted a comment. It is a good sign that they are worried. They 
> > should be. ;-)   
>
> Not to clutter dev list, I'm replying here on the comment which was 
> posted recently on Quora... 
>
> (http://www.quora.com/Wei-Wei-1/Posts/10-reasons-not-to-use-web2py) 
>
> At the moment I am working on the Real Python for the Web course which 
> covers from the very basic stuff over Flask to full-featured frameworks 
> like web2py & Django. 
>
> Moreover, I agree with all the advantages of web2py over Django 
> mentioned in the comments, but, imho, if web2py wants to get *much* more 
> popular then it needs something like Mezzanine/Cartridge which allows 
> new category of users to build web site(s) quickly with most of the 
> required features shipping out of the box...yes, I'm the one not wanting 
> to roll yet another CMS. ;) 
>
>
> Sincerely, 
> Gour 
>
>
> -- 
> He is a perfect yogī who, by comparison to his own self, 
> sees the true equality of all beings, in both their 
> happiness and their distress, O Arjuna! 
>
> http://www.atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 
>
>
>

-- 
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/groups/opt_out.


[web2py] Re: How can I give google map javascript api marker title a suitably encoded string?

2013-09-26 Thread User
Looking online people seem to suggest json encoding.  So what I'm doing now 
is
 
def view():
import gluon.contrib.simplejson.encoder
myobject = db(db.objects.id == request.args(0)).select().first()
myobject.nameJson = gluon.contrib.simplejson.encoder.encode_basestring(
myobject.name)
return dict(myobject=myobject) 


(Not sure if that's the correction json method to use) And then in the view 
using XML as suggested by Christian.  This seems to properly escape 
embedded quotes.  However as I am new to web2py I would appreciate others 
input about the correctness of this.
 

On Thursday, September 26, 2013 5:14:40 PM UTC-4, User wrote:

> Yes I by viewing source I could see that generated javascript string had 
> the character entity in it, so I knew the question was how to get web2py to 
> output it correctly.  Using XML works! thank you. By using XML the 
> generated string becomes "John's Place"
>  
> My next question is why? And is it still safe from user injected code?  At 
> first glance it looks like someone could possibly inject something (
> myobject.name ultimately comes from user input).  Maybe I can just strip 
> out double quotes to make sure they can't close the string?
>
> On Thursday, September 26, 2013 12:02:55 PM UTC-4, Christian Foster Howes 
> wrote:
>
>> can you use an inspector to see the actual generated javascript?  it's 
>> possible that web2py is escaping the apostrophe.  you can try {{=XML(
>> myobject.name)}}
>>
>> On Tuesday, September 24, 2013 5:26:29 PM UTC-7, User wrote:
>>>
>>> I'm using the google map javascript api (v3). I have a google map in one 
>>> of my views.  I want to display the location name as the marker title (used 
>>> when hovering over the marker).  I'm using the following code in my view:
>>>  
>>> {{block head}}
>>> 
>>> function init_map() {
>>> var myLatlng = new google.maps.LatLng({{=myobject.lat}}, {{=
>>> myobject.lng}});
>>> var mapOptions = {
>>> center: myLatlng,
>>> zoom: 12,
>>> mapTypeId: google.maps.MapTypeId.ROADMAP
>>> };
>>> var map = new google.maps.Map(document.getElementById(
>>> "map-canvas"),
>>> mapOptions);
>>> var marker = new google.maps.Marker({
>>> position: myLatlng,
>>> map: map,
>>> title: "{{=myobject.name}}"
>>> });
>>> }
>>> google.maps.event.addDomListener(window, 'load', init_map);
>>> 
>>> {{end}}
>>>
>>>
>>>  
>>> This works to output a map but when I mouse over the marker, the 
>>> character encoding is not right.  For example, if  myobject.namecontains 
>>> the string "John's Place" then the marker tooltip will literally 
>>> display "John's Place" (that is, with the ampersand and hash).  How 
>>> can I get it to display the string as "John's Place" in a web safe manner?
>>>  
>>>
>>>  
>>>
>>

-- 
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/groups/opt_out.


[web2py] Re: How can I give google map javascript api marker title a suitably encoded string?

2013-09-26 Thread User
Yes I by viewing source I could see that generated javascript string had 
the character entity in it, so I knew the question was how to get web2py to 
output it correctly.  Using XML works! thank you. By using XML the 
generated string becomes "John's Place"
 
My next question is why? And is it still safer from user injected code?  At 
first glance it looks like someone could possibly inject something 
(myobject.name ultimately comes from user input).  Maybe I can just strip 
out double quotes to make sure they can't close the string?

On Thursday, September 26, 2013 12:02:55 PM UTC-4, Christian Foster Howes 
wrote:

> can you use an inspector to see the actual generated javascript?  it's 
> possible that web2py is escaping the apostrophe.  you can try {{=XML(
> myobject.name)}}
>
> On Tuesday, September 24, 2013 5:26:29 PM UTC-7, User wrote:
>>
>> I'm using the google map javascript api (v3). I have a google map in one 
>> of my views.  I want to display the location name as the marker title (used 
>> when hovering over the marker).  I'm using the following code in my view:
>>  
>> {{block head}}
>> 
>> function init_map() {
>> var myLatlng = new google.maps.LatLng({{=myobject.lat}}, {{=
>> myobject.lng}});
>> var mapOptions = {
>> center: myLatlng,
>> zoom: 12,
>> mapTypeId: google.maps.MapTypeId.ROADMAP
>> };
>> var map = new google.maps.Map(document.getElementById(
>> "map-canvas"),
>> mapOptions);
>> var marker = new google.maps.Marker({
>> position: myLatlng,
>> map: map,
>> title: "{{=myobject.name}}"
>> });
>> }
>> google.maps.event.addDomListener(window, 'load', init_map);
>> 
>> {{end}}
>>
>>
>>  
>> This works to output a map but when I mouse over the marker, the 
>> character encoding is not right.  For example, if  myobject.namecontains the 
>> string "John's Place" then the marker tooltip will literally 
>> display "John's Place" (that is, with the ampersand and hash).  How 
>> can I get it to display the string as "John's Place" in a web safe manner?
>>  
>>
>>  
>>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: Error trying to view Errors for my app

2013-09-26 Thread Niphlod
login remotely and 
cd applications/appname/errors
rm *

or just go into the main page of admin, click on the button next to the app 
and press clean (although it will clean also sessions)

On Thursday, September 26, 2013 10:48:22 PM UTC+2, Jim S wrote:
>
> I wasn't trying to display the error, just the list of errors.  Would that 
> make a difference?  I'm assuming that this will be fixed.  Is there a way I 
> can clear all my errors without using the console?
>
>
> On Thu, Sep 26, 2013 at 3:43 PM, Niphlod  >wrote:
>
>> this is due to a new web2py trying to open an error generated with an old 
>> web2py.
>>
>>
>> On Thursday, September 26, 2013 10:29:08 PM UTC+2, Jim S wrote:
>>>
>>> Went here:  
>>> http://127.0.0.1:8000/admin/**default/errors/sideboard
>>>
>>> to see the errors in my app (sideboard) but the attached traceback.
>>>
>>> -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/LPbKbWHMjgY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: Deploy on Apache with psycopg2

2013-09-26 Thread Richard Vézina
Yeah I would suggest also virtualenv if you did that yourself (python dir
stuff)... virtualenv are exactly to manage differents environnements for
differents projects :

http://simononsoftware.com/virtualenv-tutorial/
http://iamzed.com/2009/05/07/a-primer-on-virtualenv/

>From accepted answer :
http://stackoverflow.com/questions/5844869/comprehensive-beginners-virtualenv-tutorial

Richard


On Thu, Sep 26, 2013 at 4:30 PM, Cliff Kachinske  wrote:

> What distro? They're all different.
>
> Can you ask the admin to install psycopg2? If (s)he does it psycopg2 will
> probably go into the proper site-packages directory.
>
> You might also look into virtualenv.
>
>
> On Thursday, September 26, 2013 3:39:27 PM UTC-4, ewon...@gmail.com wrote:
>>
>> Hi,
>> How can I get my web2py deployed on apache to use psycopg2 (on linux)?
>>
>> My "default" python does not have psycopg2 installed.  However, I have a
>> separate directory containing python with psycopg2 installed.  I got it
>> working when I developed on the Rocket server by adding this directory to
>> my path prior to starting up web2py.  But for the deployment on apache, I
>> am not the one who starts up the server/web2py so *I* cannot add the
>> directory to the path prior to its launch.  Do you have any suggestions of
>> what to do?
>>
>  --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.


Re: [web2py] Re: from devel list (was Re: [web2py-dev] Here they come...)

2013-09-26 Thread António Ramos
*- web2py's user base is so small comparing with Django and Rails, if you
stuck with some issue it is really hard to get community  help.*
*
*
*I think this guy never registered with us. *



*
*

*
*


2013/9/26 Massimo Di Pierro 

> +1
>
>
> On Thursday, 26 September 2013 13:49:38 UTC-5, Gour wrote:
>
>> On Tue, 24 Sep 2013 07:39:40 -0500
>> Massimo DiPierro
>>  wrote:
>>
>> > I posted a comment. It is a good sign that they are worried. They
>> > should be. ;-)
>>
>> Not to clutter dev list, I'm replying here on the comment which was
>> posted recently on Quora...
>>
>> (http://www.quora.com/Wei-Wei-**1/Posts/10-reasons-not-to-use-**web2py)
>>
>>
>> At the moment I am working on the Real Python for the Web course which
>> covers from the very basic stuff over Flask to full-featured frameworks
>> like web2py & Django.
>>
>> Moreover, I agree with all the advantages of web2py over Django
>> mentioned in the comments, but, imho, if web2py wants to get *much* more
>> popular then it needs something like Mezzanine/Cartridge which allows
>> new category of users to build web site(s) quickly with most of the
>> required features shipping out of the box...yes, I'm the one not wanting
>> to roll yet another CMS. ;)
>>
>>
>> Sincerely,
>> Gour
>>
>>
>> --
>> He is a perfect yogī who, by comparison to his own self,
>> sees the true equality of all beings, in both their
>> happiness and their distress, O Arjuna!
>>
>> http://www.atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810
>>
>>
>>  --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.


Re: [web2py] Re: Error trying to view Errors for my app

2013-09-26 Thread Jim Steil
I wasn't trying to display the error, just the list of errors.  Would that
make a difference?  I'm assuming that this will be fixed.  Is there a way I
can clear all my errors without using the console?


On Thu, Sep 26, 2013 at 3:43 PM, Niphlod  wrote:

> this is due to a new web2py trying to open an error generated with an old
> web2py.
>
>
> On Thursday, September 26, 2013 10:29:08 PM UTC+2, Jim S wrote:
>>
>> Went here:  
>> http://127.0.0.1:8000/admin/**default/errors/sideboard
>>
>> to see the errors in my app (sideboard) but the attached traceback.
>>
>> -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/LPbKbWHMjgY/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/groups/opt_out.
>

-- 
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/groups/opt_out.


[web2py] Re: Error trying to view Errors for my app

2013-09-26 Thread Niphlod
this is due to a new web2py trying to open an error generated with an old 
web2py.

On Thursday, September 26, 2013 10:29:08 PM UTC+2, Jim S wrote:
>
> Went here:  http://127.0.0.1:8000/admin/default/errors/sideboard
>
> to see the errors in my app (sideboard) but the attached traceback.
>
> -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/groups/opt_out.


[web2py] Re: Deploy on Apache with psycopg2

2013-09-26 Thread Cliff Kachinske
What distro? They're all different.

Can you ask the admin to install psycopg2? If (s)he does it psycopg2 will 
probably go into the proper site-packages directory.

You might also look into virtualenv. 


On Thursday, September 26, 2013 3:39:27 PM UTC-4, ewon...@gmail.com wrote:
>
> Hi,
> How can I get my web2py deployed on apache to use psycopg2 (on linux)?
>  
> My "default" python does not have psycopg2 installed.  However, I have a 
> separate directory containing python with psycopg2 installed.  I got it 
> working when I developed on the Rocket server by adding this directory to 
> my path prior to starting up web2py.  But for the deployment on apache, I 
> am not the one who starts up the server/web2py so *I* cannot add the 
> directory to the path prior to its launch.  Do you have any suggestions of 
> what to do?
>

-- 
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/groups/opt_out.


Re: [web2py] Deploy on Apache with psycopg2

2013-09-26 Thread ewong1111
I mean that when I log onto the system and do
>which python
/usr/bin/python
 
This /usr/bin/python does not have psycopg2 installed
 
However I have a
/usr/blah/blah/blah/bin/python and this one does have psycopg2 installed.  
 
What I was doing during development was adding 
/usr/blah/blah/blah/bin/python to the beginning of my path and then 
launching web2py.  So then web2py would use my 
/usr/blah/blah/blah/bin/python with psycopg2 instead of using the default 
/usr/bin/python (which does not have psycopg2)
 
 
On Thursday, September 26, 2013 12:44:37 PM UTC-7, Richard wrote:

> what do you mean by separate directory?  
>
> You can have look in web2py/scripts there is various script to help in 
> installing web2py and it requirement for faster deployment.
>
> Richard
>
>
> On Thu, Sep 26, 2013 at 3:39 PM, > wrote:
>
>>  Hi,
>> How can I get my web2py deployed on apache to use psycopg2 (on linux)?
>>  
>> My "default" python does not have psycopg2 installed.  However, I have a 
>> separate directory containing python with psycopg2 installed.  I got it 
>> working when I developed on the Rocket server by adding this directory to 
>> my path prior to starting up web2py.  But for the deployment on apache, I 
>> am not the one who starts up the server/web2py so *I* cannot add the 
>> directory to the path prior to its launch.  Do you have any suggestions of 
>> what to do?
>>
>> -- 
>> 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/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.


Re: [web2py] Deploy on Apache with psycopg2

2013-09-26 Thread Richard Vézina
what do you mean by separate directory?

You can have look in web2py/scripts there is various script to help in
installing web2py and it requirement for faster deployment.

Richard


On Thu, Sep 26, 2013 at 3:39 PM,  wrote:

> Hi,
> How can I get my web2py deployed on apache to use psycopg2 (on linux)?
>
> My "default" python does not have psycopg2 installed.  However, I have a
> separate directory containing python with psycopg2 installed.  I got it
> working when I developed on the Rocket server by adding this directory to
> my path prior to starting up web2py.  But for the deployment on apache, I
> am not the one who starts up the server/web2py so *I* cannot add the
> directory to the path prior to its launch.  Do you have any suggestions of
> what to do?
>
> --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.


[web2py] Deploy on Apache with psycopg2

2013-09-26 Thread ewong1111
Hi,
How can I get my web2py deployed on apache to use psycopg2 (on linux)?
 
My "default" python does not have psycopg2 installed.  However, I have a 
separate directory containing python with psycopg2 installed.  I got it 
working when I developed on the Rocket server by adding this directory to 
my path prior to starting up web2py.  But for the deployment on apache, I 
am not the one who starts up the server/web2py so *I* cannot add the 
directory to the path prior to its launch.  Do you have any suggestions of 
what to do?

-- 
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/groups/opt_out.


Re: [web2py] Re: Error in SQLFORM.grid after updating to Version 2.6.4-stable+timestamp.2013.06.26.11.24.52

2013-09-26 Thread Jim Steil
Works now.   Thanks for the prompt response.

-Jim


On Thu, Sep 26, 2013 at 2:10 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> Please try once more.
>
>
> On Thursday, 26 September 2013 13:55:47 UTC-5, Jim S wrote:
>
>> I just did a hg pull from 
>> https://code.google.com/p/**web2pyand got 
>> no changes found.
>>
>>
>> On Thu, Sep 26, 2013 at 1:36 PM, Massimo Di Pierro > > wrote:
>>
>>> The problem is not the grid. We are working on a new feature and it will
>>> break existing sessions.
>>> I just committed a change to trunk that should fix the problem.
>>>
>>> massimo
>>>
>>>
>>> On Thursday, 26 September 2013 11:55:51 UTC-5, Jim S wrote:

 All of my SQLFORM.grids are failing when I click on the EDIT button
 with this traceback, pointing to sqlform.html.  Add's fail as well.

 Traceback (most recent call last):
   File "C:\dev\web2py\gluon\**restricte**d.py", line 217, in restricted

 exec ccode in environment
   File 
 "C:/dev/web2py/applications/**si**deboard/controllers/**maintenanc**e.py" 
 ,
  line 1245, in 

   File "C:\dev\web2py\gluon\globals.**p**y", line 372, in 

 self._caller = lambda f: f()

   File "C:\dev\web2py\gluon\tools.py", line 3235, in f

 return action(*a, **b)
   File 
 "C:/dev/web2py/applications/**si**deboard/controllers/**maintenanc**e.py" 
 ,
  line 1237, in tickets

 paginate=linesPerPage, maxtextlength=45,)

   File "C:\dev\web2py\gluon\sqlhtml.**p**y", line 2038, in grid

 next=referrer)
   File "C:\dev\web2py\gluon\html.py", line 2215, in process

 self.validate(**kwargs)
   File "C:\dev\web2py\gluon\html.py", line 2154, in validate

 if self.accepts(**kwargs):
   File "C:\dev\web2py\gluon\sqlhtml.**p**y", line 1324, in accepts

 **kwargs
   File "C:\dev\web2py\gluon\html.py", line 2024, in accepts

 if not formkeys or formkey not in formkeys:
 TypeError: 'in ' requires string as left operand, not NoneType


 -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/e9tGCO9T70A/**unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> web2py+un...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>
>>  --
> 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/e9tGCO9T70A/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/groups/opt_out.
>

-- 
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/groups/opt_out.


[web2py] Re: from devel list (was Re: [web2py-dev] Here they come...)

2013-09-26 Thread Massimo Di Pierro
+1

On Thursday, 26 September 2013 13:49:38 UTC-5, Gour wrote:
>
> On Tue, 24 Sep 2013 07:39:40 -0500 
> Massimo DiPierro 
> > wrote: 
>
> > I posted a comment. It is a good sign that they are worried. They 
> > should be. ;-)   
>
> Not to clutter dev list, I'm replying here on the comment which was 
> posted recently on Quora... 
>
> (http://www.quora.com/Wei-Wei-1/Posts/10-reasons-not-to-use-web2py) 
>
> At the moment I am working on the Real Python for the Web course which 
> covers from the very basic stuff over Flask to full-featured frameworks 
> like web2py & Django. 
>
> Moreover, I agree with all the advantages of web2py over Django 
> mentioned in the comments, but, imho, if web2py wants to get *much* more 
> popular then it needs something like Mezzanine/Cartridge which allows 
> new category of users to build web site(s) quickly with most of the 
> required features shipping out of the box...yes, I'm the one not wanting 
> to roll yet another CMS. ;) 
>
>
> Sincerely, 
> Gour 
>
>
> -- 
> He is a perfect yogī who, by comparison to his own self, 
> sees the true equality of all beings, in both their 
> happiness and their distress, O Arjuna! 
>
> http://www.atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810 
>
>
>

-- 
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/groups/opt_out.


[web2py] Re: Field datetime default to something besides request.now/utcnow?

2013-09-26 Thread Niphlod
if you set them on the db, then there's no need to use Field(, 
default=request.now, update=request.now) . Of course if you use them in 
Fields, then the one on the backend won't work 'cause web2py will send them 
explicitely when constructing the update or the insert related query.

On Wednesday, September 25, 2013 9:27:04 PM UTC+2, Tom H wrote:
>
> Hi,
>
> Quick question: I'd like to use the backend database functions for setting 
> the datetime defaults, for columns like created_on and modified_on
>
> I'm assuming web2py is using the timestamps in the request objects to do 
> it client side as part of inserts/updates, instead of the db server setting 
> it to something like getdate() function values, is that correct?  is there 
> a workaround?
>
> Thanks,
>
> Tom
>
> PS, Sorry if it's been posted, I've actually skimmed through a whole bunch 
> of threads and the book and couldn't find an answer, maybe someone know off 
> the top of their head.
>
>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: Error in SQLFORM.grid after updating to Version 2.6.4-stable+timestamp.2013.06.26.11.24.52

2013-09-26 Thread Massimo Di Pierro
Please try once more.

On Thursday, 26 September 2013 13:55:47 UTC-5, Jim S wrote:
>
> I just did a hg pull from https://code.google.com/p/web2py and got no 
> changes found.
>
>
> On Thu, Sep 26, 2013 at 1:36 PM, Massimo Di Pierro 
> 
> > wrote:
>
>> The problem is not the grid. We are working on a new feature and it will 
>> break existing sessions. 
>> I just committed a change to trunk that should fix the problem.
>>
>> massimo
>>
>>
>> On Thursday, 26 September 2013 11:55:51 UTC-5, Jim S wrote:
>>>
>>> All of my SQLFORM.grids are failing when I click on the EDIT button with 
>>> this traceback, pointing to sqlform.html.  Add's fail as well.
>>>
>>> Traceback (most recent call last):
>>>   File "C:\dev\web2py\gluon\**restricted.py", line 217, in restricted
>>>
>>> exec ccode in environment
>>>   File 
>>> "C:/dev/web2py/applications/**sideboard/controllers/**maintenance.py" 
>>> ,
>>>  line 1245, in 
>>>
>>>   File "C:\dev\web2py\gluon\globals.**py", line 372, in 
>>>
>>> self._caller = lambda f: f()
>>>
>>>   File "C:\dev\web2py\gluon\tools.py"**, line 3235, in f
>>>
>>> return action(*a, **b)
>>>   File 
>>> "C:/dev/web2py/applications/**sideboard/controllers/**maintenance.py" 
>>> ,
>>>  line 1237, in tickets
>>>
>>> paginate=linesPerPage, maxtextlength=45,)
>>>
>>>   File "C:\dev\web2py\gluon\sqlhtml.**py", line 2038, in grid
>>>
>>> next=referrer)
>>>   File "C:\dev\web2py\gluon\html.py", line 2215, in process
>>>
>>> self.validate(**kwargs)
>>>   File "C:\dev\web2py\gluon\html.py", line 2154, in validate
>>>
>>> if self.accepts(**kwargs):
>>>   File "C:\dev\web2py\gluon\sqlhtml.**py", line 1324, in accepts
>>>
>>> **kwargs
>>>   File "C:\dev\web2py\gluon\html.py", line 2024, in accepts
>>>
>>> if not formkeys or formkey not in formkeys:
>>> TypeError: 'in ' requires string as left operand, not NoneType
>>>
>>>
>>> -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/e9tGCO9T70A/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> web2py+un...@googlegroups.com .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: Error in SQLFORM.grid after updating to Version 2.6.4-stable+timestamp.2013.06.26.11.24.52

2013-09-26 Thread Jim Steil
FWIW, here is a sample:

grid = SQLFORM.grid(query, fields=fields, orderby=orderby,
create=create, details=details, editable=editable,
deletable=deletable, csv=False,
search_widget=ticketSearch,
paginate=linesPerPage, maxtextlength=45)



On Thu, Sep 26, 2013 at 1:55 PM, Jim Steil  wrote:

> I just did a hg pull from https://code.google.com/p/web2py and got no
> changes found.
>
>
> On Thu, Sep 26, 2013 at 1:36 PM, Massimo Di Pierro <
> massimo.dipie...@gmail.com> wrote:
>
>> The problem is not the grid. We are working on a new feature and it will
>> break existing sessions.
>> I just committed a change to trunk that should fix the problem.
>>
>> massimo
>>
>>
>> On Thursday, 26 September 2013 11:55:51 UTC-5, Jim S wrote:
>>>
>>> All of my SQLFORM.grids are failing when I click on the EDIT button with
>>> this traceback, pointing to sqlform.html.  Add's fail as well.
>>>
>>> Traceback (most recent call last):
>>>   File "C:\dev\web2py\gluon\**restricted.py", line 217, in restricted
>>>
>>> exec ccode in environment
>>>   File 
>>> "C:/dev/web2py/applications/**sideboard/controllers/**maintenance.py" 
>>> ,
>>>  line 1245, in 
>>>
>>>   File "C:\dev\web2py\gluon\globals.**py", line 372, in 
>>>
>>> self._caller = lambda f: f()
>>>
>>>   File "C:\dev\web2py\gluon\tools.py"**, line 3235, in f
>>>
>>> return action(*a, **b)
>>>   File 
>>> "C:/dev/web2py/applications/**sideboard/controllers/**maintenance.py" 
>>> ,
>>>  line 1237, in tickets
>>>
>>> paginate=linesPerPage, maxtextlength=45,)
>>>
>>>   File "C:\dev\web2py\gluon\sqlhtml.**py", line 2038, in grid
>>>
>>> next=referrer)
>>>   File "C:\dev\web2py\gluon\html.py", line 2215, in process
>>>
>>> self.validate(**kwargs)
>>>   File "C:\dev\web2py\gluon\html.py", line 2154, in validate
>>>
>>> if self.accepts(**kwargs):
>>>   File "C:\dev\web2py\gluon\sqlhtml.**py", line 1324, in accepts
>>>
>>> **kwargs
>>>   File "C:\dev\web2py\gluon\html.py", line 2024, in accepts
>>>
>>> if not formkeys or formkey not in formkeys:
>>> TypeError: 'in ' requires string as left operand, not NoneType
>>>
>>>
>>> -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/e9tGCO9T70A/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/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: Error in SQLFORM.grid after updating to Version 2.6.4-stable+timestamp.2013.06.26.11.24.52

2013-09-26 Thread Jim Steil
I just did a hg pull from https://code.google.com/p/web2py and got no
changes found.


On Thu, Sep 26, 2013 at 1:36 PM, Massimo Di Pierro <
massimo.dipie...@gmail.com> wrote:

> The problem is not the grid. We are working on a new feature and it will
> break existing sessions.
> I just committed a change to trunk that should fix the problem.
>
> massimo
>
>
> On Thursday, 26 September 2013 11:55:51 UTC-5, Jim S wrote:
>>
>> All of my SQLFORM.grids are failing when I click on the EDIT button with
>> this traceback, pointing to sqlform.html.  Add's fail as well.
>>
>> Traceback (most recent call last):
>>   File "C:\dev\web2py\gluon\**restricted.py", line 217, in restricted
>> exec ccode in environment
>>   File "C:/dev/web2py/applications/**sideboard/controllers/**maintenance.py" 
>> ,
>>  line 1245, in 
>>   File "C:\dev\web2py\gluon\globals.**py", line 372, in 
>> self._caller = lambda f: f()
>>   File "C:\dev\web2py\gluon\tools.py"**, line 3235, in f
>> return action(*a, **b)
>>   File "C:/dev/web2py/applications/**sideboard/controllers/**maintenance.py" 
>> ,
>>  line 1237, in tickets
>> paginate=linesPerPage, maxtextlength=45,)
>>   File "C:\dev\web2py\gluon\sqlhtml.**py", line 2038, in grid
>> next=referrer)
>>   File "C:\dev\web2py\gluon\html.py", line 2215, in process
>> self.validate(**kwargs)
>>   File "C:\dev\web2py\gluon\html.py", line 2154, in validate
>> if self.accepts(**kwargs):
>>   File "C:\dev\web2py\gluon\sqlhtml.**py", line 1324, in accepts
>> **kwargs
>>   File "C:\dev\web2py\gluon\html.py", line 2024, in accepts
>> if not formkeys or formkey not in formkeys:
>> TypeError: 'in ' requires string as left operand, not NoneType
>>
>>
>> -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/e9tGCO9T70A/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/groups/opt_out.
>

-- 
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/groups/opt_out.


Re: [web2py] Re: OFF topic - Git question

2013-09-26 Thread step
One gotcha In Windows 7 and Vista, when the working directory path ends with a 
symbolic link, the current parent path reference, .., will refer to the parent 
directory of the symbolic link rather than that of its target. This difference 
could break the importer code if it's playing with .. path components.
Another gotcha could be if you are creating a reparse point instead of a 
simlink. Reparse points aren't trasparent to applications, so the importer 
would need to be written to support reparse points a.k.a junctions.
In Windows I simply rename w2p's .git and .gitignore to .git-trunk and 
.gitignore-trunk then git init my app repo exactly where .git-trunk is. This 
way the two repos can physically co-exist but operationally they don't because 
only one of them can be named .git at any given time. So there's no chance of 
loosing app files when pulling w2p, nor need to worry about symlinks. The thing 
to keep in mind is switching to the right repo by temporarily renaming both of 
their folders, i.e., REN .git/ .git-apps/ && REN .git-trunk .git && git pull 
origin && REN .git .git-trunk && REN .git-apps .git (untested and don't forget 
.gitignore)

-- 
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/groups/opt_out.


[web2py] from devel list (was Re: [web2py-dev] Here they come...)

2013-09-26 Thread Gour
On Tue, 24 Sep 2013 07:39:40 -0500
Massimo DiPierro
 wrote:

> I posted a comment. It is a good sign that they are worried. They
> should be. ;-)  

Not to clutter dev list, I'm replying here on the comment which was
posted recently on Quora...

(http://www.quora.com/Wei-Wei-1/Posts/10-reasons-not-to-use-web2py)

At the moment I am working on the Real Python for the Web course which
covers from the very basic stuff over Flask to full-featured frameworks
like web2py & Django.

Moreover, I agree with all the advantages of web2py over Django
mentioned in the comments, but, imho, if web2py wants to get *much* more
popular then it needs something like Mezzanine/Cartridge which allows
new category of users to build web site(s) quickly with most of the
required features shipping out of the box...yes, I'm the one not wanting
to roll yet another CMS. ;)


Sincerely,
Gour


-- 
He is a perfect yogī who, by comparison to his own self, 
sees the true equality of all beings, in both their 
happiness and their distress, O Arjuna!

http://www.atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810


-- 
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/groups/opt_out.


[web2py] Re: Error in SQLFORM.grid after updating to Version 2.6.4-stable+timestamp.2013.06.26.11.24.52

2013-09-26 Thread Massimo Di Pierro
The problem is not the grid. We are working on a new feature and it will 
break existing sessions. 
I just committed a change to trunk that should fix the problem.

massimo

On Thursday, 26 September 2013 11:55:51 UTC-5, Jim S wrote:
>
> All of my SQLFORM.grids are failing when I click on the EDIT button with 
> this traceback, pointing to sqlform.html.  Add's fail as well.
>
> Traceback (most recent call last):
>   File "C:\dev\web2py\gluon\restricted.py", line 217, in restricted
> exec ccode in environment
>   File "C:/dev/web2py/applications/sideboard/controllers/maintenance.py" 
> ,
>  line 1245, in 
>   File "C:\dev\web2py\gluon\globals.py", line 372, in 
> self._caller = lambda f: f()
>   File "C:\dev\web2py\gluon\tools.py", line 3235, in f
> return action(*a, **b)
>   File "C:/dev/web2py/applications/sideboard/controllers/maintenance.py" 
> ,
>  line 1237, in tickets
> paginate=linesPerPage, maxtextlength=45,)
>   File "C:\dev\web2py\gluon\sqlhtml.py", line 2038, in grid
> next=referrer)
>   File "C:\dev\web2py\gluon\html.py", line 2215, in process
> self.validate(**kwargs)
>   File "C:\dev\web2py\gluon\html.py", line 2154, in validate
> if self.accepts(**kwargs):
>   File "C:\dev\web2py\gluon\sqlhtml.py", line 1324, in accepts
> **kwargs
>   File "C:\dev\web2py\gluon\html.py", line 2024, in accepts
> if not formkeys or formkey not in formkeys:
> TypeError: 'in ' requires string as left operand, not NoneType
>
>
> -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/groups/opt_out.


[web2py] Re: OFF topic - Git question

2013-09-26 Thread Cliff Kachinske
You could have something like this:
/
/web2py/
/web2py/.git
/web2py/.gitignore
/web2py/gluon
/web2py/blah
/common_files
/common_files/.git
/common_files/.gitignore
/common_files/models
/common_files/modules
/common_files/static
# you get the idea
/myapps/
/myapps/.git
/myapps/mygreatapp
/myapps/mygreatapp/

repeat as necessary

I use the common files directory for the main db.py, common css, common 
views, common js, etc across all my apps.

That way everything I deliver has the same look and feel and (buzzword 
alert) user experience.

On Wednesday, September 25, 2013 6:47:14 AM UTC-4, Ramos wrote:
>
> Hello , i´m starting to learn git but have a question
>
> I have my web2py cloned from git
> inside web2py i have the application folder
> if i git init inside app1 is there some kind of conflict with the web2py 
> folder git?
>
>
> Thank you
>
> António
>

-- 
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/groups/opt_out.


[web2py] Re: Error in SQLFORM.grid after updating to Version 2.6.4-stable+timestamp.2013.06.26.11.24.52

2013-09-26 Thread Niphlod
what is the SQLFORM.grid call that generates this (i.e. what parameters are 
passed to the grid)? 

On Thursday, September 26, 2013 6:55:51 PM UTC+2, Jim S wrote:
>
> All of my SQLFORM.grids are failing when I click on the EDIT button with 
> this traceback, pointing to sqlform.html.  Add's fail as well.
>
> Traceback (most recent call last):
>   File "C:\dev\web2py\gluon\restricted.py", line 217, in restricted
> exec ccode in environment
>   File "C:/dev/web2py/applications/sideboard/controllers/maintenance.py" 
> ,
>  line 1245, in 
>   File "C:\dev\web2py\gluon\globals.py", line 372, in 
> self._caller = lambda f: f()
>   File "C:\dev\web2py\gluon\tools.py", line 3235, in f
> return action(*a, **b)
>   File "C:/dev/web2py/applications/sideboard/controllers/maintenance.py" 
> ,
>  line 1237, in tickets
> paginate=linesPerPage, maxtextlength=45,)
>   File "C:\dev\web2py\gluon\sqlhtml.py", line 2038, in grid
> next=referrer)
>   File "C:\dev\web2py\gluon\html.py", line 2215, in process
> self.validate(**kwargs)
>   File "C:\dev\web2py\gluon\html.py", line 2154, in validate
> if self.accepts(**kwargs):
>   File "C:\dev\web2py\gluon\sqlhtml.py", line 1324, in accepts
> **kwargs
>   File "C:\dev\web2py\gluon\html.py", line 2024, in accepts
> if not formkeys or formkey not in formkeys:
> TypeError: 'in ' requires string as left operand, not NoneType
>
>
> -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/groups/opt_out.


[web2py] Error in SQLFORM.grid after updating to Version 2.6.4-stable+timestamp.2013.06.26.11.24.52

2013-09-26 Thread Jim S
All of my SQLFORM.grids are failing when I click on the EDIT button with 
this traceback, pointing to sqlform.html.  Add's fail as well.

Traceback (most recent call last):
  File "C:\dev\web2py\gluon\restricted.py", line 217, in restricted
exec ccode in environment
  File "C:/dev/web2py/applications/sideboard/controllers/maintenance.py" 
,
 line 1245, in 
  File "C:\dev\web2py\gluon\globals.py", line 372, in 
self._caller = lambda f: f()
  File "C:\dev\web2py\gluon\tools.py", line 3235, in f
return action(*a, **b)
  File "C:/dev/web2py/applications/sideboard/controllers/maintenance.py" 
,
 line 1237, in tickets
paginate=linesPerPage, maxtextlength=45,)
  File "C:\dev\web2py\gluon\sqlhtml.py", line 2038, in grid
next=referrer)
  File "C:\dev\web2py\gluon\html.py", line 2215, in process
self.validate(**kwargs)
  File "C:\dev\web2py\gluon\html.py", line 2154, in validate
if self.accepts(**kwargs):
  File "C:\dev\web2py\gluon\sqlhtml.py", line 1324, in accepts
**kwargs
  File "C:\dev\web2py\gluon\html.py", line 2024, in accepts
if not formkeys or formkey not in formkeys:
TypeError: 'in ' requires string as left operand, not NoneType


-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/groups/opt_out.


[web2py] Re: How can I give google map javascript api marker title a suitably encoded string?

2013-09-26 Thread Christian Foster Howes
can you use an inspector to see the actual generated javascript?  it's 
possible that web2py is escaping the apostrophe.  you can try 
{{=XML(myobject.name)}}

On Tuesday, September 24, 2013 5:26:29 PM UTC-7, User wrote:
>
> I'm using the google map javascript api (v3). I have a google map in one 
> of my views.  I want to display the location name as the marker title (used 
> when hovering over the marker).  I'm using the following code in my view:
>  
> {{block head}}
> 
> function init_map() {
> var myLatlng = new google.maps.LatLng({{=myobject.lat}}, {{=
> myobject.lng}});
> var mapOptions = {
> center: myLatlng,
> zoom: 12,
> mapTypeId: google.maps.MapTypeId.ROADMAP
> };
> var map = new google.maps.Map(document.getElementById("map-canvas"
> ),
> mapOptions);
> var marker = new google.maps.Marker({
> position: myLatlng,
> map: map,
> title: "{{=myobject.name}}"
> });
> }
> google.maps.event.addDomListener(window, 'load', init_map);
> 
> {{end}}
>
>
>  
> This works to output a map but when I mouse over the marker, the character 
> encoding is not right.  For example, if  myobject.name contains the 
> string "John's Place" then the marker tooltip will literally display 
> "John's Place" (that is, with the ampersand and hash).  How can I get 
> it to display the string as "John's Place" in a web safe manner?
>  
>
>  
>

-- 
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/groups/opt_out.


Re: [web2py] Re: OFF topic - Git question

2013-09-26 Thread Christian Foster Howes
i believe that git submodules can also do what you are looking for.  not 
sure if that is easier/harder then symlinks.

On Wednesday, September 25, 2013 3:59:18 AM UTC-7, Marin Pranjić wrote:
>
> Yes gitignore is the answer but I have been burned once trying to git 
> reset so I lost my app repo.
> Now I am using symbolic links inside /applications folder and I keep 
> applications separated.
>
> Marin
>
>
> On Wed, Sep 25, 2013 at 12:49 PM, António Ramos 
> 
> > wrote:
>
>> This in gitignore is the answer right?
>>
>> applications/*
>> !applications/welcome
>> !applications/welcome/*
>> !applications/examples
>> !applications/examples/*
>> !applications/admin
>> !applications/admin/*
>> applications/*/databases/*
>> applications/*/sessions/*
>> applications/*/errors/*
>> applications/*/cache/*
>> applications/*/uploads/*
>> applications/*/*.py[oc]
>> applications/examples/static/epydoc
>> applications/examples/static/sphinx
>>
>>
>> 2013/9/25 António Ramos >
>>
>>> Hello , i´m starting to learn git but have a question
>>>
>>> I have my web2py cloned from git
>>> inside web2py i have the application folder
>>> if i git init inside app1 is there some kind of conflict with the web2py 
>>> folder git?
>>>
>>>
>>> Thank you
>>>
>>> António
>>>
>>
>>  -- 
>> 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/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.


Re: [web2py] Re: Auth modal redirects to profile instead of index

2013-09-26 Thread Richard Vézina
This is an other issue I think, .load usually propagate in case of a
redirect from a component you need to set extension=False generally to get
out of that. Not sure if it will help you. I found myself having issue with
tools.py redirect on user.load in case session has expired and the user is
clicking on a bootstrap accordion header that trigger a web2py_component
(equivalent to LOAD() but manually triggered). Hope it helps.

Richard


On Tue, Sep 24, 2013 at 6:50 PM, raferbop  wrote:

> Yes, they were both working but I have set form to auth() and elected to use 
> LOAD() instead now but I have a similar problem. I am being redirected to 
> default/index.load after I loggin. upon manually reloading this same page, I 
> am redirected to default/user.load/profile. These pages have no formatting
>
> #default.py
> def index():
>return dict()
>
> def handle_user():
>return dict(form=auth())
>
> #default/index.html
> 
>  
> {{=LOAD('default','handle_user.load',args='login',ajax=True,target='uniqseven',extension=False)}}
> 
>
> 
>  {{=LOAD('default','handle_user.load', args='register', 
> ajax=True,target='uniqfive',extension=False)}}
> 
>
> #default/handle_user.load
> {{=T( request.args(0).replace('_',' ').capitalize() )}}
> 
> 
>   {{=form}}
>   {{if request.args(0)=='login':}}
>   {{if not 'register' in auth.settings.actions_disabled:}}
>   
>   {{=T('Register')}}
>   {{pass}}
>   {{if not 'request_reset_password' in auth.settings.actions_disabled:}}
>   
>   {{=T('Lost 
> Password')}}
>   {{pass}}
>   {{pass}}
> 
> 
>
>
> On Tuesday, September 24, 2013 3:46:31 PM UTC-5, Massimo Di Pierro wrote:
>>
>> I have never tried this but I am not sure you can have those forms in the
>> same page. Apart for the incorrect redirect, do they both work?
>>
>> On Tuesday, 24 September 2013 13:09:51 UTC-5, raferbop wrote:
>>>
>>> def index():
>>>return dict(logform=auth.login(),**regform=auth.register())
>>>
>>> I put these two forms from the Auth module on the index page, inside a
>>> modal but when I login/register I am redirected to a profile page instead
>>> of the index page. What can I do to prevent the redirect or go the index
>>> page?
>>>
>>  --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.


[web2py] Re: View have to be updated

2013-09-26 Thread Gael Princivalle
I've found my mistake. View "lista_articoli.html" was not in the "default" 
folder.

Il giorno martedì 24 settembre 2013 17:46:22 UTC+2, Gael Princivalle ha 
scritto:
>
> Hi.
>
> I'm a web2py newbie.
>
> I'm still trying to adapt the "Image" example with products.
>
> Here is my db:
> db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all'])
> db.define_table('articoli',
> Field('Codice_A', unique=True),
> Field('Descrizione_Breve'),
> Field('Produttore'),
> Field('Path_pdf'))
>
> My controller:
> def lista_articoli():
> articoli = db().select(db.articoli.ALL, orderby=db.articoli.Codice_A)
> return dict(articoli=articoli)
>
> My view: lista_articoli.html
> {{extend 'layout.html'}}
> Lista articoli
> 
> {{for articolo in articoli:}}
> {{=LI(A(articolo.Codice_A, _href=URL("show", args=articolo.id)))}}
> {{pass}}
> 
>
> Here is what I have when I go to the lista_articoli.html page:
> Lista Articoli articoli.idarticoli.Codice_Aarticoli.Descrizione_Breve
> articoli.Produttorearticoli.Path_pdf65190106446DSE3-C35SA/11...DUPLOMATIC 
> OL...http://www.du...640004010303560STVU-08ABROC OIL CONT...
> http://www.hy...
> It's my previous lista_articoli.html page. I've save it but it don't 
> change.
>
> Can you help me ?
>

-- 
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/groups/opt_out.


[web2py] Preset for Downloadfield

2013-09-26 Thread Martin Weissenboeck
Hope there is a simple answer:

I have a download button in my form. How can I have a preselected value for
the name of the file?

Regards, Martin

-- 
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/groups/opt_out.


[web2py] Re: 3rd party authentication via xml

2013-09-26 Thread Alan
apologies for my vagueness. The 3rd party solution is a booking system that 
stores all customer records. for custom web development we have to use 
their api.

customers primary key is the email address and the password is stored with 
them as they also offer a generic solution if you don't use their api.

I want to link web2py auth to them so that the auth login form just passes 
the email and password over to the 3rd party. The way to know if the email 
and password combination are correct, you parse the returned xml.

an example communication with the 3rd party:
import httplib2
textxml = 
"a...@mydomain.comPASSWORD"
h = httplib2.Http(ca_certs="ca.crt")
h.add_certificate("certificate.key", "certificate.crt","3rdparty.com")
headers = {'Content-Type': 'application/xml'}
uri = 
"https://api.3rdparty.com/authenticate?api_key=612002a1-d9a4-4ee8-8437-85222556d53d";
response, content = h.request(uri, method="POST", body=textxml, headers=
headers)
print content


the print will return something like:

false

the true or false in credentialsvalid is to know if the email/password 
combination is correct. The customer id is returned based on on the email 
address. other than the email, this is the only customer identifiable piece 
of information. This means web2py has to maintain a session, but not store 
the password.

Further communication with the 3rd party is based on the email address and 
customer id. They do tie the customer id with a basket id, but that is only 
once the customer starts adding things to their basket and isn't 
technically a session that i or web2py can utilise.

>From looking at basic_auth.py it looks like i can quite easily make a copy 
of this that includes the above and an extra step that parses the contents 
of the returned xml, but wanted to check if this is the best method and how 
to then retain the customer id in the web2py session or auth table. 
Alternatively, do i just put the custom version of basic_auth in db.py 
above any auth reference?

Hope this expansion helps.

-- 
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/groups/opt_out.


Re: [web2py] request.url with scheme

2013-09-26 Thread Richard Vézina
Thanks Paolo...

:)

Richard


On Thu, Sep 26, 2013 at 10:10 AM, Paolo Caruccio  wrote:

> what about
>
> 
> {{='%s://%s%s'%(request.env.wsgi_url_scheme,request.env.http_host,request.url)}}
> 
>
> ?
>
> Il giorno giovedì 26 settembre 2013 15:30:02 UTC+2, Richard ha scritto:
>>
>> The only one that seems to do the job is this one :
>> request.env.http_referer
>> But it only work in case the user clic on a link. If he copy and paste a
>> link it didn't work... Maybe it requires that I combine different
>> request.env.SOMETHING, didn't found the proper ingredients until now :)
>>
>> Richard
>>
>>
>> On Wed, Sep 25, 2013 at 6:11 PM, Niphlod  wrote:
>>
>>> check also request.env . holds all the pieces, although scheme=True and
>>> host=True usually cut the deal.
>>>
>>>
>>> On Wednesday, September 25, 2013 8:46:00 PM UTC+2, Richard wrote:

 Hello,

 I want to grab the actual url not just relative, request.url give me
 the relative url. I thought of this :

 {{=T('To reproduce this report copy this link :')}}
 {{=URL(request.url, scheme=True)}}

 But request.url already have app include and controller that get
 duplicated by scheme=True...

 It maybe a bad idea... But it could be usefull to have 
 URL(url='http://...',
 scheme=True)

 So, I can retrieve the complete url like this : URL(url=request.url,
 scheme=True)

 Or, maybe simpler : request.url_with_scheme

 I work around, like this :

 URL(c=request.controller, args=request.args, vars=request.vars,
 scheme=True)

 Thanks

 Richard

>>>  --
>>> 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/**groups/opt_out
>>> .
>>>
>>
>>  --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.


Re: [web2py] request.url with scheme

2013-09-26 Thread Paolo Caruccio
what about


{{='%s://%s%s'%(request.env.wsgi_url_scheme,request.env.http_host,request.url)}}


?

Il giorno giovedì 26 settembre 2013 15:30:02 UTC+2, Richard ha scritto:
>
> The only one that seems to do the job is this one : 
> request.env.http_referer
> But it only work in case the user clic on a link. If he copy and paste a 
> link it didn't work... Maybe it requires that I combine different 
> request.env.SOMETHING, didn't found the proper ingredients until now :)
>
> Richard
>
>
> On Wed, Sep 25, 2013 at 6:11 PM, Niphlod  >wrote:
>
>> check also request.env . holds all the pieces, although scheme=True and 
>> host=True usually cut the deal.
>>
>>
>> On Wednesday, September 25, 2013 8:46:00 PM UTC+2, Richard wrote:
>>>
>>> Hello,
>>>
>>> I want to grab the actual url not just relative, request.url give me the 
>>> relative url. I thought of this :
>>>
>>> {{=T('To reproduce this report copy this link :')}}
>>> {{=URL(**request.url, scheme=True)}}
>>>
>>> But request.url already have app include and controller that get 
>>> duplicated by scheme=True...
>>>
>>> It maybe a bad idea... But it could be usefull to have 
>>> URL(url='http://...', scheme=True)
>>>
>>> So, I can retrieve the complete url like this : URL(url=request.url, 
>>> scheme=True)
>>>
>>> Or, maybe simpler : request.url_with_scheme
>>>
>>> I work around, like this :
>>>
>>> URL(c=request.controller, args=request.args, vars=request.vars, 
>>> scheme=True)
>>>
>>> Thanks
>>>
>>> Richard
>>>
>>  -- 
>> 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/groups/opt_out.
>>
>
>

-- 
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/groups/opt_out.


Re: [web2py] request.url with scheme

2013-09-26 Thread Richard Vézina
The only one that seems to do the job is this one : request.env.http_referer
But it only work in case the user clic on a link. If he copy and paste a
link it didn't work... Maybe it requires that I combine different
request.env.SOMETHING, didn't found the proper ingredients until now :)

Richard


On Wed, Sep 25, 2013 at 6:11 PM, Niphlod  wrote:

> check also request.env . holds all the pieces, although scheme=True and
> host=True usually cut the deal.
>
>
> On Wednesday, September 25, 2013 8:46:00 PM UTC+2, Richard wrote:
>>
>> Hello,
>>
>> I want to grab the actual url not just relative, request.url give me the
>> relative url. I thought of this :
>>
>> {{=T('To reproduce this report copy this link :')}}
>> {{=URL(**request.url, scheme=True)}}
>>
>> But request.url already have app include and controller that get
>> duplicated by scheme=True...
>>
>> It maybe a bad idea... But it could be usefull to have URL(url='http://...',
>> scheme=True)
>>
>> So, I can retrieve the complete url like this : URL(url=request.url,
>> scheme=True)
>>
>> Or, maybe simpler : request.url_with_scheme
>>
>> I work around, like this :
>>
>> URL(c=request.controller, args=request.args, vars=request.vars,
>> scheme=True)
>>
>> Thanks
>>
>> Richard
>>
>  --
> 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/groups/opt_out.
>

-- 
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/groups/opt_out.


Re: [web2py] Re: replacing T() with T.M()

2013-09-26 Thread Massimo Di Pierro
Uploading. Now we have to update all language files. :-(

On Thursday, 26 September 2013 02:31:10 UTC-5, dbdeveloper wrote:
>
>  Massimo, my decision can fix this issue: 
> http://code.google.com/p/web2py/issues/detail?id=1677
>
> Can you apply my patch ?
>
> With the best regards,
> Vladyslav Kozlovskyy
> Chernivtsi, Ukraine
>
>
> У ср, 2013-09-25 у 21:42 -0700, Massimo Di Pierro пише: 
>
> Yes the produce the same output but while T.M(s) caches the markmin 
> output, MARKMIN(T(s)) only caches the translated string before MARKMIN 
> rendering. Therefore T.M(s) is faster. 
>
>  
>
>  On Wednesday, 25 September 2013 20:09:38 UTC-5, Anthony wrote: 
>
>  Sorry, that wasn't clear. But why can't you just do: 
>
>   
>
>   var ajax_error_500 = '{{=MARKMIN(T('An error occurred, please [[reload 
> %s]] the page') %
>  URL(args=request.args, 
> vars=request.get_vars))}}' 
>
>   
> Anthony
>
> On Wednesday, September 25, 2013 5:47:31 PM UTC-4, dbdeveloper wrote: 
>
>   T.M() uses MARKMIN (see docs in attachment). Using MARKMIN you can 
> create message with link, img, tables, bold, italic, colors and so on.
>
> Vlad
>
> У ср, 2013-09-25 у 07:20 -0700, Anthony пише: 
>
>  var ajax_error_500 = '{{=T.M('An error occur*r*ed, please [[reload 
> %s]] the page') % URL(args=request.args, vars=request.get_vars) }}' 
>
>
>
> The original included an HTML  element. In your example above, does the 
> [[... %s]] notation indicate that an  element should be created? If so, 
> what if you want to include some attributes? What if you need a different 
> HTML element?
>
>
> 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+un...@googlegroups.com.
> For more options, visit 
> https://groups.google.com/
> groups/opt_out . 
>
>   -- 
> 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/groups/opt_out. 
>
> 

-- 
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/groups/opt_out.


[web2py] Re: 3rd party authentication via xml

2013-09-26 Thread Massimo Di Pierro
It is not clear from your description how this is supposed to work. So a 
use uploads the xml and receives an xml response. presumably this is done 
by a problem not by a user+browser. So how does the server maintain state? 
cookies?

On Thursday, 26 September 2013 07:08:35 UTC-5, Alan wrote:
>
> Hi,
>
> can auth handle authentication with a true or false reponse returned via 
> an xml file?
>
> i need to use httplib2 to submit the username and password in an xml file 
> and the response will be an xml file that among other things will have: 
> false for incorrect password and true 
> if ok, anything else is a server connection error. There will also be a 
> customerid returned that is unique to the email address, but no session 
> information.
>
> I'd like to use built in auth, but not sure which auth file to use as a 
> basis for building one up. I dont want to store any passwords in web2py.
>
> i also need to alter the registration and password reset so that i can 
> again use httplib2 to make the call to the 3rd party.
>
> hope this makes sense. An example of how to make auth use a function would 
> be most appreciated if possible.
>
>
> Thanks,
>
> Alan
>

-- 
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/groups/opt_out.


[web2py] Re: Programmatic forms, add_button, and button order

2013-09-26 Thread Massimo Di Pierro
It works for SQLFORM, not FORM. The FORM structure is too open and 
customizable. web2py would not know where to add it.


On Thursday, 26 September 2013 04:52:44 UTC-5, Cliff Kachinske wrote:
>
> add_button is a method of FORM().  But I'm not sure it works as the 
> following shows:
>
> cjk@debian:~/pybin/web2py-src/web2py$ python
> Python 2.7.3 (default, Jan  2 2013, 13:56:14) 
> [GCC 4.7.2] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from gluon import html
> >>> simpleform = html.FORM(html.INPUT(_type="text", _name="mytext"))
> >>> simpleform.xml()
> ' name="mytext" type="text" />'
> >>> # Now comes an exception
> ... 
> >>> simpleform.add_button('foo', html.URL('bar', 'baz', 'foo'))
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "gluon/html.py", line 2216, in add_button
> submit.parent.append(
> AttributeError: 'NoneType' object has no attribute 'parent'
> >>> 
> >>> # Now we fix the exception
> ... 
> >>> simpleform.append(html.INPUT(_type='submit'))
> >>> simpleform.xml()
> ' name="mytext" type="text" />'
> >>> 
> >>> # Now add_button will appear to work
> ... 
> >>> simpleform.add_button('foo', html.URL('bar', 'baz', 'foo'))
> >>> 
> >>> #See, no exception. But look at this:
> ... 
> >>> simpleform.xml()
> ' name="mytext" type="text" />'
> >>> 
> >>> #Whiskey Tango Fox? Button doesn't seem to be there
>
>
>
> On Wednesday, September 25, 2013 1:17:37 PM UTC-4, wb wrote:
>>
>> Trying to generate a small form that is all buttons: 
>>
>> def month-example: 
>>  months = {'January', 'February', 'March'} 
>>
>>  form = FORM() 
>>  for month in months: 
>>  # this fails 
>>  form.add_button(month, URL(month)) 
>>  return dict(form=form) 
>>
>> This generates 'NoneType' object has no attribute 'parent'. 
>>
>> Creating links with helpers works: 
>>
>>  form += A( month, _href=URL(month) ) 
>>
>> But the form is a dictionary, and the months are out of order.  I think 
>> that add_button preserves the order, but have not verified that. 
>>
>> Does add_button only work with SQLFORM? 
>>
>> How can the order of elements added to a form programmatically be 
>> controlled? 
>>
>

-- 
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/groups/opt_out.


[web2py] Re: mysql problem after updating to 2.6.4

2013-09-26 Thread Cliff Kachinske
You can use "print db._lastsql" to see the actual query emitted by dal.

If that doesn't give you enough information, you can post the query here 
for assistance.

Alas my MySQL chops are somewhat rusty, but surely somebody will have a 
suggestion.

On Thursday, September 26, 2013 2:57:45 AM UTC-4, Wouter Pronk wrote:
>
> Hello,
>
> I've updated web2py to version 2.6.4 and now I get a Mysql-error which I 
> didn't have before: 
>
>>  (1064, u"You have an 
>> error in your SQL syntax; check the manual that corresponds to your MySQL 
>> server version for the right syntax to use near 'LONGTEXT))) AND 
>> (relatie_datatypes.message_type = message_type.id)) ORDER BY rel' at 
>> line 1")
>>
>> It complains about LONGTEXT, but I don't use LONGTEXT. Anybody an idea?
>
> Thanks, Wouter 
>

-- 
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/groups/opt_out.


Re: [web2py] Re: replacing T() with T.M()

2013-09-26 Thread Anthony
My apologies -- I had forgotten about T.M() -- thought you were proposing 
introducing it rather than just simply using it in this one context.

Anthony

On Thursday, September 26, 2013 3:12:33 AM UTC-4, dbdeveloper wrote:
>
>  First of all =T.M() is shorter then =MARKMIN(T()) :)
> Second. You can assume then "M" in T.M() is "MARKMIN" or "MODIFIED" T()  :)
> Third. MARKMIN expression in T.M() is parsed only once. Then parsed cached 
> string is used multiple times. MARKMIN() in =MARKMIN(T()) will be executed 
> every time.
> Four. T.M() message is marked in translation dictionary. Translator can 
> understand then this message is not a plain text but a MARKMIN text (see 
> picture)
> Five. T.M() allow you to use another preprocessor (not only MARKMIN) to 
> parse message before caching (filter= and ftag= parameters in T.M() 
> function).
> Six. T.M() avoid to split translated sentence into several parts as in 
> ajax_error_500 message was. It's very difficult to translate such split 
> sentences because on some languages we need to rearrange words and/or 
> change words' forms to make right translation.
>
> NOTE: [Update all languages] in Languages section in appadmin cannot 
> affect to T.M() because we cannot know what filter is used before 
> execution. So new T.M() translations appears in translation dictionary 
> AFTER appropriate T.M() CALLS ONLY!
>
>
>
> У ср, 2013-09-25 у 18:09 -0700, Anthony пише: 
>
> Sorry, that wasn't clear. But why can't you just do: 
>
>  
>
>  var ajax_error_500 = '{{=MARKMIN(T('An error occurred, please [[reload %s
> ]] the page') %
>  URL(args=request.args, 
> vars=request.get_vars))}}' 
>
>  
> Anthony
>
> On Wednesday, September 25, 2013 5:47:31 PM UTC-4, dbdeveloper wrote: 
>
>  T.M() uses MARKMIN (see docs in attachment). Using MARKMIN you can 
> create message with link, img, tables, bold, italic, colors and so on.
>
> Vlad
>
> У ср, 2013-09-25 у 07:20 -0700, Anthony пише: 
>
>  var ajax_error_500 = '{{=T.M('An error occur*r*ed, please [[reload 
> %s]] the page') % URL(args=request.args, vars=request.get_vars) }}' 
>
>
>
> The original included an HTML  element. In your example above, does the 
> [[... %s]] notation indicate that an  element should be created? If so, 
> what if you want to include some attributes? What if you need a different 
> HTML element?
>
>
> 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+un...@googlegroups.com.
> For more options, visit 
> https://groups.google.com/
> groups/opt_out . 
>
>   -- 
> 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/groups/opt_out. 
>
> 

-- 
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/groups/opt_out.


[web2py] 3rd party authentication via xml

2013-09-26 Thread Alan
Hi,

can auth handle authentication with a true or false reponse returned via an 
xml file?

i need to use httplib2 to submit the username and password in an xml file 
and the response will be an xml file that among other things will have: 
false for incorrect password and true 
if ok, anything else is a server connection error. There will also be a 
customerid returned that is unique to the email address, but no session 
information.

I'd like to use built in auth, but not sure which auth file to use as a 
basis for building one up. I dont want to store any passwords in web2py.

i also need to alter the registration and password reset so that i can 
again use httplib2 to make the call to the 3rd party.

hope this makes sense. An example of how to make auth use a function would 
be most appreciated if possible.


Thanks,

Alan

-- 
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/groups/opt_out.


[web2py] Re: Programmatic forms, add_button, and button order

2013-09-26 Thread Cliff Kachinske
add_button is a method of FORM().  But I'm not sure it works as the 
following shows:

cjk@debian:~/pybin/web2py-src/web2py$ python
Python 2.7.3 (default, Jan  2 2013, 13:56:14) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from gluon import html
>>> simpleform = html.FORM(html.INPUT(_type="text", _name="mytext"))
>>> simpleform.xml()
''
>>> # Now comes an exception
... 
>>> simpleform.add_button('foo', html.URL('bar', 'baz', 'foo'))
Traceback (most recent call last):
  File "", line 1, in 
  File "gluon/html.py", line 2216, in add_button
submit.parent.append(
AttributeError: 'NoneType' object has no attribute 'parent'
>>> 
>>> # Now we fix the exception
... 
>>> simpleform.append(html.INPUT(_type='submit'))
>>> simpleform.xml()
''
>>> 
>>> # Now add_button will appear to work
... 
>>> simpleform.add_button('foo', html.URL('bar', 'baz', 'foo'))
>>> 
>>> #See, no exception. But look at this:
... 
>>> simpleform.xml()
''
>>> 
>>> #Whiskey Tango Fox? Button doesn't seem to be there



On Wednesday, September 25, 2013 1:17:37 PM UTC-4, wb wrote:
>
> Trying to generate a small form that is all buttons: 
>
> def month-example: 
>  months = {'January', 'February', 'March'} 
>
>  form = FORM() 
>  for month in months: 
>  # this fails 
>  form.add_button(month, URL(month)) 
>  return dict(form=form) 
>
> This generates 'NoneType' object has no attribute 'parent'. 
>
> Creating links with helpers works: 
>
>  form += A( month, _href=URL(month) ) 
>
> But the form is a dictionary, and the months are out of order.  I think 
> that add_button preserves the order, but have not verified that. 
>
> Does add_button only work with SQLFORM? 
>
> How can the order of elements added to a form programmatically be 
> controlled? 
>

-- 
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/groups/opt_out.


Re: [web2py] Re: replacing T() with T.M()

2013-09-26 Thread Vladyslav Kozlovskyy
Massimo, my decision can fix this issue:
http://code.google.com/p/web2py/issues/detail?id=1677

Can you apply my patch ?

With the best regards,
Vladyslav Kozlovskyy
Chernivtsi, Ukraine


У ср, 2013-09-25 у 21:42 -0700, Massimo Di Pierro пише:
> Yes the produce the same output but while T.M(s) caches the markmin
> output, MARKMIN(T(s)) only caches the translated string before MARKMIN
> rendering. Therefore T.M(s) is faster.
> 
> 
> 
> On Wednesday, 25 September 2013 20:09:38 UTC-5, Anthony wrote:
> 
> Sorry, that wasn't clear. But why can't you just do:
> 
> 
> 
> var ajax_error_500 = '{{=MARKMIN(T('An error occurred, please
> [[reload %s]] the page') %
>  URL(args=request.args,
> vars=request.get_vars))}}'
> 
> 
> Anthony
> 
> On Wednesday, September 25, 2013 5:47:31 PM UTC-4, dbdeveloper
> wrote:
> 
> T.M() uses MARKMIN (see docs in attachment). Using
> MARKMIN you can create message with link, img, tables,
> bold, italic, colors and so on.
> 
> Vlad
> 
> У ср, 2013-09-25 у 07:20 -0700, Anthony пише: 
> 
> > var ajax_error_500 = '{{=T.M('An error
> > occurred, please [[reload %s]] the page') %
> > URL(args=request.args,
> > vars=request.get_vars) }}' 
> > 
> > 
> > 
> > The original included an HTML  element. In your
> > example above, does the [[... %s]] notation indicate
> > that an  element should be created? If so, what
> > if you want to include some attributes? What if you
> > need a different HTML element?
> > 
> > 
> > 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
> > +un...@googlegroups.com.
> > For more options, visit
> > https://groups.google.com/groups/opt_out.
> 
> -- 
> 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/groups/opt_out.

-- 
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/groups/opt_out.