[web2py] Re: Sharing a database between apps

2012-11-26 Thread G. Clifford Williams
You need to specify the full path to the database file either relatively 
(sqlite://../../foo/bar/storage.sqlite) or absolutely 
(sqlite:///path/to/web2py/application/databases)

you may want to use the os.path methods for this but either way should work 
for you

On Sunday, November 25, 2012 4:27:17 PM UTC-6, pumplerod wrote:

 Sorry, I'm a little unclear on the manual explanation.

 as an example, given app1 and app2

 I want to have app2 share the database I have built in app1

 So do I change the app2/models/db.py file to show: db = 
 DAL('sqlite://storage.sqlite',migrate='false')  ?

 and include all other myModel.py files in app2/models directory as well?

 if the database is in app1/databases/ how does app2 know how to find the 
 correct database file?


-- 





[web2py] Re: 'best' way to include a JavaScript file

2012-07-12 Thread G. Clifford Williams
Look at the way index.html (from the welcome app) handles 'message': 
{{if 'message' in globals():}}
h3{{=message}}/h3

I'd suggest you do something similar (although I would do it with the main 
layout file (presumably layout.html): 

{{ if additional_js in globals(): }}
 code to include your JS ref

Then in your controller actions make sure you set 'additional_js' in the 
dict that you pass. Just one suggestion among the many possibilities.. 
I hope it helps.. 



On Thursday, July 12, 2012 9:49:44 PM UTC-5, MichaelF wrote:

 I want to include a JavaScript file, but only for certain views. What's 
 the best way to include it? Do I have the controller append it to the 
 response.files property? Do I simply use the script with src=... 
 somewhere in the view? Something else?



[web2py] Re: web2py vs ROR

2012-07-10 Thread G. Clifford Williams
I think I'm in a pretty good position to talk about modifying things in 
web2py as I recently took the template engine created for web2py and 
separated it out as a library that can be integrated with other projects. 
In addition, I've been using the framework since ~ late 2008.

There are several layers of which you may be speaking when you ask how easy 
it is to 'pull apart things and modify them as needed'. 

web2py (The framework as a whole): 
   web2py's execution model is different from any other MVC-centric python 
framework I've seen, giving it great flexibility. This does mean however 
that  you need to be aware of the way your code is run if you're going to 
swap out components.

DAL (models):
   I'm not aware of anyone who's completely replaced the DAL with another 
persistence interface. With that said; almost every option in the DAL can 
be overridden. This goes not only for the defaults set when you define your 
models but also in the controllers when you Create/Read/Update/Delete items 
from the models defined. You get a level of flexibility that doesn't exist 
in any ORM that I know of.

Controllers: 
  You may not know that your controllers play a role in your URLs (by 
default). This can be changed with custom routes. Also by default web2py 
presumes that you'll use controller-files with action-functions. It's 
pretty easy to change this and use Class based controllers if you really 
want, or to extend functions to fill the role of controller+action. The 
request and response objects make this almost trivial. A good testament to 
this are the services APIs (covered in the book). 

Template/Views:
  The template engine in web2py can be changed out for something else like 
jinja or mako if you really want that. You'll need to understand how they 
handle escaping and passing the string to be parsed but it's been done a 
number of times before. Many end up switching back because the web2py 
template system offers some huge advantages over the alternatives.


In short almost every nob can be tweaked (without modifying the framework). 
If you want to pull stuff out and replace it with other stuff thats a 
little bit more challenging but it can be done. Web2py is exceedingly 
flexible and easy to tweak.


I hope this helps..

On Monday, July 9, 2012 3:46:24 AM UTC-5, murtaza52 wrote:

 Massimo,

 Appreciate your comments.

 As mentioned by you, web2py has packaged all the functionality needed  by 
 a web app in a single api, and I am finding this very interesting. This 
 certainly allows one to create a web app pretty fast.

 The only remaining question is that how easy is it to pull apart things 
 and modify them as needed. As I understand web2py will certainly speed up 
 my development. However when I need flexibility will I still be easily able 
 to change defaults and tweak things ? ( something that loosely couple 
 frameworks provide over full stack frameworks)

 Thanks,
 Murtaza

 On Saturday, July 7, 2012 1:26:34 AM UTC+5:30, Massimo Di Pierro wrote:

 As pointed out what I said is that I would pick ROR of most python 
 frameworks.

 In general I prefer to program in Python rather then  Ruby. Indentation 
 makes the code more readable and there are more libraries. Ruby is used in 
 Rails but not much else. Python is used for all kind of things (think about 
 numpy, blender, pyglet, etc.).

 Yet Ruby is better designed than most Python framework because if favors 
 convention over configuration. Most Python frameworks instead follow the 
 Python motto explicit is better the implicit and the authors despise the 
 concept of default behaviour which they refer to as magic. This means 
 that even very simple simple such as serving a static file require a fair 
 amount of programing. Moreover, as a corollary, most frameworks come in 
 pieces. Ever piece has a name and its own marketing people. This exposes 
 the visibility of the component but it means you have to separately find 
 and install the components you need, learn their api and make sure they are 
 compatible with your own version of the code.

 In web2py we tried to copied the RoR approach (everything has a 
 configuration) and we try to package and maintain as many components as 
 possible into the same code base (API for authentication, scheduler, cron, 
 PDF printing, SOAP services, WIKI markup, syntax highlighting, etc.). 
 Moreover we do not rely on third party modules (only on Python standard 
 libraries). 99% of what you may want to can be done with basic web2py 
 without needing external packages. This means the apps are very portable 
 between one installation and another.

 The main difference between web2py and other frameworks in practice is 
 not soo much in the its API (which more or less are the same for all 
 frameworks) but for what web2py does for you on the management site: no 
 packages to install, manage through the web interface, no shell programming 
 unless you want to, automatic migrations.

 Massimo



 On 

[web2py] Re: routes.py vs mod_rewrite

2012-07-10 Thread G. Clifford Williams
personally I always go with routes.py

On Tuesday, July 10, 2012 4:51:54 PM UTC-5, Athelionas wrote:

 What is the preferred way of rewriting URLs?
 Also, are there any advantages or disadvantages of choosing one over the 
 other?

 I like the idea of routes.py better because of portability, but is it any 
 good in case of static files?



[web2py] wempy published in the Python Cheese Shop

2012-06-27 Thread G. Clifford Williams
Hey fellow web-2-pirates / web2py-rats. Just thought I'd share with you the
fact that I've hijacked the template engine from web2py and made a command
line utility similar to Ruby's ERB. I've also stripped down the library a
removed gluon integration wrappers and HTML escaping to make it a generally
useful library outside of web2py.

This is a separate project and not a part of web2py. I'm not trying to
replace the template engine….just make use of it from the command line and
make it easier to use in other projects.


currently on the list of todos for the wempy shell utility:


   - add a switch for passing environment variables from the shell to the
   execution context for templates
   - add recursive processing of a directory
   - add an output extension to batch process files

Todo's for the wemplate library:

   - Try to improve speed (Thadeus already had a very lean approach so
   there may not be much I can do here)
   - extend to facilitate batch processing with multiple contexts


Any feed back you have would be greatly appreciated.

packages.python.org: http://pypi.python.org/pypi/wempy
home page: http://www.wempy.org


Re: [web2py] Re: failures

2012-06-01 Thread G. Clifford Williams
As I used to have a (zope) hosting business I have spare capacity on my 
servers (actual hardware that I own) where I host mirrors for cherokee, 
linuxmint, and pc-bsd. I'd be more than happy to host or mirror web2py.com. 
My servers are currently in CA, FL, and CO but CA will likely be migrated 
to IL. let me know… 



On Friday, June 1, 2012 10:22:04 PM UTC-5, Massimo Di Pierro wrote:

 I am for it, as long as we have a policy and scripts do make sure the 
 VERSION and the web2py*.zip are in sync. There are many apps on web2py.com. 
 Some of them cannot easily be mirrored but can be given subdomains and do 
 not need to be up 100%.

 On Friday, 1 June 2012 15:52:55 UTC-5, mcm wrote:

 Should we have global mirrors of web2py.com? 
 IMHO we should and we should also have a geo dns service with a server 
 like http://geoipdns.org/ 

 mic 

 2012/6/1 LightDot light...@gmail.com: 
  If you need a mirror quickly, I can give you a full VPS on a 100 Mbit 
 line. 
  I have space on a new hardware we recently put into service (EU 
 colocation). 
  
  
  On Friday, June 1, 2012 4:53:03 PM UTC+2, Massimo Di Pierro wrote: 
  
  Today the VPS that hosts web2py.com failed (not sure what but I can 
 no 
  longer ssh into it). Is to happens that yesterday the HD of my laptop 
  failed. My office mac is no longer syncing emails with outlook and 
 gmail. A 
  few other random and independent things have been failing on me in the 
 last 
  few days. I just wanted to reassure you that things will be taken care 
 of 
  and web2py.com is a priority. I may be a little slow on this list as 
 a 
  result. 
  
  Massimo 



[web2py] Problem with basic_login actually logging in (maybe not a bug)

2012-05-31 Thread G. Clifford Williams
Given the following code snippet in a controller (default or any other): 

auth.settings.allow_basic_login = True
def howdy():
auth.settings.allow_basic_login = True
response.view = 'generic.json'
if auth.user:
this_user = auth.user.id
else:
this_user = unset
return dict(user=this_user)
if the controller action is called as such:
% curl --user 't...@somewhere.com:supersecretpassword' 
http://127.0.0.1:8000/myapp/controller/howdy  

this response you'll get it this: 
{user: unset} 

The same goes for using auth.is_logged_in(): 

The result is different, however, when you use one of the 'requires' 
decorators: 

auth.settings.allow_basic_login = True

def howdy():
auth.settings.allow_basic_login = True
@auth.requires_login()
def proforma():
pass #empty function just to invoke auth.requires
proforma() #call empty function
response.view = 'generic.json'
if auth.user:
this_user = auth.user.id
else:
this_user = unset
return dict(user=this_user)
this results in:
% curl --user 't...@somewhere.com:supersecretpassword' 
http://127.0.0.1:8000/myapp/controller/howdy  
{user: 1}  

After some digging I discovered that in tools.py auth.requires_* ends up 
calling login_bare which is why the second one works. I realize that 
according to the book (
http://web2py.com/books/default/chapter/29/9?search=login_bare) 
 login_bare() can be called to login the user manually. Unfortunately the 
examples for auth.settings.allow_basic_login in the manual/book 
(http://web2py.com/books/default/chapter/29/9#Access-Control-and-Basic-Authentication
 
, http://web2py.com/books/default/chapter/29/9#Settings-and-messages ,  
http://web2py.com/books/default/chapter/29/10#Access-Control) don't address 
the fact that no login is actually executed without the decorators. With 
the last example if someone wanted to use that as a guide they might think 
that changing: 

@auth.requires_login()
@request.restful()
def api():
   def GET(s):
   return 'access granted, you said %s' % s
   return locals()

to: 


@request.restful()
def api():
   def GET(s):

   if auth.is_logged_in():
   return 'access granted, you said %s' % s

   else:

   return 'access denied'
   return locals()


Should work, but they would be mistaken (and likely to spend much time 
trying to figure out why one worked and the other did not). I don't know 
whether it was the intention that using basic auth prevent a call to log 
the user in by default. It seems that either the code should be fixed or we 
should update the documentation to clarify that login_bare() should be 
called explicitly (directly or indirectly) to actually execute the login 
process. 



[web2py] problem(s) with JSON and ReST engine example

2012-05-28 Thread G. Clifford Williams
I was migrating some of the ReST APIs that I'd hand-rolled over to the 
new(?) ReST facilities in web2py and noticed while going through the 
examples (http://web2py.com/books/default/chapter/29/10#Restful-Web-Services) 
that JSON serialization kept failing. I'm using 1.99.7. 

It looks like the problem is all of the functions (lambda and methods) 
attached to each dal object passed to the view:

TRACEBACK

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.

Traceback (most recent call last):
  File /Users/prog/web2py/generic/gluon/restricted.py, line 205, in restricted
exec ccode in environment
  File /Users/prog/web2py/generic/applications/resttest/views/generic.json, 
line 2, in module
  File /Users/prog/web2py/generic/gluon/serializers.py, line 61, in json
return json_parser.dumps(value,default=default)
  File 
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py,
 line 238, in dumps
**kw).encode(obj)
  File 
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py,
 line 201, in encode
chunks = self.iterencode(o, _one_shot=True)
  File 
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py,
 line 264, in iterencode
return _iterencode(o, 0)
  File /Users/prog/web2py/generic/gluon/serializers.py, line 37, in 
custom_json
raise TypeError(repr(o) +  is not JSON serializable)
TypeError: function lambda at 0x100e70500 is not JSON serializable

I first wrote a filter to weed out functions which was useful in getting 
the examples to work but was much more involved than required to solve my 
use case. In the end I went with a list comprehension containing only the 
fields that I needed. Instead of: 

  return dict(person = db.person(id))

I used something like:
  return dict([(field,db.person(id)[field]) for field in ['name', 'id', 
'info']])


Has anyone ever gotten the examples working without using such tricks? it 
took a while for me to get from 1.95.x up to 1.99.x so I don't know whether 
my experience is unique or due to a code change. 

Thanks. 




[web2py] Re: problem(s) with JSON and ReST engine example

2012-05-28 Thread G. Clifford Williams
yes. I've set: 
   response.view = 'generic.json'

applications/welcome/views/generic.json (for me) contains only:
{{from gluon.serializers import json}}{{=XML(json(response._vars))}}

Thanks for reminding me of as_dict(), it never even occurred to me to use 
it here. 

On Monday, May 28, 2012 2:47:09 PM UTC-5, Anthony wrote:

 You can do:

 return dict(person = db.person(id).as_dict())

 See http://web2py.com/books/default/chapter/29/6#as_dict-and-as_list.

 Are you using the generic.json view? If so, it passes the returned value 
 to gluon.serializers.json, which should automatically call the as_dict() 
 method of the Row object. Alternatively, you could import 
 gluon.serializers.json and use it directly.

 Anthony

 On Monday, May 28, 2012 2:05:57 PM UTC-4, G. Clifford Williams wrote:

 I was migrating some of the ReST APIs that I'd hand-rolled over to the 
 new(?) ReST facilities in web2py and noticed while going through the 
 examples (
 http://web2py.com/books/default/chapter/29/10#Restful-Web-Services) that 
 JSON serialization kept failing. I'm using 1.99.7. 

 It looks like the problem is all of the functions (lambda and methods) 
 attached to each dal object passed to the view:

 TRACEBACK

 1.
 2.
 3.
 4.
 5.
 6.
 7.
 8.
 9.
 10.
 11.
 12.
 13.
 14.
 15.
 16.

 Traceback (most recent call last):
   File /Users/prog/web2py/generic/gluon/restricted.py, line 205, in 
 restricted
 exec ccode in environment
   File 
 /Users/prog/web2py/generic/applications/resttest/views/generic.json, line 
 2, in module
   File /Users/prog/web2py/generic/gluon/serializers.py, line 61, in json
 return json_parser.dumps(value,default=default)
   File 
 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py,
  line 238, in dumps
 **kw).encode(obj)
   File 
 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py,
  line 201, in encode
 chunks = self.iterencode(o, _one_shot=True)
   File 
 /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/encoder.py,
  line 264, in iterencode
 return _iterencode(o, 0)
   File /Users/prog/web2py/generic/gluon/serializers.py, line 37, in 
 custom_json
 raise TypeError(repr(o) +  is not JSON serializable)
 TypeError: function lambda at 0x100e70500 is not JSON serializable

 I first wrote a filter to weed out functions which was useful in getting 
 the examples to work but was much more involved than required to solve my 
 use case. In the end I went with a list comprehension containing only the 
 fields that I needed. Instead of: 

   return dict(person = db.person(id))

 I used something like:
   return dict([(field,db.person(id)[field]) for field in ['name', 'id', 
 'info']])


 Has anyone ever gotten the examples working without using such tricks? it 
 took a while for me to get from 1.95.x up to 1.99.x so I don't know whether 
 my experience is unique or due to a code change. 

 Thanks. 




Re: [web2py] Re: Authentication for services in iPhone not work

2011-08-10 Thread G. Clifford Williams
Relsi, do you know whether he's developing using Obj-C or a framework like
(Titanium, Corona, LiveCode, etc...)?

I ask because he could use a webview to usher content back and forth from
the network calls to the main meat of his application. This is pretty
trivial with Obj-C, Corona (Lua), and Titanium (JavaScript) but incurs the
expense of loading a full HTML+CSS+JS parsing engine and then loading
objects. The key benefit is that it preserves session (from the client
perspective) just like a desktop browser. Making successive calls would all
be part of one 'session' provided there hasn't been a time out. Timeouts can
be trapped and you could use a call back to log the user back in.

It's just one way to solve that problem.


On Wed, Aug 10, 2011 at 4:48 PM, Massimo Di Pierro 
massimo.dipie...@gmail.com wrote:

 Look at the source of the decorator in gluon/tools.py. It should be
 trivial to change it and take the username:password from a
 request.vars or from a request.env



 On Aug 10, 4:35 pm, Relsi Hur relsi.ram...@gmail.com wrote:
  Anyone else? =)
 
  any tips on how to pass the username and password as parameters of the
  method and continue using the decorator?
 
  On Aug 10, 3:56 am, Relsi Hur relsi.ram...@gmail.com wrote:
 
 
 
 
 
 
 
   Yes, the objective-C suport xml-rpc, but the developer says that
 theiphonedoes not work the wire formathttps://username:password@my_server
 /my_app/service/call/xmlrpc.
   I do not work with the platform iOS, so I do not know the
   particularities of the platform, I do not want is having to stop using
   the web2py decorators only to have to answer a specific platform. If
   someone has already developediPhonecan give a hint about it, I thank
   you very much.
 
   On Aug 10, 3:34 am, Christopher Steel chris.st...@gmail.com wrote:
 
I have not tried xml-rpc on theiphonebut apparently Wordpress has
 some
   iphonexmlrpc examples...
 
   http://stackoverflow.com/questions/147062/does-iphone-support-xml-rpc
 
Let us know how it goes!
 
C.



Re: [web2py] Re: Proposals for New Tagline

2011-03-23 Thread G. Clifford Williams
Thank you Adam, I agree.

*apologies for the late follow up*

On Mon, Mar 21, 2011 at 06:23:37AM -0700, AdamF spake:
 Hi,
 
 I've read all the discussion about the tagline... and unfortunately I cannot 
 agree with most of the votes. But maybe it's because I am coming from 
 enterprise world and I have a different perspective...
 
 For me if you put enterprise in the tagline that means only a few things; 
 it's a mature, production-ready, stable and high quality, proven software. 
 Thats because enterprise companies avoid investing in betas or experimental 
 solutions - they do prefer a stable, proven software even if it's not so 
 cheap.
 
 So if you want to attract developers like me - people with enterprise 
 experience - leave this word in tagline. Otherwise they will choose Django 
 only because it's more popular... 
 
 Personally I would think about tagline that shows 3 points: enterprise 
 quality and stability, agile development, fast learning
 
 Regards
 
 Adam


Re: [web2py] Re: Flourish Conf 2011 (Chicago Area)

2011-03-22 Thread G. Clifford Williams
I'd love to help.

--G. Clifford Williams
Sent from some mobile device

On Mar 22, 2011, at 12:11 AM, Massimo Di Pierro massimo.dipie...@gmail.com 
wrote:

 I was planning to be there. Can you help?
 
 Massimo
 
 On Mar 21, 9:39 pm, G. Clifford Williams g...@notadiscussion.com
 wrote:
 Anyone planning on attending Flourish Conf '11?
 Unfortunately it doesn't look like they have any Python speakers this year 
 but apparently there will be tables for both Web2Py and ChiPy
 
 Massimo, who's manning the table?
 
 http://www.flourishconf.com/2011/miniexpo


[web2py] Flourish Conf 2011 (Chicago Area)

2011-03-21 Thread G. Clifford Williams
Anyone planning on attending Flourish Conf '11?
Unfortunately it doesn't look like they have any Python speakers this year but 
apparently there will be tables for both Web2Py and ChiPy

Massimo, who's manning the table?

http://www.flourishconf.com/2011/miniexpo


Re: [web2py] Another jerk!

2011-03-14 Thread G. Clifford Williams
The ignorant will always be willing to offer an [ill,un]informed opinion. 

Just lets me know I need to really get to work on that demonstration project.

On Mon, Mar 14, 2011 at 01:32:16PM -0700, Massimo Di Pierro spake:
 http://www.reddit.com/r/Python/comments/g3th5/best_python_framework_for_web_app_and_restful/c1kpytm


Re: [web2py] Re: Another jerk!

2011-03-14 Thread G. Clifford Williams
As someone who's developed several web2py appications for 'enterprise' clients, 
I can only say that the managers who don't know any better do actually notice 
the presence of that particular adjective. It helps get web2py past the 
buzz-word filter.

I've had a client tell me that my application ...felt more stable... when 
they had me rewrite it from ... that shell script thing.. to Java. All I'd 
done was redeploy from Python to Jython and connected it to their Oracle DBMS 
instead of using SQLite. To some, any type of 'scripting' is not 'business 
class'.

On Mon, Mar 14, 2011 at 10:17:03PM -0300, rochacbruno spake:
 I would like to drop the enterprise, because translated to portuguese this 
 means empresarial which is corporated just like Java. 
 
 I like just: 
 Web2py - the web framework to get things done!
 
 
 
 Enviado via iPhone
 
 Em 14/03/2011, às 22:06, pbreit pbreitenb...@gmail.com escreveu:
 
  Agreed. enterprise is it bit odd here.


Re: [web2py] Sqlite3 error

2011-02-21 Thread G. Clifford Williams
On Sun, Feb 20, 2011 at 12:00:42PM -0800, Felipe AP spake:
 None of my web2py apps are working anymore. I'm getting this error.
 What can I do about it? Please answer. Thanks!
 
 Traceback (most recent call last):
   File /home/felipe/web2py/gluon/restricted.py, line 188, in
 restricted
 exec ccode in environment
   File /home/felipe/web2py/applications/welcome/models/db.py, line
 16, in module
 db = DAL('sqlite://storage.sqlite')   # if not, use SQLite or
 other DB
   File /home/felipe/web2py/gluon/dal.py, line 3357, in __init__
 raise RuntimeError, Failure to connect, tried 5 times:\n%s %
 error
 RuntimeError: Failure to connect, tried 5 times:
 global name 'sqlite3' is not defined

What operating system are you on?

what's the output of which -a python


[web2py] plugin_wiki Menu (active flag)

2011-02-12 Thread G. Clifford Williams

I'm playing around with plugin_wiki and can't seem to figure out how to set a 
menu item's active flag if it infact corresponds to the page that's being 
accessed. 

Any ideas

TIA

--Cliff


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread G. Clifford Williams
On Sat, Feb 12, 2011 at 09:20:02AM -0800, Jonathan Lundell spake:
 Is there a trick to getting web2py to run locally with the GAE Launcher? (OS 
 X FWIW)
 
 I'm playing with the stock stable release. It works fine when deployed, but 
 not locally (immediate ticket, and I don't know how to find the ticket).

web2py tickets are generated as datastore objects. You won't be able to search 
the datastore for objects until it's been seeded (which just means that 
something has to be there before you can search for it). To view the tickets go 
to: http://localhost:[port]/_ah/admin/datastore

there you will see a dropdown list for Entity Kind select the one labeled 
web2py_ticket_[appname] then click 'list entries'. These are your tickets


I hope that helps





Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread G. Clifford Williams
1) can you paste your app.yaml/

2)  you should have some code like this in your main model file:
if request.env.web2py_runtime_gae:# if running on Google App 
Engine
db = DAL('gae')   # connect to Google BigTable
session.connect(request, response, db=db) # and store sessions and 
tickets th
else: # else use a normal 
relational database
db = DAL('sqlite://gripez.db') 

3) you probably want to link 'applications/your_app_name' to 'init' or use one 
of the other remedies for having your app be the default. More info here: 
http://web2py.com/book/default/chapter/04#Application-init

