[tg-trunk] Re: The future of TurboGears

2009-06-23 Thread Neil Tiffin


On Jun 23, 2009, at 3:02 PM, percious wrote:
 On Jun 23, 12:26 pm, Daniel Fetchinson fetchin...@googlemail.com
 wrote:
 I agree that unfortunately TG is lacking in marketing, but if we  
 want
 to have a viable product, the core team needs to focus on the
 technology.

 I sincerely disagree with your statement. I do not think that in  
 order
 to have a viable product the core team needs to focus on  
 technology. I
 think in order to have a viable product the core team needs to  
 focus a
 lot more on documentation/website/infrastructure/marketing/etc even  
 if
 this means less time/resource is available for actual coding
 (technology).

 I think our goals are closer to that of Apple, in opposition to
 Microsoft.  We don't want a Vista on our hand.  Look how well
 marketing helped that project.

If you think that Apple does not put Marketing equal to technology  
then I have a bridge for sale.

Neil

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



[TurboGears] Re: Deploying An Application To Production Finally Solved

2008-03-03 Thread Neil Tiffin

I would like to congratulate all involved in getting this resolved.   
In other projects, I have seen this type of request met with nasty  
comments and  little or no help.  I believe this is a very positive  
part of the TurboGears experience.

Neil
[EMAIL PROTECTED]

On Mar 3, 2008, at 5:42 AM, hoboro wrote:


 Everyone,

 I managed to get my Turbogears application finally working. I would
 like to thank everyone of you who responded to this posting,
 however I would like to offer a special thanks to Christoph Zwerschke
 who was kind enough to update the documents which are located below

 http://docs.turbogears.org/1.0/BehindApache

 Thanks Once Again

 Rohan
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[tg-trunk] Re: crud created controller file have ^M s at the top

2008-01-05 Thread Neil Tiffin

 From the referenced page:

global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Storea  
*.pyc *.pyo
Should that be .DS_Store, no a at the end?
Neil
On Jan 5, 2008, at 4:20 PM, Christopher Arndt wrote:


 dakila schrieb:
 When I tried using crud (paster crud ) I noticed that the file
 generated in controllers directory have ^M somewhere at the top.

 Please, everybody contributing to the TurboGearw SVN repository should
 set up their SVN clients according to:

 http://docs.turbogears.org/patching_guidelines#id3

 Chris

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears Trunk group.
To post to this group, send email to turbogears-trunk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: TG, JSON Safari

2007-03-20 Thread Neil Tiffin

I believe this bug has been around for a while.  I reported it to the  
mail list on Feb 13.  See

See http://groups.google.com/group/turbogears/browse_thread/thread/ 
1dbd3180654cdacf/410703afe29de358

Neil

On Mar 20, 2007, at 11:43 AM, Christopher Arndt wrote:

 expected string or buffer


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: TG, JSON Safari

2007-03-20 Thread Neil Tiffin

I did not create a ticket because I was not sure if the cause was me  
or TG.

Neil

On Mar 20, 2007, at 1:18 PM, AJ wrote:


 Neil,

 Do you know if a ticket was created in TurboGears Trac?

 AJ

 On Mar 20, 5:31 pm, Neil Tiffin [EMAIL PROTECTED] wrote:
 I believe this bug has been around for a while.  I reported it to the
 mail list on Feb 13.  See

 Seehttp://groups.google.com/group/turbogears/browse_thread/thread/
 1dbd3180654cdacf/410703afe29de358

 Neil

 On Mar 20, 2007, at 11:43 AM, Christopher Arndt wrote:

 expected string or buffer


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: Debug Help Dynamic Form (partially solved)

2007-02-16 Thread Neil Tiffin

The problem goes away when I switch from Safari to Firefox using the  
following configuration (which is probably a little different than  
the first configuration, since I deleted and reinstalled everything.)

TurboGears Complete Version Information

TurboGears requires:

* TurboGears 1.0.2dev-r2597
* cElementTree 1.0.5-20051216
* configobj 4.3.2
* RuleDispatch 0.5a0.dev-r2247
* setuptools 0.6c5
* FormEncode 0.6
* PasteScript 1.1
* elementtree 1.2.6
* simplejson 1.3
* CherryPy 2.2.1
* TurboKid 0.9.9
* TurboCheetah 0.9.5
* TurboJson 1.0
* PyProtocols 1.0a0
* Cheetah 1.0
* PasteDeploy 0.9.6
* Paste 1.2.1
* kid 0.9.5
* Cheetah 1.0

Identity Providers

* sqlobject (TurboGears 1.0.2dev-r2597)
* sqlalchemy (TurboGears 1.0.2dev-r2597)

tg-admin Commands

* info (TurboGears 1.0.2dev-r2597)
* shell (TurboGears 1.0.2dev-r2597)
* quickstart (TurboGears 1.0.2dev-r2597)
* update (TurboGears 1.0.2dev-r2597)
* sql (TurboGears 1.0.2dev-r2597)
* i18n (TurboGears 1.0.2dev-r2597)
* toolbox (TurboGears 1.0.2dev-r2597)