On Sat, Feb 12, 2011 at 09:43:08AM -0800, Jonathan Lundell spake:
 On Feb 12, 2011, at 9:29 AM, G. Clifford Williams wrote:
  
  On Sat, Feb 12, 2011 at 09:20:02AM -0800, Jonathan Lundell spake:
  Is there a trick to getting web2py to run locally with the GAE Launcher? 
  (OS X FWIW)
  
  I'm playing with the stock stable release. It works fine when deployed, 
  but not locally (immediate ticket, and I don't know how to find the 
  ticket).
  
  web2py tickets are generated as datastore objects. You won't be able to 
  search the datastore for objects until it's been seeded (which just means 
  that something has to be there before you can search for it). To view the 
  tickets go to: http://localhost:[port]/_ah/admin/datastore
  
  there you will see a dropdown list for Entity Kind select the one labeled 
  web2py_ticket_[appname] then click 'list entries'. These are your tickets
  
  
  I hope that helps
 
 Also, I see that the Launcher's SDK Console toolbar button takes me there; I 
 just didn't know what I was looking for.
 
 FWIW, I'm seeing this:
 
 S'Traceback (most recent call last):\n  
 File /Users/jlundell/Projects/GAE/welcome/gluon/restricted.py, line 188, in 
 restricted\nexec ccode in environment\n 
 File 
 /Users/jlundell/Projects/GAE/welcome/applications/admin/controllers/default.py:ticket,
  line 1159, in module\n  
 File /Users/jlundell/Projects/GAE/welcome/gluon/globals.py, line 95, in 
 lambda\nself._caller = lambda f: f()\n  
 File 
 /Users/jlundell/Projects/GAE/welcome/applications/admin/controllers/default.py:ticket,
  line 1124, in ticket\n  
 File /Users/jlundell/Projects/GAE/welcome/gluon/restricted.py, line 162, in 
 load\nself.layer = d[\'layer\']\nTypeError: \'NoneType\' object is 
 unsubscriptable\n'
 
 ...which looks like an error loading a ticket, unfortunately.


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread G. Clifford Williams
On Sat, Feb 12, 2011 at 10:28:52AM -0800, Jonathan Lundell spake:
 On Feb 12, 2011, at 10:10 AM, G. Clifford Williams wrote:
  
  1) can you paste your app.yaml/
 