Visit Managers

* sqlobject (TurboGears 1.0.2dev-r2597)
* sqlalchemy (TurboGears 1.0.2dev-r2597)

Template Engines

* cheetah (TurboCheetah 0.9.5)
* json (TurboJson 1.0)
* toscawidgets (ToscaWidgets 0.1a2dev-r2605)
* genshi-markup (Genshi 0.3.6)
* genshi-text (Genshi 0.3.6)
* genshi (Genshi 0.3.6)
* kid (TurboKid 0.9.9)

Widget Packages


Toolbox Plugins

* info (TurboGears 1.0.2dev-r2597)
* catwalk (TurboGears 1.0.2dev-r2597)
* shell (TurboGears 1.0.2dev-r2597)
* designer (TurboGears 1.0.2dev-r2597)
* widgets (TurboGears 1.0.2dev-r2597)
* admi18n (TurboGears 1.0.2dev-r2597)

TurboGears Extensions

* visit (TurboGears 1.0.2dev-r2597)
* identity (TurboGears 1.0.2dev-r2597)
* toscawidgets (ToscaWidgets 0.1a2dev-r2605)


On Feb 13, 2007, at 3:21 PM, Neil Tiffin wrote:


 I had an application that was working Jan 30 and now has stopped (I
 also changed from a ppc to intel based mac).  I am using svn 1.0
 branch with toscawidgets.

 The problem seems to be around filling out a SingleSelectField with
 input from json using the instructions for dynamic forms from the web
 site (http://docs.turbogears.org/1.0/RoughDocs/dynamicform). I am not
 intentionally using any unicode, although my default postgresql
 database is utf-8 because of needs of other projects.

 No javascript errors are occurring in the browser, but the dynamic
 update of SingleSelectField(tasks) is not occurring.

 The specific error is:

 Traceback (most recent call last):
File /sw/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/
 cherrypy/_cphttptools.py, line 105, in _run
  self.main()
File /sw/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/
 cherrypy/_cphttptools.py, line 254, in main
  body = page_handler(*virtual_path, **self.params)
File string, line 3, in get_tasks
File /Maui-Dev/turbogears/turbogear/turbogears/controllers.py,
 line 334, in expose
  output = database.run_with_transaction(
File string, line 5, in run_with_transaction
File /Maui-Dev/turbogears/turbogear/turbogears/database.py, line
 302, in so_rwt
  retval = func(*args, **kw)
File string, line 5, in _expose
File /Maui-Dev/turbogears/turbogear/turbogears/controllers.py,
 line 351, in lambda
  mapping, fragment, args, kw)))
File /Maui-Dev/turbogears/turbogear/turbogears/controllers.py,
 line 391, in _execute_func
  return _process_output(output, template, format, content_type,
 mapping, fragment)