*snip*
 
 builtins:
 - remote_api: on
 - datastore_admin: on
 
  
  2)  you should have some code like this in your main model file:
 if request.env.web2py_runtime_gae:# if running on Google App 
  Engine
 db = DAL('gae')   # connect to Google 
  BigTable
 session.connect(request, response, db=db) # and store sessions and 
  tickets th
 else: # else use a normal 
  relational database
 db = DAL('sqlite://gripez.db') 
 
 For now, it's just the stock welcome app, so it has that logic.
 
 And it works OK when deployed to GAE; it's just running it locally that 
 breaks.
 
  3) you probably want to link 'applications/your_app_name' to 'init' or use 
  one of the other remedies for having your app be the default. More info 
  here: http://web2py.com/book/default/chapter/04#Application-init
 
 Being welcome, it's the default in the absence of an app named init.
 

If it's the stock app (unmodified in anyway) and you just added it to the GAE 
then when you go to http://localhost:[port]/ you should see Hello World

What version of web2py are you trying this with? I've just confirmed this with 
my install of 1.91.6


*snip*


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread G. Clifford Williams
On Sat, Feb 12, 2011 at 11:11:16AM -0800, Jonathan Lundell spake:
 On Feb 12, 2011, at 10:37 AM, G. Clifford Williams wrote:
  
  If it's the stock app (unmodified in anyway) and you just added it to the 
  GAE then when you go to http://localhost:[port]/ you should see Hello 
  World
  
  What version of web2py are you trying this with? I've just confirmed this 
  with my install of 1.91.6
 
 I think I must have fat-fingered something. I reinstalled 1.91.6 and it works 
 fine now.
 
 Thanks.
 