File /Maui-Dev/turbogears/turbogear/turbogears/controllers.py,
 line 100, in _process_output
  output = unicodechars.sub(
 TypeError: expected string or buffer

 timeform = TableForm('timeform',
  fields=[
  SingleSelectField('project', label_text=Project Name,
 options=project.build_list('name', project.q.active=='Y')),
  SingleSelectField(person,  label_text=Person Name,
 options=people.build_list('name', orderBy=people.q.name), default=1),
  TextField(days, label_text=Days Charged, default=1.0),
  SingleSelectField(tasks, label_text=Task Name, options=
 [(1,None)] ),
  CalendarDatePicker(wedate, label_text=W/E Date,
 default=find_last_saturday())
  ], action=saveTime, submit_text='Save Time', validator =
 FilteringSchema)

 class Root(controllers.RootController):
  @expose(format='json')
  def get_tasks(self, project_id=None, tg_errors=None):
  return dict(tasks=task.select(task.q.projectID==project_id,
 orderBy=task.q.taskName))

  @expose(template=timesheetweb.templates.timeEntry)
  def timeEntry(self, tg_errors=None):
  cherrypy.session.acquire_lock()
  values = {
  'project': int(cherrypy.session['curProject']),
  'person': int(cherrypy.session['curPerson']),
  'wedate': cherrypy.session['weDate']}
  # log.info(values)

  if tg_errors:
  flash(Data Entry Error!)
  return dict(form=timeform, myValues=values)

 from the kid template
 body

[TurboGears] Could not find form encode?

2007-02-13 Thread Neil Tiffin

Fresh checkout of branch 1.0.

$ python setup.py develop
running develop
running egg_info
writing requirements to TurboGears.egg-info/requires.txt
writing TurboGears.egg-info/PKG-INFO
writing top-level names to TurboGears.egg-info/top_level.txt
writing dependency_links to TurboGears.egg-info/dependency_links.txt
writing entry points to TurboGears.egg-info/entry_points.txt
writing manifest file 'TurboGears.egg-info/SOURCES.txt'
running build_ext
Creating /sw/lib/python2.4/site-packages/TurboGears.egg-link (link to .)
TurboGears 1.1a0 is already the active version in easy-install.pth
Installing tg-admin script to /sw/bin

Installed /Maui-Dev/turbogears/turbogears
Processing dependencies for TurboGears==1.1a0
Searching for FormEncode==dev,=0.6.1dev-r2135
Reading http://www.turbogears.org/preview/download/index.html
Reading http://peak.telecommunity.com/snapshots
Reading http://files.turbogears.org/eggs/
Reading http://cheeseshop.python.org/pypi/FormEncode/
Reading http://formencode.org
Reading http://cheeseshop.python.org/pypi/FormEncode/0.6
No local packages or download links found for  
FormEncode==dev,=0.6.1dev-r2135
error: Could not find suitable distribution for Requirement.parse 
('FormEncode==dev,=0.6.1dev-r2135')

Any solutions?

Neil



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: Could not find form encode?

2007-02-13 Thread Neil Tiffin


On Feb 13, 2007, at 2:02 PM, Christopher Arndt wrote:


 Neil Tiffin schrieb:

 Fresh checkout of branch 1.0.

 $ python setup.py develop
 error: Could not find suitable distribution for Requirement.parse
 ('FormEncode==dev,=0.6.1dev-r2135')

 Any solutions?

 Yes, download and install a matching FormEncode version manually.  
 If you're
 running code from SVN, you should be prepared to encounter and  
 handle such issues.


Sorry, I just noticed that I checked out the wrong branch.  Should  
have been 1.0 not trunk.

Neil




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Debug Help Dynamic Form

2007-02-13 Thread Neil Tiffin

I had an application that was working Jan 30 and now has stopped (I  
also changed from a ppc to intel based mac).  I am using svn 1.0  
branch with toscawidgets.

The problem seems to be around filling out a SingleSelectField with  
input from json using the instructions for dynamic forms from the web  
site (http://docs.turbogears.org/1.0/RoughDocs/dynamicform). I am not  
intentionally using any unicode, although my default postgresql  
database is utf-8 because of needs of other projects.

No javascript errors are occurring in the browser, but the dynamic  
update of SingleSelectField(tasks) is not occurring.

The specific error is:

Traceback (most recent call last):
   File /sw/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/ 
cherrypy/_cphttptools.py, line 105, in _run
 self.main()
   File /sw/lib/python2.4/site-packages/CherryPy-2.2.1-py2.4.egg/ 
cherrypy/_cphttptools.py, line 254, in main
 body = page_handler(*virtual_path, **self.params)
   File string, line 3, in get_tasks
   File /Maui-Dev/turbogears/turbogear/turbogears/controllers.py,  
line 334, in expose
 output = database.run_with_transaction(
   File string, line 5, in run_with_transaction
   File /Maui-Dev/turbogears/turbogear/turbogears/database.py, line  
302, in so_rwt
 retval = func(*args, **kw)
   File string, line 5, in _expose
   File /Maui-Dev/turbogears/turbogear/turbogears/controllers.py,  
line 351, in lambda
 mapping, fragment, args, kw)))
   File /Maui-Dev/turbogears/turbogear/turbogears/controllers.py,  
line 391, in _execute_func
 return _process_output(output, template, format, content_type,  
mapping, fragment)
   File /Maui-Dev/turbogears/turbogear/turbogears/controllers.py,  
line 100, in _process_output
 output = unicodechars.sub(
TypeError: expected string or buffer

timeform = TableForm('timeform',
 fields=[
 SingleSelectField('project', label_text=Project Name,  
options=project.build_list('name', project.q.active=='Y')),
 SingleSelectField(person,  label_text=Person Name,  
options=people.build_list('name', orderBy=people.q.name), default=1),
 TextField(days, label_text=Days Charged, default=1.0),
 SingleSelectField(tasks, label_text=Task Name, options= 
[(1,None)] ),
 CalendarDatePicker(wedate, label_text=W/E Date,  
default=find_last_saturday())
 ], action=saveTime, submit_text='Save Time', validator =  
FilteringSchema)

class Root(controllers.RootController):
 @expose(format='json')
 def get_tasks(self, project_id=None, tg_errors=None):
 return dict(tasks=task.select(task.q.projectID==project_id,  
orderBy=task.q.taskName))

 @expose(template=timesheetweb.templates.timeEntry)
 def timeEntry(self, tg_errors=None):
 cherrypy.session.acquire_lock()
 values = {
 'project': int(cherrypy.session['curProject']),
 'person': int(cherrypy.session['curPerson']),
 'wedate': cherrypy.session['weDate']}
 # log.info(values)

 if tg_errors:
 flash(Data Entry Error!)
 return dict(form=timeform, myValues=values)

from the kid template
body
pTime Form/p
${form(value=myValues)}
/body

Any pointers would be appreciated. What would really help is a  
document that discusses how to debug a TG app when the error is not  
obvious (like above) or a description of what debug options may be  
turned on to provide a better indications of the source of the problem.

Neil


TurboGears Complete Version Information

TurboGears requires:

* TurboGears 1.0.2dev-r2597
* cElementTree 1.0.5-20051216
* configobj 4.4.0
* RuleDispatch 0.5a0.dev-r2247
* setuptools 0.6c5
* FormEncode 0.6
* PasteScript 1.1
* elementtree 1.2.6-20050316
* simplejson 1.5
* CherryPy 2.2.1
* TurboKid 0.9.9
* TurboCheetah 0.9.5
* TurboJson 1.0
* PyProtocols 1.0a0
* Cheetah 2.0rc7
* PasteDeploy 1.1
* Paste 1.2.1
* kid 0.9.5
* Cheetah 2.0rc7

Identity Providers

* sqlobject (TurboGears 1.0.2dev-r2597)
* sqlalchemy (TurboGears 1.0.2dev-r2597)

tg-admin Commands

* info (TurboGears 1.0.2dev-r2597)
* shell (TurboGears 1.0.2dev-r2597)
* quickstart (TurboGears 1.0.2dev-r2597)
* update (TurboGears 1.0.2dev-r2597)
* sql (TurboGears 1.0.2dev-r2597)
* i18n (TurboGears 1.0.2dev-r2597)
* toolbox (TurboGears 1.0.2dev-r2597)

Visit Managers

* sqlobject (TurboGears 1.0.2dev-r2597)
* sqlalchemy (TurboGears 1.0.2dev-r2597)

Template Engines

* kid (TurboKid 0.9.9)
* cheetah (TurboCheetah 0.9.5)
* json (TurboJson 1.0)
* genshi-markup (Genshi 0.3.6)
* genshi-text (Genshi 0.3.6)
* genshi (Genshi 0.3.6)
* toscawidgets (ToscaWidgets 0.1a2dev-r2586)

Widget Packages


Toolbox Plugins

* info (TurboGears 1.0.2dev-r2597)
* catwalk (TurboGears 1.0.2dev-r2597)
* shell (TurboGears 1.0.2dev-r2597)
* designer (TurboGears 1.0.2dev-r2597)
* widgets (TurboGears 1.0.2dev-r2597)
* admi18n (TurboGears 1.0.2dev-r2597)

TurboGears Extensions

* toscawidgets (ToscaWidgets 0.1a2dev-r2586)
* visit (TurboGears 

[TurboGears] Re: Complete docs... API... ever???

2007-02-05 Thread Neil Tiffin

On Feb 5, 2007, at 3:09 AM, Jorge Vargas wrote:

 I'm sorry, but the above is totally ridiculous. To say that just  
 because
 someone is a good enough programmer to start *using* tg that they  
 should
 then also

 you got it totally wrong is not that everyone should be doing what  
 you say below is that too many people are taking and not giving  
 back and in this type of community the giving back should be more  
 then in others since the overall level is higher


I think a major point is being missed.  To write docs you need to (in  
most cases) understand TG.   Furthermore to write good docs one needs  
to understand not only a working way to accomplish some function, but  
the best TG way.

As a casual user and not a python expert I can not read the python  
code and figure out how something supposed to work (at least not  
efficiently).  I do know how to create web pages, I understand simple  
AJAX concepts, I can write simple python code and can write  
Javascript, but TG has too many behind the scenes exciting  
programming features.  Without good integrated docs I too have kind  
of stepped back. Saying see some other projects docs is often very  
confusing for a beginner even if it is the accepted response.  Also,  
in most cases the problem trying to be understood is the glue (which  
is TG) that holds it all together and the interaction between all of  
the other code used in TG.

I though I had found a good productivity enhancer (in TG) for quick  
web-based database apps.  The state of the documentation had negated  
that.  Actually I would say the fact that TG is missing real-world,  
non trivial, integrated, but not complicated examples has negated the  
benefit for me. Although maybe that example is not possible.

  I don't know about others, but for me I am not writing docs because  
I do NOT have the knowledge.  I think this qualifies me as a user  
and not a developer.  If the TG developers do not understand the  
difference, then maybe TG is destined to only be an experienced  
python developers tool instead of a general purpose tool for building  
interactive web applications.  I assumed the latter.

What is the target audience for TG?  General use or Python guru

Neil


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Set SingleSelectField default in form at form display time.

2006-11-06 Thread Neil Tiffin

I am trying to figure out how to set the default in a  
SingleSelectField at render time.

Tried the following:

project_list = project.build_list('name')

project_form = widgets.TableForm(fields=ProjectFields(),  
action=changeProject, submit_text='Change Project')

class ProjectFields(widgets.WidgetsList):
 w_project = widgets.SingleSelectField('w_project',  
label=Project Name, options=project_list)


class Root(controllers.RootController):
 @expose(template=timesheetweb.templates.timeEntry)
 def timeEntry(self, tg_errors=None):
 project_def = {'w_project': 2}

 return dict(project_form=project_form, project_def=project_def)


body
p py:content=project_form(default=project_def)Project Form/p
/body

No errors, but does not work either.

Any ideas?

Neil

--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: Set SingleSelectField default in form at form display time.

2006-11-06 Thread Neil Tiffin

Ian,

Worked like a charm.

Thank you.

Neil

On Nov 6, 2006, at 12:13 PM, Ian Wilson wrote:


 Hello,

 I am pretty sure default is only used at initialization time.  Like  
 this:
 project_form = widgets.TableForm(fields=ProjectFields(),
 action=changeProject, submit_text='Change Project',  
 default=project_def)

 If you want to set the default at display time then you want to set
 the value.
 Something to this effect:
 project_form(value=project_def)

 -Ian

 On 11/6/06, Neil Tiffin [EMAIL PROTECTED] wrote:

 I am trying to figure out how to set the default in a
 SingleSelectField at render time.

 Tried the following:

 project_list = project.build_list('name')

 project_form = widgets.TableForm(fields=ProjectFields(),
 action=changeProject, submit_text='Change Project')

 class ProjectFields(widgets.WidgetsList):
  w_project = widgets.SingleSelectField('w_project',
 label=Project Name, options=project_list)


 class Root(controllers.RootController):
  @expose(template=timesheetweb.templates.timeEntry)
  def timeEntry(self, tg_errors=None):
  project_def = {'w_project': 2}

  return dict(project_form=project_form,  
 project_def=project_def)


 body
 p py:content=project_form(default=project_def)Project  
 Form/p
 /body

 No errors, but does not work either.

 Any ideas?

 Neil




 


--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: Mixing Session Data, Widgets, Database?

2006-11-05 Thread Neil Tiffin

On Nov 5, 2006, at 8:42 AM, Diez B. Roggisch wrote:

 So it should work for your compound widget above, if you pass the  
 value
 like this:

 time_form.display({'w_task' : optionlist})

I could not get this to work.  It would seem to me that there needs  
to be someway to tell the w_task widget that optionlist is an options  
list.

Everything else is working except passing the new options to the  
widgets.SingleSelectField by way of the form.

controller.py
 @expose(template=timesheetweb.templates.timeEntry)
 def timeEntry(self, tg_errors=None):
 cherrypy.session['cur_project'] = cherrypy.session.get 
('cur_project', 1)
 task_options=[(p.id, p.taskName) for p in task.select 
(task.q.projectID==cherrypy.session['cur_project'],  
orderBy=task.q.taskName)]

 if tg_errors:
 flash(Data Entry Error!)
 return dict(project_form=project_form, time_form=time_form,  
optionlist=task_options)

timeEntry.kid
body
p py:content=project_form.display()Project Form/p
p py:content=time_form.display({'w_task': optionlist})Time Form/p
/body


2006-11-05 11:26:48,182 cherrypy.msg INFO HTTP: Page handler: bound  
method Root.timeEntry of timesheetweb.controllers.Root object at  
0x1778710
Traceback (most recent call last):
   File /Maui-Dev/TurboGears/turbogears/thirdparty/cherrypy/cherrypy/ 
_cphttptools.py, line 106, in _run
 self.main()
   File /Maui-Dev/TurboGears/turbogears/thirdparty/cherrypy/cherrypy/ 
_cphttptools.py, line 255, in main
 body = page_handler(*virtual_path, **self.params)
   File string, line 3, in timeEntry
   File /Maui-Dev/TurboGears/turbogears/turbogears/controllers.py,  
line 275, in expose
 output = database.run_with_transaction(
   File string, line 5, in run_with_transaction
   File /Maui-Dev/TurboGears/turbogears/turbogears/database.py,  
line 247, in so_rwt
 retval = func(*args, **kw)
   File string, line 5, in _expose
   File /Maui-Dev/TurboGears/turbogears/turbogears/controllers.py,  
line 292, in lambda
 mapping, fragment, args, kw)))
   File /Maui-Dev/TurboGears/turbogears/turbogears/controllers.py,  