Awesome.. I'm glad to hear it


Re: [web2py] web2py and GoogleAppEngineLauncher

2011-02-12 Thread G. Clifford Williams
On Sat, Feb 12, 2011 at 01:33:00PM -0800, rif spake:
 Shoud these steps work?
 
 - download google app engine
 - download web2py
 - run ./dev_appserver.py ../web2py/
 - go to http://localhost:8080
 
 Should it display the welcome app?
 I am on a fedora system with python 2.7 and it doesn't (it gives me an long 
 stacktrace). Is it because of python version?

Depends on the version of GAE you're running. Support for python 2.7 was added 
very recently and may still be beta (not sure on this).

I've never used GAE SDK on Linux so I'm not sure how it works there. On OS X 
you start the GAE Launcher and add your application to the launcher via a gui 
then start it by clicking on a run button. 


Re: [web2py] Getting Started...

2010-12-25 Thread G. Clifford Williams
David, well you won't get very far that way. If you want to do things on the 
command line you can do the following: 
1) Download the zip file
2) Unzip the archive and either launch the web2py.app from the finder or 
use 'open path to web2py.app' on the command line
   ( This should be done once to initialize  your instance and put certain 
things in order. )
3) cd to path to web2py.app/Contents/Resources/applications
4) do 'cp -Rp ./welcome ./your app name' 
5) cd to ./your app name
6) edit to your delight
7) profit