line 329, in _execute_func
 return _process_output(output, template, format, content_type,  
mapping, fragment)
   File /Maui-Dev/TurboGears/turbogears/turbogears/controllers.py,  
line 72, in _process_output
 mapping=mapping, content_type=content_type,fragment=fragment)
   File /Maui-Dev/TurboGears/turbogears/turbogears/view/base.py,  
line 126, in render
 return turbogears.util.adapt_call(engine.render, **dict 
(info=info, format=format, fragment=fragment, template=template,  
mapping=mapping))
   File /Maui-Dev/TurboGears/turbogears/turbogears/util.py, line  
163, in adapt_call
 return func(*args, **kw)
   File /sw/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/ 
turbokid/kidsupport.py, line 158, in render
 tclass = self.load_template(template)
   File /sw/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/ 
turbokid/kidsupport.py, line 128, in load_template
 mod = _compile_template(package, basename, tfile, classname)
   File /sw/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/ 
turbokid/kidsupport.py, line 15, in _compile_template
 mod = kid.load_template(tfile, name=classname)
   File /sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/ 
__init__.py, line 123, in load_template
 code = template.compile(dump_code=cache,  
dump_source=os.environ.get('KID_OUTPUT_PY'))
   File /sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/ 
compiler.py, line 87, in compile
 code = self.code
   File /sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/ 
compiler.py, line 101, in code
 self._code = py_compile(self.python, pyfile, 'exec')
   File /sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/ 
compiler.py, line 108, in python
 py = kid.parser.parse_file(self.kid_file, self.encoding)
   File /sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/ 
parser.py, line 58, in parse_file
 return parse(source, encoding, filename=filename)
   File /sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/ 
parser.py, line 46, in parse
 return parser.parse()
   File /sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/ 
parser.py, line 76, in parse
 self.proc_stream(self.module_code)
   File /sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/ 
parser.py, line 133, in proc_stream
 for (ev, item) in self.stream:
   File /sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/ 
pull.py, line 168, in _track
 for p in stream:
   File /sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/ 
pull.py, line 210, in _coalesce
 for ev, item in stream:
   File /sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/ 
pull.py, line 374, in __iter__
 for (ev, stuff) in self._expat_stream():
   File /sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/ 
pull.py, line 346, in _expat_stream
 feed(data)
   File 

[TurboGears] Mixing Session Data, Widgets, Database?

2006-11-04 Thread Neil Tiffin

My problem.

Use a session value as part of a select statement to determine what  
is shown in a SingleSelectField  on a form.

The current problem is getting the session data to be recognized when  
setting up the widget named Task Name. I assume that I have to  
request the data for the widget in the Kid template instead of during  
initialization, But I am not sure how to do this or even if this is  
the correct approach.

from Controllers.py (non-relevant removed)
==
name_list = people.build_list('name', orderBy=people.q.name)
project_list = project.build_list('name')

class ProjectFields(widgets.WidgetsList):
 w_project = widgets.SingleSelectField(label=Project Name,  
options=project_list, default=1)

class TimeFields(widgets.WidgetsList):
 w_name = widgets.SingleSelectField(label=Person Name,  
options=name_list, default=1 )
 w_days = widgets.TextField(label=Days Charged, default=1.0)
 w_task = widgets.SingleSelectField(label=Task Name,  
options=lambda:[(p.id, p.taskName) for p in task.select 
(task.q.projectID==cherrypy.session['cur_project'],  
orderBy=task.q.taskName)])

time_form = widgets.TableForm(fields=TimeFields(), action=save)
project_form = widgets.TableForm(fields=ProjectFields(),  
action=changeProject)

class Root(controllers.RootController):

 @expose(template=timesheetweb.templates.timeEntry)
 def timeEntry(self, tg_errors=None):
 cherrypy.session['cur_project'] = cherrypy.session.get 
('cur_project', 1)
 cherrypy.session['we_date'] = cherrypy.session.get 
('we_date', datetime.date.today())
 cherrypy.session['cur_person'] = cherrypy.session.get 
('cur_person', 1)
 if tg_errors:
 flash(Data Entry Error!)
 return dict(form1=project_form, form=time_form,  
def_proj=cherrypy.session['cur_project'], def_date=cherrypy.session 
['we_date'], cur_person=cherrypy.session['cur_person'])

 @expose()
 @validate(form=time_form)
 @error_handler(time)
 def save(self, w_name, w_days, w_task, w_date):
 cherrypy.session['we_date'] = w_date
 cherrypy.session['cur_person'] = w_name
 time(personID=w_name, taskID=w_task, weekEnding=w_date,  
daysCharged=w_days)
 flash(Added Record)
 raise redirect(timeEntry)

 @expose()
 def changeProject(self, w_project):
 global current_project
 cherrypy.session['cur_project'] = string.atoi(w_project)
 raise redirect(timeEntry)

Kid Template (timeEntry):
===
body
p py:content=form1(submit_text='Change Project')Project Form/p
p py:content=form(submit_text='Save Entry')Time Form/p
/body

Current Error:
===
Traceback (most recent call last):
   File ./start-timesheetweb.py, line 26, in ?
 from timesheetweb.controllers import Root
   File /Volumes/ConsultingProjectsCurrent/PCI/TimeApplication/ 
TimeSheetWeb/timesheetweb/controllers.py, line 19, in ?
 class TimeFields(widgets.WidgetsList):
   File /Volumes/ConsultingProjectsCurrent/PCI/TimeApplication/ 
TimeSheetWeb/timesheetweb/controllers.py, line 22, in TimeFields
 w_task = widgets.SingleSelectField(label=Task Name,  
options=lambda:[(p.id, p.taskName) for p in task.select 
(task.q.projectID==cherrypy.session['cur_project'],  
orderBy=task.q.taskName)])
   File /Maui-Dev/TurboGears/turbogears/turbogears/widgets/meta.py,  
line 142, in widget_init
 func(self, *args, **kw)
   File /Maui-Dev/TurboGears/turbogears/turbogears/widgets/ 
forms.py, line 789, in __init__
 validator = self._guess_validator()
   File /Maui-Dev/TurboGears/turbogears/turbogears/widgets/ 