web2py doesn't look in ''the web2py root'' for apps to run. If you want your 
app to be the default app run for a particular instance of web2py you can link 
it to ./applications/init. 

I hope that was helpful


On Sat, Dec 25, 2010 at 11:51:18PM -0500, David J. spake:
 On a mac;
 
 I was wondering if Could just create a folder in the web2py root and
 start from there?
 
 
 On 12/25/10 11:47 PM, pbreit wrote:
 On Mac or windows, just double-click the app. Maybe on *nix as well. Best to 
 create the project in admin but after that you can do *all* of your editing 
 in text editor.
 
 


Re: [web2py] Re: Accessing filename from upload field in onvalidation call

2010-12-12 Thread G. Clifford Williams
Thanks Massimo, Mr. Freeze and Weheh. In the end I just used 
form.vars.file.file.read(15) to make sure it was a SQLite file to begine with. 
At first I'd neglected to followup with a form.vars.file.file.seek(0) to reset 
the read position in the file. It's pretty important to remember that piece


Thanks again.

On Sun, Dec 05, 2010 at 06:22:54PM -0800, mdipierro spake:
 from python you can read the file content with
 form.vars.file.file.read()
 
 On Dec 5, 8:16 pm, mr.freeze nat...@freezable.com wrote:
  Onvalidation is called before the file is stored on disk. You can
  define a custom_store method on the field to control how and where it
  is stored. I don't know of a way to open the file with sqlite from the
  cgi FieldStorage object form.vars.file.
 
  On Dec 5, 7:11 pm, G. Clifford Williams g...@notadiscussion.com
  wrote:
 
   I have a project that requires users to upload transaction files. These 
   files
   are sqlite databases created with a desktop application. I'm trying to 
   figure
   out a way to ensure that the files uploaded by the various users are 
   infact
   valid transaction files from the proper version of the appropriate 
   application.
   Since they are sqlite3 this _should_ be pretty easy with Python.
 
   I've crated an onvalidation function that can pass off parameters to 
   another
   function that checks for the appropriate fields in the transaction file. 
   The
   problem is that I can't seem to get the name of the uploaded file as a 
   string
   that I can pass along to transaction_test().
 
   My question(s):
       How can I access the name of the file (as stored on disk)?
       Is the name of the file only accessible after the form has been 
   accepted?
 
   model:
   ...
   db.define_table('transaction',
       Field('property', 'string',
           requires=IS_MATCH('^[\w.-]{2,32}$',
               error_message = 'Invalid characters')),
       Field('owner', db.auth_user, default=auth.user_id,
           readable=False, writable=False,),
       Field('visibility', 'boolean', label='List publicly', default=True),
       Field('description', 'text'),
       Field('created_on', 'datetime', readable=True, writable=False,),
       Field('file', 'upload', uploadseparate=True),
       )
 
   controller:
   ...
   @auth.requires_login()
   def create():
       mechanism = request.args(0)
       if mechanism == 'upload':
           message = Upload your Transaction
           db.transaction.file.writable=True
           db.transaction.file.readable=True
           form = crud.create(db.transaction, onvalidation=upload_proc)
       else:
           message = Create a new Transaction
           db.transaction.file.writable=False
           db.transaction.file.readable=False
           form = crud.create(db.transaction, onvalidation=scratch_proc)
       return dict(message=T(message), form=form)
 
   def upload_proc(form):
       form.vars.created_on = request.now #set time stamp properly
       print form.vars.file.filename
       if transaction_test(form.vars.file):
           import os.popen2
           popen2(transaction_BIN+' rebuild '+ form.vars.file)
       else:
           form.errors.file = File is not a valid transaction repo
   ...
 
   def transaction_test(transaction_file):
       #simple test to see whether 'transaction_file' is actually a sqlite3 
   database
       #with some key tables required for transactions from (REDACTED)
       import sqlite3
       dbobj = sqlite3.connect(str(transaction_file.upload))
       dbcursor = connection.cursor()
       query_string = SELECT name FROM sqlite_master WHERE type='table' AND 
+\
                       name='receiver' OR name='bursar' OR name='clagent'  
   +\
                       name='lbroker' OR name='bbroker' OR name='loc';
       dbcursor.execute(query_string)
       rows_returned = len(db.fetchall())
   ...
 
   Thanks in advance...
   --Cliff
 
 


[web2py] getting the full path to uploaded files

2010-12-12 Thread G. Clifford Williams

Is ther a prescribed mechanism for getting the full path to uploaded files?

I've got an onaccept function that contains:
 os.symlink(os.path.join(request.folder,'uploads',
form.vars.file_newfilename), link_path)

which worked until I'd changed the field to use 'uploadseparate=True'

Thanks in advance
--Cliff


Re: [web2py] Re: it case you missed it...

2010-12-11 Thread G. Clifford Williams
 I hope so. A different license would certainly help with my fight for adoption 
by a few clients

On Fri, Dec 10, 2010 at 06:31:15PM -0800, pbreit spake:
 Did I read correctly that you might evaluate Web2py's license? It does
 seem like GPL could potentially discourage usage since it makes the
 code harder to modify. That might be why very few frameworks are GPL:
 http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks


Re: [web2py] Re: it case you missed it...

2010-12-11 Thread G. Clifford Williams
Thanks I appreciate that and I'll surely take you up on that it I think it'll 
help me win one of these battles.

The bottom line is that many commercial entities frown on GPL licensed 
software. Legal departments go ape when someone brings in new software and 1) 
it's free and 2) it's GPL'd. 
For one particular client I'd built a front-end management interface to some 
system configs (firewalls, software packages, etc... ). This was something they 
were distributing to their clients as part of a bundle. When told that it would 
be built with a Python web framework, they assumed it would be Django. When I 
was done with it and had turned in my documentation they had a fit. I got calls 
from the CTO asking why I would put them in such a position. They didn't know 
whether I'd modified anything that was ...part of web2py, and if I had they 
wanted to know whether it was ...configuration or code.  The only GPL'd apps 
they ship to customers are compiled binaries. They wanted me to 'decouple' what 
I'd done and submit it for review by their one internal python guy so that he 
could determine whether anything in my code was 'stolen' from web2py.

I was asked to rewrite everything in Django, Pylons or RoR. 

I'm not saying they were either right or wrong. It's just an ongoing battle and 
one more headache that I could really do without. 

On Sat, Dec 11, 2010 at 08:17:23AM -0800, mdipierro spake:
 are you talking about the web2py license? Why would a client care?
 Web2py imposes no restriction on their code. I an write a letter to
 this effect if at all necessary.
 
 Massimo
 
 On Dec 11, 10:11 am, G. Clifford Williams g...@notadiscussion.com
 wrote:
   I hope so. A different license would certainly help with my fight for 
  adoption by a few clients
 
  On Fri, Dec 10, 2010 at 06:31:15PM -0800, pbreit spake:
 
   Did I read correctly that you might evaluate Web2py's license? It does
   seem like GPL could potentially discourage usage since it makes the
   code harder to modify. That might be why very few frameworks are GPL:
  http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks
 
 


Re: [web2py] Re: new dal

2010-12-07 Thread G. Clifford Williams
Is VoltDB supported?

Sent from some mobile device

On Dec 7, 2010, at 2:09 PM, Bruno Rocha rochacbr...@gmail.com wrote:

 MongoHQ can be useful for testing, they offer a free limited instance
 
 https://mongohq.com/pricing
 
 
 
 2010/12/7 mdipierro mdipie...@cs.depaul.edu
 I run some benchmarks. The time to do insert and select is the same.
 The difference it no measurable because dominated by db IO. Anyway the
 code is below and the output is:
 
 old dal:
 7.98740386963e-05 (sec)
 0.00134269499779
 
 new dal:
 8.04572105408e-05
 0.00139242005348
 
 Notice all the time is in the IO. The time to actually parse the
 complex query is negligible.
 
 
 code:
 import os
 os.system('rm *.sqlite test* *.table sql.log')
 
 #from dal import
 *
 from sql_old import *
 db=DAL('sqlite://test.sqlite')
 db.define_table('person',Field('name'))
 db(db.person).delete()
 db.commit()
 
 import time
 
 def t(f,n=1000):
t0=time.time()
for i in range(n): f()
return (time.time()-t0)/n
 
 def a():
db.person.insert(name='max')
 def b():
db((db.person.name=='max')(db.person.name.like('max
 %'))(db.person.name.startswith('m'))).select(limitby=(0,20))
 
 print t(a)
 print t(b)
 
 
 
 
 -- 
 
 Bruno Rocha
 http://about.me/rochacbruno/bio


Re: [web2py] Re: new dal

2010-12-06 Thread G. Clifford Williams
I can donate a couple of FreeBSD jails with various databases setup if you let 
me know what you want.

--G. Clifford Williams
Sent from some mobile device

On Dec 6, 2010, at 4:38 PM, mdipierro mdipie...@cs.depaul.edu wrote:

 With the new DAL it should take very little to create a DAL interface
 to mongodb, couchdb, etc.
 
 I can work on this if
 - you help me prioritize
 - you can give me access to a machine that already has your favorite
 nosql db installed ready for testing
 
 Massimo
 
 
 On Dec 6, 3:10 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Dec 6, 2010, at 12:55 PM, mdipierro wrote:
 
 
 
 1) The new DAL (dal.py) passes all the tests I have.
 2) The new DAL has integrated GAE support (datastore) without need for
 contrib/gql.py
 3) The new DAL is better because more customizable, smaller (10%), and
 more readable
 4) The new DAL is one single file and it does not depend on web2py.
 
 Have you decided to keep it as a single file, or break it into a package?


Re: [web2py] Re: new dal

2010-12-06 Thread G. Clifford Williams
You got it.

BTW, anyone else interested in ZODB support? It's not the new fangled toy that 
these NoSQL databases are but it's still awesome. 

--G. Clifford Williams
Sent from some mobile device

On Dec 7, 2010, at 12:23 AM, mdipierro mdipie...@cs.depaul.edu wrote:

 I got CouchDB working. Denes is working on MongoDB. I think we are
 setup for December. In January, you could provide a Cassandra
 server. ;-)
 
 massimo
 
 On Dec 7, 12:19 am, G. Clifford Williams g...@notadiscussion.com
 wrote:
 I can donate a couple of FreeBSD jails with various databases setup if you 
 let me know what you want.
 
 --G. Clifford Williams
 Sent from some mobile device
 
 On Dec 6, 2010, at 4:38 PM, mdipierro mdipie...@cs.depaul.edu wrote:
 
 With the new DAL it should take very little to create a DAL interface
 to mongodb, couchdb, etc.
 
 I can work on this if
 - you help me prioritize
 - you can give me access to a machine that already has your favorite
 nosql db installed ready for testing
 
 Massimo
 
 On Dec 6, 3:10 pm, Jonathan Lundell jlund...@pobox.com wrote:
 On Dec 6, 2010, at 12:55 PM, mdipierro wrote:
 
 1) The new DAL (dal.py) passes all the tests I have.
 2) The new DAL has integrated GAE support (datastore) without need for
 contrib/gql.py
 3) The new DAL is better because more customizable, smaller (10%), and
 more readable
 4) The new DAL is one single file and it does not depend on web2py.
 
 Have you decided to keep it as a single file, or break it into a package?
 
 


[web2py] Accessing filename from upload field in onvalidation call

2010-12-05 Thread G. Clifford Williams

I have a project that requires users to upload transaction files. These files
are sqlite databases created with a desktop application. I'm trying to figure
out a way to ensure that the files uploaded by the various users are infact
valid transaction files from the proper version of the appropriate application.
Since they are sqlite3 this _should_ be pretty easy with Python. 

I've crated an onvalidation function that can pass off parameters to another
function that checks for the appropriate fields in the transaction file. The
problem is that I can't seem to get the name of the uploaded file as a string
that I can pass along to transaction_test().

My question(s):
How can I access the name of the file (as stored on disk)?
Is the name of the file only accessible after the form has been accepted?