forms.py, line 809, in _guess_validator
 sample_option = self._get_sample_option()
   File /Maui-Dev/TurboGears/turbogears/turbogears/widgets/ 
forms.py, line 822, in _get_sample_option
 options = self._extend_options(self.options)
   File /Maui-Dev/TurboGears/turbogears/turbogears/widgets/meta.py,  
line 95, in __get__
 return param()
   File /Volumes/ConsultingProjectsCurrent/PCI/TimeApplication/ 
TimeSheetWeb/timesheetweb/controllers.py, line 22, in lambda
 w_task = widgets.SingleSelectField(label=Task Name,  
options=lambda:[(p.id, p.taskName) for p in task.select 
(task.q.projectID==cherrypy.session['cur_project'],  
orderBy=task.q.taskName)])
   File /Maui-Dev/TurboGears/turbogears/thirdparty/cherrypy/cherrypy/ 
filters/sessionfilter.py, line 431, in __getattr__
 sess = cherrypy.request._session
   File /Maui-Dev/TurboGears/turbogears/thirdparty/cherrypy/cherrypy/ 
__init__.py, line 42, in __getattr__
 childobject = getattr(serving, self.__attrname__)
AttributeError: 'thread._local' object has no attribute 'request'

Environment:
==
TurboGears Complete Version Information

TurboGears requires:

* TurboGears 1.1a0
* nose 0.9.0
* configobj 4.3.2
* RuleDispatch 0.5a0.dev-r2100
* setuptools 0.6c3
* FormEncode 0.5.1
* cElementTree 1.0.5-20051216
* PasteScript 0.9.7
* elementtree 1.2.6
* simplejson 1.3
* 

[TurboGears] Re: The DVDs are coming...

2006-06-21 Thread Neil Tiffin

Received mine!

Neil

On Jun 20, 2006, at 2:33 PM, Jorge Vargas wrote:

 On 6/20/06, Kevin Dangoor [EMAIL PROTECTED] wrote:

 On Jun 20, 2006, at 2:26 PM, mikl wrote:

 
  I just got this in my mail:
 
  Your order from BlazingThings.com has shipped!
  Order no: [blaah22363563]
 
  I hope this means I'll have my DVD soon :D

 Yes, indeed! The shiny discs arrived yesterday (see my blog if you
 don't know what I mean by shiny discs).

 hehe nice plug

 I haven't seen them myself,
 but the folks at the warehouse assure me that these new discs don't
 have a white background like the earlier ones did. This morning, I
 had all of the preorders paid for and put into the system for
 shipping. I can be pretty sure that all of the orders will be on
 their way by tomorrow (if not by end of day today).

 yay mine will get here like next week someone take some  
 pictures of it when you get urs

 Time to go back to playing with the MarbleGears :)

 Kevin


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: A few words about my involvement with the project

2006-05-30 Thread Neil Tiffin

Kevin,

Can you provide an update to the list?  Did anyone respond?

Neil

On May 26, 2006, at 7:21 AM, Kevin Dangoor wrote:


 Hi,

 Working with you all on TurboGears has been a great experience. We've
 grown a community with nearly 1,750 people on this mailing list and
 who knows how many others out in the world who don't have time to
 follow all of the discussion here. TurboGears.org is often among the
 top 50,000 sites on the net, and we're ramping up to lots of good
 publicity around the TurboGears 1.0 release (more news around the
 book, my talk at EuroPython, the o3 Magazine issue, and all of the
 advocacy you're all doing).

 One thing that I feel really good about is the fact that TurboGears
 has achieved a level of critical mass. There are enough people here
 who care about the project and work with the code that the project
 would continue, even if I was abducted by aliens. Luckily, alien
 abduction is somewhat rare, and I think I'm insured anyhow :)

 I have many things in the works, but many of my potentially
 income-producing ventures won't land until later in the year. Which,
 unfortunately, is longer than I have to wait. I have a terrific job
 offer in hand, but having a regular job will not give me as much
 time on TurboGears. Preorders of these products will determine whether
 I take the job or stay independent. (Seriously! This question will be
 decided in just a few days after the preorders are in!)

 One good thing I should note: the job offer I have is working on an
 existing product that is written in Python with CherryPy.

 Please spread the word with links to the Ultimate DVD page, if you
 want to help ensure that as many folks as possible find out about this
 during this week.

 http://www.turbogears.org/ultimate.html

 Thanks for everything over these past few months!

 Kevin

 --  
 Kevin Dangoor
 TurboGears / Zesty News

 email: [EMAIL PROTECTED]
 company: http://www.BlazingThings.com
 blog: http://www.BlueSkyOnMars.com

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Postgresql Vacuum Hung w/TurboGears Site

2006-02-20 Thread Neil Tiffin

Don't know if this is a problem, a bug, or just normal behavior?

When I ran the following:

vacuum full verbose analyze;

with TurboGears site running it hung after the following output.

snip
There were 97 unused item pointers.
Total free space (including removable row versions) is 5792 bytes.
0 pages are or will become empty, including 0 at the end of the table.
1 pages containing 5444 free bytes are potential move destinations.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO:  index pg_depend_depender_index now contains 3983 row  
versions in 21 pages
DETAIL:  0 index row versions were removed.
0 index pages have been deleted, 0 are currently reusable.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO:  index pg_depend_reference_index now contains 3983 row  
versions in 25 pages
DETAIL:  0 index row versions were removed.
0 index pages have been deleted, 0 are currently reusable.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO:  pg_depend: moved 0 row versions, truncated 30 to 30 pages
DETAIL:  CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO:  analyzing pg_catalog.pg_depend
INFO:  pg_depend: scanned 30 of 30 pages, containing 3959 live rows  
and 24 dead rows; 3000 rows in sample, 3959 estimated total rows
hung here

When I killed the TurgoGears site, the vacuum immediately continued  
on to completion.  Starting with the following:

INFO:  vacuuming pg_catalog.pg_attrdef
INFO:  pg_attrdef: found 0 removable, 10 nonremovable row versions  
in 1 pages
DETAIL:  2 dead row versions cannot be removed yet.
Nonremovable row versions range from 415 to 491 bytes long.
There were 7 unused item pointers.
Total free space (including removable row versions) is 3612 bytes.
0 pages are or will become empty, including 0 at the end of the table.
1 pages containing 3612 free bytes are potential move destinations.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
snip

Versions
===
PostgreSQL 8.0.6 on powerpc-apple-darwin8.4.0, compiled by GCC  
powerpc-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc.  
build 5250)