model:
...
db.define_table('transaction', 
Field('property', 'string', 
requires=IS_MATCH('^[\w.-]{2,32}$',
error_message = 'Invalid characters')),
Field('owner', db.auth_user, default=auth.user_id,
readable=False, writable=False,),
Field('visibility', 'boolean', label='List publicly', default=True),
Field('description', 'text'),
Field('created_on', 'datetime', readable=True, writable=False,),
Field('file', 'upload', uploadseparate=True),
)

controller:
...
@auth.requires_login()
def create():
mechanism = request.args(0)
if mechanism == 'upload':
message = Upload your Transaction
db.transaction.file.writable=True
db.transaction.file.readable=True
form = crud.create(db.transaction, onvalidation=upload_proc)
else:
message = Create a new Transaction
db.transaction.file.writable=False
db.transaction.file.readable=False
form = crud.create(db.transaction, onvalidation=scratch_proc)
return dict(message=T(message), form=form)


def upload_proc(form):
form.vars.created_on = request.now #set time stamp properly
print form.vars.file.filename
if transaction_test(form.vars.file):
import os.popen2
popen2(transaction_BIN+' rebuild '+ form.vars.file)
else:
form.errors.file = File is not a valid transaction repo
...

def transaction_test(transaction_file):
#simple test to see whether 'transaction_file' is actually a sqlite3 
database
#with some key tables required for transactions from (REDACTED)
import sqlite3
dbobj = sqlite3.connect(str(transaction_file.upload))
dbcursor = connection.cursor()
query_string = SELECT name FROM sqlite_master WHERE type='table' AND  +\
name='receiver' OR name='bursar' OR name='clagent'  +\
name='lbroker' OR name='bbroker' OR name='loc';
dbcursor.execute(query_string)
rows_returned = len(db.fetchall())
...



Thanks in advance...
--Cliff


Re: [web2py] Re: newline character in text string fields on GAE

2010-04-28 Thread G. Clifford Williams
Well what I HAD meant was that on GAE wherever I'd supplied a newline char as 
input I'd see an odd encoding in the storage file. When I queried the database 
I didn't see the newline in the response. Now I realize how silly I was. When I 
run the same code against sqlite I see the literal newline chars and that 
created an errant presumption.  My apologies for the false alarm.


On Apr 27, 2010, at 1:18 AM, mdipierro wrote:

 What do you mean exactly you get no new line?
 
 1) you cannot insert strings containing new lines
 2) the new lines disapper when you extract the data (get replaced by
 something else?)
 3) you do not see the newline when you display the field values (are
 you sure this is not an escaping issue '\n' vs 'br/'?)
 
 does it behave differently on GAE vs non-GAE?
 
 Massimo
 
 On Apr 26, 11:35 pm, G. Clifford Williams g...@notadiscussion.com
 wrote:
 Had:
Field('content', 'text',  length=1500, requires=IS_NOT_EMPTY(),
label='Gripe'),
 and then tried:
Field('content', length=1500, requires=IS_NOT_EMPTY(),
label='Gripe', type='text'),
 
 in both cases I get no 'new line' characters.
 
 (running 1.76.5)
 
 On Apr 23, 2010, at 9:20 PM, mdipierro wrote:
 
 Should be the default behavior? Probably yes.
 
 Meanwhile you can use Field(type='text')
 
 On Apr 23, 8:24 pm, G. Clifford Williams g...@notadiscussion.com
 wrote:
 according 
 tohttp://code.google.com/appengine/docs/python/gettingstarted/usingdata...need
  to use multiline=True to get strings to behave with newline chars on GAE. 
 Is there a prescribed mechanism by which we accomplish this in web2py?
 
 --
 Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en



Re: [web2py] Re: newline character in text string fields on GAE

2010-04-26 Thread G. Clifford Williams
Had: 
   Field('content', 'text',  length=1500, requires=IS_NOT_EMPTY(),
   label='Gripe'),
and then tried:
   Field('content', length=1500, requires=IS_NOT_EMPTY(),
   label='Gripe', type='text'),


in both cases I get no 'new line' characters.

(running 1.76.5) 


On Apr 23, 2010, at 9:20 PM, mdipierro wrote:

 Should be the default behavior? Probably yes.
 
 Meanwhile you can use Field(type='text')
 
 On Apr 23, 8:24 pm, G. Clifford Williams g...@notadiscussion.com
 wrote:
 according 
 tohttp://code.google.com/appengine/docs/python/gettingstarted/usingdata...we 
 need to use multiline=True to get strings to behave with newline chars on 
 GAE. Is there a prescribed mechanism by which we accomplish this in web2py?
 
 --
 Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en



[web2py] newline character in text string fields on GAE

2010-04-23 Thread G. Clifford Williams
according to 
http://code.google.com/appengine/docs/python/gettingstarted/usingdatastore.html 
we need to use multiline=True to get strings to behave with newline chars on 
GAE. Is there a prescribed mechanism by which we accomplish this in web2py?

-- 
Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en


Re: [web2py] Re: creating links to '#blah'

2010-04-21 Thread G. Clifford Williams
awesome thanks!

On Apr 19, 2010, at 9:29 AM, mdipierro wrote:

 NOO!
 
 URL(r=request, f='gripe',anchor=comments,args=gripe.id)
 
 
 
 On Apr 19, 9:12 am, Thadeus Burgess thade...@thadeusb.com wrote:
 You probably want,
 
 XML('#comments', sanitize=False)
 
 --
 Thadeus
 
 On Mon, Apr 19, 2010 at 7:38 AM, G. Clifford Williams
 
 g...@notadiscussion.com wrote:
 I'm trying to figure out how to get links created in web2py that point to 
 an anchor name here is the code I'm using:
 
{{=DIV(SPAN(gripe.created_on, _class='gripe-date'),
A(SPAN(SPAN('Comments:'),
SPAN(gripe.comments, _class='comment-number'),
_class='comment-count'),
_href=URL(r=request, f='gripe',
args=[gripe.id,  
 XML('#comments')] )),
_class='gripe-footer')}}
 
 from this I was hoping to get a link like:
 http://localhost:8081/init/default/gripe/9/#comments
 
 but instead I got :
 http://localhost:8081/init/default/gripe/9/%23comments
 
 I should mention that this is on GAE SDK and I have not tried it standalone 
 (yet).
 
 Any help would be appreciated
 
 --
 Subscription settings:http://groups.google.com/group/web2py/subscribe?hl=en



[web2py] creating links to '#blah'

2010-04-19 Thread G. Clifford Williams
I'm trying to figure out how to get links created in web2py that point to an 
anchor name here is the code I'm using: 

{{=DIV(SPAN(gripe.created_on, _class='gripe-date'), 
A(SPAN(SPAN('Comments:'),
SPAN(gripe.comments, _class='comment-number'),
_class='comment-count'),
_href=URL(r=request, f='gripe',
args=[gripe.id,  
XML('#comments')] )),
_class='gripe-footer')}}
 

from this I was hoping to get a link like: 
http://localhost:8081/init/default/gripe/9/#comments

but instead I got :
http://localhost:8081/init/default/gripe/9/%23comments


I should mention that this is on GAE SDK and I have not tried it standalone 
(yet). 

Any help would be appreciated




-- 
Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en


Re: [web2py] Re: web2py on IDE

2010-04-18 Thread G. Clifford Williams
Vi/Vim mode would be really nice to have, but it's far from trivial to 
implement. 

On Apr 18, 2010, at 12:26 AM, Mengu wrote:

 On 18 Nisan, 04:10, Doug Elkin drelki...@gmail.com wrote:
 Feel free to take these requests with a grain of salt... I know most
 things with development are easier said than done, but these are just
 things I'd really like to see:
 
 When doing tab-completion on web2py functions, I'd like to be able to
 see any other possible variables that can be passed to the function.
 There really isn't much documentation on a few of these, and sometimes
 you have to look up the source code to the function in epydocs to
 really find out the different possible options.
 
 Support for the storage class would be awesome.
 
 As far as the IDE itself goes, a VIM mode would be a final selling
 point for me.
 
 On Apr 16, 7:25 pm, Mengu whalb...@gmail.com wrote:
 
 
 i currently don't know how to do vim mode and never done a research on
 this but i will take a look. your other suggestion is a must so i will
 include it.
 
 
 
 On 18 Nisan, 05:57, Thadeus Burgess thade...@thadeusb.com wrote:
 Instead of Create new file you can have Create Controller/Create
 Model/Create View etc etc.. And it will just make the file in the
 proper place for that framework.
 
 I would also like to see, for web2py, is to have exec/build mapped to
 F5, but for web2py projects it will launch a single instance of
 web2py, and load up your projects as simlinks to applications folder.
 Using Netbeans, each project I have to include web2py folder and the
 project folder, so I have 10 projects all pointing to the same web2py
 folder, it just seems to be a waist.
 
 --
 Thadeus
 
 
 your first suggestion is already done, see at: http://omploader.org/vNDZ1cQ
 
 all web2py apps are in the main web2py folder/applications. so when
 you create a new project, you just select the web2py path and i use
 web2py.py to create the new folder. so you don't have to include
 anything with my IDE. :)
 
 
 -- 
 Subscription settings: http://groups.google.com/group/web2py/subscribe?hl=en



[web2py] online book correction protocol

2010-03-03 Thread G. Clifford Williams
How shall we submit minor (and not so minor) corrections to the online
book?

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: Problem with custom auth fields on BigTable

2010-02-24 Thread G. Clifford Williams
Yep. it works.

Of course, now I've decided to move that chunk to a separate
'profiles' table.  ;-)
In part because I didn't want people to have to supply all of that
upon registration.

Thanks

On Feb 19, 8:01 am, mdipierro mdipie...@cs.depaul.edu wrote:
 On a second though. It does not have to be so complex. web2py should
 just find the table. I modifed the code in trunk and now you can just
 do

 db.define_table('auth_user',...)

 Please check it.

 On Feb 19, 7:49 am, mdipierro mdipie...@cs.depaul.edu wrote:



  The line

   auth_table = db.define_table(

  should be

   auth.settings.table_user = db.define_table(

  so that the following auth.define_tables() knows it is there already.

  On Feb 19, 7:45 am, G. Clifford Williams

  g.clifford.willi...@gmail.com wrote:
   In my app I had:
      auth=Auth(globals(),db)                      # authentication/
   authorization
      auth.define_tables()                         # creates all needed
   tables
      crud=Crud(globals(),db)

   Which worked wonderfully. Then I got the great idea to add some custom
   fields to the auth table(s):

      auth=Auth(globals(),db)                      # authentication/
   authorization
      #custom AUTH stuff
      auth_table = db.define_table(
          auth.settings.table_user_name,
          Field('picture', ),
          Field('web', ),
          Field('bio', ),
      )
      auth.define_tables()                         # creates all needed
   tables
      crud=Crud(globals(),db)

   This prompted the folowing error:
      table already defined: %s\'  % tablename\nSyntaxError: table
   already defined: auth_user\n'

   Normally I'd just drop the table(s) and blow away the sql files under
   'database/', then restart web2py. One GAE I don't have the luxuary of
   such reckless (and effective) behavior. How shall I proceed?

   Thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Problem with custom auth fields on BigTable

2010-02-19 Thread G. Clifford Williams
In my app I had:
   auth=Auth(globals(),db)  # authentication/
authorization
   auth.define_tables() # creates all needed
tables
   crud=Crud(globals(),db)

Which worked wonderfully. Then I got the great idea to add some custom
fields to the auth table(s):

   auth=Auth(globals(),db)  # authentication/
authorization
   #custom AUTH stuff
   auth_table = db.define_table(
   auth.settings.table_user_name,
   Field('picture', ),
   Field('web', ),
   Field('bio', ),
   )
   auth.define_tables() # creates all needed
tables
   crud=Crud(globals(),db)

This prompted the folowing error:
   table already defined: %s\'  % tablename\nSyntaxError: table
already defined: auth_user\n'

Normally I'd just drop the table(s) and blow away the sql files under
'database/', then restart web2py. One GAE I don't have the luxuary of
such reckless (and effective) behavior. How shall I proceed?

Thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: conditional display of elements

2010-02-12 Thread G. Clifford Williams
Thanks.. This is the way implemented it for those wondering:

in the model (db.py):
from gluon.fileutils import check_credentials

in the template (views/layout.html)
{{if response.menu_edit and ( auth.has_membership(1)
or check_credentials(request)) :}}
div class=box
h2 class=title{{=T('Edit This App')}}/h2
div class=content
{{=MENU(response.menu_edit)}}
/div
/div
{{pass}}

Please let me know if you have any suggestions on this usage.

On Feb 11, 10:11 pm, mdipierro mdipie...@cs.depaul.edu wrote:
     import gluon.fileutils

     @auth.requires(auth.user and
 gluon.fileutils.check_credentials(request))
     def 

 On Feb 11, 9:21 pm, G. Clifford Williams



 g.clifford.willi...@gmail.com wrote:
  I'm trying to get a layout page/template to display response.menu_edit
  only if the current user is the web2py admin (read: the admin user
  that has the password set with the -a option on invocation of python
  web2py.py)

  Thanks in advance

  --G. Clifford Williams

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] Re: State of the DAL rewrite

2010-02-11 Thread G. Clifford Williams
is there anyone working on ZODB support?
If not.. is there a style guide for contributors?

On Feb 11, 5:41 pm, mdipierro mdipie...@cs.depaul.edu wrote:
 not yet

 On Feb 11, 1:50 pm, Pystar aitoehi...@gmail.com wrote:



  I would like to know the current state of the DAL rewrite and if it
  now supports NOSQL engines?
  thanks.

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.



[web2py] conditional display of elements

2010-02-11 Thread G. Clifford Williams
I'm trying to get a layout page/template to display response.menu_edit
only if the current user is the web2py admin (read: the admin user
that has the password set with the -a option on invocation of python
web2py.py)

Thanks in advance

--G. Clifford Williams

-- 
You received this message because you are subscribed to the Google Groups 
web2py-users group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.