TurboGears 0.9a0dev-r791
nose 0.8.6
RuleDispatch 0.5a0.dev-r2100
setuptools 0.6a10
FormEncode 0.4
cElementTree 1.0.5-20051216
PasteScript 0.4.1
elementtree 1.2.6
simplejson 1.1
SQLObject 0.7.1dev-r1606
CherryPy 2.2.0beta
TurboKid 0.9.1dev-r787
PyProtocols 1.0a0
INITools 0.1
PasteDeploy 0.4
Paste 0.5dev-r4745
FormEncode 0.4
kid 0.9a0
elementtree 1.2.6

Neil


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~--~~~~--~~--~--~---



[TurboGears] Re: Identity: Attaching permissions directly to users (Ticket #505)

2006-02-05 Thread Neil Tiffin


Using Users-Groups-Permissions is definitely better for any system  
with more than 100 users.  I inherited a system (over 100 users)  
where permissions were managed directly to users. It was very easy  
and quick to fix/modify one Users permissions.  However, we never  
could find the time to rationalize the overall permissions as most  
users with the same job requirements had over time evolved different  
permissions.  Why?  We never knew for sure although we ended up  
spending considerable time for each change trying to resolve  
differences.


Using Users-Groups-Permissions forces one to spend more time up- 
front keeping permissions rationalized.  Rational permissions may or  
may not be important in a given installation. I agree with Jeff that  
it should be the heavily favored option. It can be used for small  
user communities without a lot of additional overhead (just a little  
thinking beforehand).  So I don't really see a downside.


Neil


On Feb 5, 2006, at 9:19 AM, Jeff Watkins wrote:



hi, i recently start to play with the identity frameworks from  
turbogears and i really dont get the point of linking permission  
to groups. if the 'write' permission is linked against the 'admin'  
group, all users in admin group have write permission. if i need  
diferente parmission for a specific user, i need to create another  
group. so, what is the point? i really think that 'permissions'  
should be linked against 'users'. this way the 'group' should say  
which objects u can access and permission what u can do with given  
objects.
There is nothing preventing you from creating a Model that better  
suits your needs, however, experience with large user communities  
shows that you're almost always better off modelling via Users- 
Groups-Permissions rather than applying permissions directly to a  
particular User.


If for no other reason, provisioning new users becomes a huge  
problem. Consider the following example:


Sally, the nurse retires and her replacement Sam needs to be  
provisioned in the new system. In an environment where permissions  
are applied via groups, Sam is made a member of the Nurse group and  
he immediately acquires *every* applicable permission. If  
permissions are applied directly to the user, you need to  
explicitly apply every permission in order to provision Sam.


Six months later, you role out new functionality for nurses. This  
new functionality includes new permissions -- all nurses should  
have these permissions. If you've modelled your users using groups,  
you add the permissions to the nurses group and immediately every  
nurse, including Sam, can now access the new functionality. If you  
haven't modelled your data using groups, you need to add the  
permissions to every single nurse. Now ask yourself, if you don't  
have groups, how do you know who all the nurses are?


Now if you have a VERY small user community, applying permissions  
directly to the user isn't a bad model. And I run into this a lot  
with clients. Mostly when I encounter this model it's after they've  
grown from a small number of users to many hundreds or even  
thousands. In these cases, the permissions are often controlled by  
different application specialists and no one quite knows what the  
definitive set of permissions actually is for a given group or role.