[turbogears-commits] [1123] trunk/turbogears/view: applied patch for kid.assume_encoding (#743)
Title: [1123] trunk/turbogears/view: applied patch for kid.assume_encoding (#743) Revision 1123 Author max Date 2006-04-11 02:38:10 -0500 (Tue, 11 Apr 2006) Log Message applied patch for kid.assume_encoding (#743) Modified Paths trunk/plugins/kid/turbokid/kidsupport.py trunk/turbogears/qstemplates/quickstart/+package+/config/app.cfg_tmpl trunk/turbogears/view/base.py Diff Modified: trunk/plugins/kid/turbokid/kidsupport.py (1122 => 1123) --- trunk/plugins/kid/turbokid/kidsupport.py 2006-04-10 21:21:13 UTC (rev 1122) +++ trunk/plugins/kid/turbokid/kidsupport.py 2006-04-11 07:38:10 UTC (rev 1123) @@ -143,12 +143,14 @@ if self.get_extra_vars: data.update(self.get_extra_vars()) data.update(info) - + t = tclass(**data) - + options = self.options + +if options.get(kid.assume_encoding, utf-8): +t.assume_encoding = options.get(kid.assume_encoding) if options.get(kid.i18n.runTemplateFilter, False): - t._filters+=[options.get(kid.i18n_filter)] return t.serialize(encoding=self.defaultencoding, output=format, fragment=fragment) Modified: trunk/turbogears/qstemplates/quickstart/+package+/config/app.cfg_tmpl (1122 => 1123) --- trunk/turbogears/qstemplates/quickstart/+package+/config/app.cfg_tmpl 2006-04-10 21:21:13 UTC (rev 1122) +++ trunk/turbogears/qstemplates/quickstart/+package+/config/app.cfg_tmpl 2006-04-11 07:38:10 UTC (rev 1123) @@ -12,7 +12,15 @@ # template name # tg.defaultview = kid +# The following kid settings determine the settings used by the kid serializer. + +# One of (html|xml|json) # kid.outputformat=html + +# What character encoding should be assumed when interpreting str objects +# referenced by the templates? Note that kid's default is ascii. +# kid.assume_encoding=utf-8 + # kid.encoding=utf-8 # The sitetemplate is used for overall styling of a site that Modified: trunk/turbogears/view/base.py (1122 => 1123) --- trunk/turbogears/view/base.py 2006-04-10 21:21:13 UTC (rev 1122) +++ trunk/turbogears/view/base.py 2006-04-11 07:38:10 UTC (rev 1123) @@ -328,6 +328,7 @@ config = turbogears.config engine_options ={ kid.encoding : config.get(kid.encoding, utf-8), +kid.assume_encoding : config.get(kid.assume_encoding, utf-8), kid.precompiled : config.get(kid.precompiled, False), kid.i18n.runTemplateFilter : config.get(i18n.runTemplateFilter, False), --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Repository Commits group. To post to this group, send email to turbogears-commits@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-commits -~--~~~~--~~--~--~---
[turbogears-commits] [1125] widgets/TurboTinyMCE: Changed project URL in release.py to point to TGs repository and untagged .dev build.
Title: [1125] widgets/TurboTinyMCE: Changed project URL in release.py to point to TGs repository and untagged .dev build. Revision 1125 Author alberto Date 2006-04-11 03:21:20 -0500 (Tue, 11 Apr 2006) Log Message Changed project URL in release.py to point to TGs repository and untagged .dev build. Modified Paths widgets/TurboTinyMCE/setup.cfg widgets/TurboTinyMCE/tinymce/release.py widgets/TurboTinyMCE/tinymce/widgets.py Diff Modified: widgets/TurboTinyMCE/setup.cfg (1124 => 1125) --- widgets/TurboTinyMCE/setup.cfg 2006-04-11 08:01:52 UTC (rev 1124) +++ widgets/TurboTinyMCE/setup.cfg 2006-04-11 08:21:20 UTC (rev 1125) @@ -1,3 +1 @@ [egg_info] -tag_build = .dev -tag_svn_revision = true Modified: widgets/TurboTinyMCE/tinymce/release.py (1124 => 1125) --- widgets/TurboTinyMCE/tinymce/release.py 2006-04-11 08:01:52 UTC (rev 1124) +++ widgets/TurboTinyMCE/tinymce/release.py 2006-04-11 08:21:20 UTC (rev 1125) @@ -7,7 +7,6 @@ email = [EMAIL PROTECTED] copyright = Alberto Valverde 2006 -# if it's open source, you might want to specify these -url = "" -download_url = http://svn.toscat.net/TurboMiscStuff/TinyMCE +url = "" +download_url = http://www.turbogears.org/svn/turbogears/widgets/TurboTinyMCE license = LGPL Modified: widgets/TurboTinyMCE/tinymce/widgets.py (1124 => 1125) --- widgets/TurboTinyMCE/tinymce/widgets.py 2006-04-11 08:01:52 UTC (rev 1124) +++ widgets/TurboTinyMCE/tinymce/widgets.py 2006-04-11 08:21:20 UTC (rev 1125) @@ -75,8 +75,6 @@ def update_data(self, d): super(TinyMCE, self).update_data(d) -#XXX: Or should it be name?? As soon as I try it inside a form -# I could tell... d['mce_options']['elements'] = d['field_id'] d['TinyMCEInit'] = tinyMCE.init(%s); % jsonify(d['mce_options']) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Repository Commits group. To post to this group, send email to turbogears-commits@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-commits -~--~~~~--~~--~--~---
[turbogears-commits] [1126] trunk/turbogears/widgets/base.py: Attempt to remove to_unicode from widgets, should work
Title: [1126] trunk/turbogears/widgets/base.py: Attempt to remove to_unicode from widgets, should work Revision 1126 Author michele Date 2006-04-11 03:27:08 -0500 (Tue, 11 Apr 2006) Log Message Attempt to remove to_unicode from widgets, should work since we are using CP decoding filter now. Modified Paths trunk/turbogears/widgets/base.py Diff Modified: trunk/turbogears/widgets/base.py (1125 => 1126) --- trunk/turbogears/widgets/base.py 2006-04-11 08:21:20 UTC (rev 1125) +++ trunk/turbogears/widgets/base.py 2006-04-11 08:27:08 UTC (rev 1126) @@ -31,20 +31,6 @@ html xmlns:py=http://purl.org/kid/ns# py:strip=1$elements/html, modname=turbogears.widgets.plainhtml)[0] -def to_unicode(value): -if isinstance(value, str): -# try to make sure we won't get UnicodeDecodeError from the template -# by converting all encoded strings to Unicode strings -try: -value = unicode(value) -except UnicodeDecodeError: -try: -encoding = config.get('kid.encoding', 'utf8') -value = unicode(value, encoding) -except UnicodeDecodeError: -pass # let it be as is -return value - # # Widgets base classes # # @@ -90,7 +76,7 @@ # make sure we don't pass references to mutable class attributes value = kw.pop(var) if isinstance(value, dict): -new_dict = dict(getattr(self, var, {})) +new_dict = getattr(self, var, {}) new_dict.update(value) setattr(self, var, new_dict) elif isinstance(value, list): @@ -158,7 +144,7 @@ if not self.template_c: return None template_vars[name] = self.name -template_vars[value] = to_unicode(self.adjust_value(value, convert)) +template_vars[value] = self.adjust_value(value, convert) self.update_data(template_vars) return view.transform(template_vars, template=self.template_c) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Repository Commits group. To post to this group, send email to turbogears-commits@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-commits -~--~~~~--~~--~--~---
[turbogears-commits] [1127] trunk/turbogears/errorhandling.py: Fixed a stupid mistake I made in [1120].
Title: [1127] trunk/turbogears/errorhandling.py: Fixed a stupid mistake I made in [1120]. Revision 1127 Author simon Date 2006-04-11 04:31:57 -0500 (Tue, 11 Apr 2006) Log Message Fixed a stupid mistake I made in [1120]. Modified Paths trunk/turbogears/errorhandling.py Diff Modified: trunk/turbogears/errorhandling.py (1126 => 1127) --- trunk/turbogears/errorhandling.py 2006-04-11 08:27:08 UTC (rev 1126) +++ trunk/turbogears/errorhandling.py 2006-04-11 09:31:57 UTC (rev 1127) @@ -80,7 +80,7 @@ try: output = dispatch_error(self, func, None, e, *args, **kw) except NoApplicableMethods: -raise +raise exc_type, exc_value, exc_trace else: del exc_trace return output --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Repository Commits group. To post to this group, send email to turbogears-commits@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-commits -~--~~~~--~~--~--~---
[turbogears-commits] [1133] trunk/turbogears/widgets: raise ValueError if value cannot be decoded
Title: [1133] trunk/turbogears/widgets: raise ValueError if value cannot be decoded Revision 1133 Author max Date 2006-04-11 12:44:17 -0500 (Tue, 11 Apr 2006) Log Message raise ValueError if value cannot be decoded Modified Paths trunk/turbogears/widgets/base.py trunk/turbogears/widgets/tests/test_widgets.py Diff Modified: trunk/turbogears/widgets/base.py (1132 => 1133) --- trunk/turbogears/widgets/base.py 2006-04-11 14:45:32 UTC (rev 1132) +++ trunk/turbogears/widgets/base.py 2006-04-11 17:44:17 UTC (rev 1133) @@ -42,7 +42,8 @@ encoding = config.get('kid.encoding', 'utf8') value = unicode(value, encoding) except UnicodeDecodeError: -pass # let it be as is +# fail early +raise ValueError(Non-unicode string: %r % value) return value # Modified: trunk/turbogears/widgets/tests/test_widgets.py (1132 => 1133) --- trunk/turbogears/widgets/tests/test_widgets.py 2006-04-11 14:45:32 UTC (rev 1132) +++ trunk/turbogears/widgets/tests/test_widgets.py 2006-04-11 17:44:17 UTC (rev 1133) @@ -105,6 +105,12 @@ tf = widgets.TextField(name, validator=validators.UnicodeString()) output = tf.render(u'Pete \u011C') assert 'VALUE=Pete \xc4\x9c' in output +return # XXX: the folowing causes OTHER tests to fail! +try: +print tf.render('Pete \xfe\xcd') +assert 0, ValueError not raised: non-unicode input not detected +except ValueError, e: +pass #tf2 = widgets.TextField(name, validator=validators.String()) # simon: failed inputs are no longer being removed. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Repository Commits group. To post to this group, send email to turbogears-commits@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-commits -~--~~~~--~~--~--~---
[tg-tickets] Re: [TurboGears] #743: kid default utf-8 support is incomplete
#743: kid default utf-8 support is incomplete -+-- Reporter: [EMAIL PROTECTED] |Owner: anonymous Type: defect | Status: closed Priority: normal |Milestone: Component: Kid | Version: 0.9a4 Severity: normal | Resolution: fixed Keywords: | -+-- Changes (by max): * status: new = closed * resolution: = fixed Comment: Applied in r1123. -- Ticket URL: http://trac.turbogears.org/turbogears/ticket/743 TurboGears http://www.turbogears.org/ TurboGears front-to-back web development --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Tickets group. To post to this group, send email to turbogears-tickets@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-tickets -~--~~~~--~~--~--~---
[tg-tickets] Re: [TurboGears] #595: SOIdentityProvider should not always create classes
#595: SOIdentityProvider should not always create classes +--- Reporter: ghaering|Owner: anonymous Type: defect | Status: closed Priority: normal |Milestone: 0.9 Component: Identity| Version: Severity: blocker | Resolution: worksforme Keywords: soidentityprovider model table | +--- Changes (by ghaering): * status: new = closed * resolution: = worksforme Comment: The solution on PostgreSQL is to use lowercase table names. I used uppercase table names in sqlmeta.table and this won't work with PostgreSQL, because the SQLObject/PostgreSQL table lookup is case sensitive. Closing as worksforme. -- Ticket URL: http://trac.turbogears.org/turbogears/ticket/595 TurboGears http://www.turbogears.org/ TurboGears front-to-back web development --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Tickets group. To post to this group, send email to turbogears-tickets@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-tickets -~--~~~~--~~--~--~---
[tg-tickets] Re: [TurboGears] #206: Support setting IdentityProvider per controller
#206: Support setting IdentityProvider per controller +--- Reporter: Splee |Owner: jeff Type: enhancement | Status: new Priority: normal |Milestone: 0.9 Component: Identity| Version: Severity: normal | Resolution: Keywords: identity filter controller | +--- Changes (by jeff): * owner: Jeff Watkins = jeff -- Ticket URL: http://trac.turbogears.org/turbogears/ticket/206 TurboGears http://www.turbogears.org/ TurboGears front-to-back web development --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Tickets group. To post to this group, send email to turbogears-tickets@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-tickets -~--~~~~--~~--~--~---
[tg-tickets] Re: [TurboGears] #634: LdapIdentityProvider
#634: LdapIdentityProvider -+-- Reporter: [EMAIL PROTECTED] |Owner: anonymous Type: enhancement | Status: new Priority: normal |Milestone: Component: Identity | Version: Severity: normal | Resolution: Keywords: LDAP Identity| -+-- Comment (by [EMAIL PROTECTED]): Strike that... load_identity(self, visit_id) needs to be implemented before this is useful for multipage applications -- otherwise, the user needs to log back in on every page load, and that just doesn't seem like a Good Thing. I'm trying to hash out an implementation myself. Will update here when I have something working. -- Ticket URL: http://trac.turbogears.org/turbogears/ticket/634 TurboGears http://www.turbogears.org/ TurboGears front-to-back web development --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Tickets group. To post to this group, send email to turbogears-tickets@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-tickets -~--~~~~--~~--~--~---
[tg-tickets] Re: [TurboGears] #397: TG_visit initialization threading problem
#397: TG_visit initialization threading problem ---+ Reporter: [EMAIL PROTECTED] |Owner: anonymous Type: defect | Status: closed Priority: high |Milestone: Component: SQLObject | Version: Severity: normal | Resolution: fixed Keywords: threading sqlobject visit | ---+ Changes (by alberto): * status: reopened = closed * resolution: = fixed Comment: sqlobject_threading.patch was applied to sqlobject at rev. 1547 -- Ticket URL: http://trac.turbogears.org/turbogears/ticket/397 TurboGears http://www.turbogears.org/ TurboGears front-to-back web development --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Tickets group. To post to this group, send email to turbogears-tickets@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-tickets -~--~~~~--~~--~--~---
[tg-tickets] [TurboGears] #746: 'tg-admin sql create' does not accept configuration file name
#746: 'tg-admin sql create' does not accept configuration file name --+- Reporter: anoymous | Owner: anonymous Type: defect| Status: new Priority: high | Milestone: Component: Installation | Version: 0.9a4 Severity: normal|Keywords: --+- Tg-admin sql create should accept a filename for a configuration file so that a user can create mutliple databases easily. -- Ticket URL: http://trac.turbogears.org/turbogears/ticket/746 TurboGears http://www.turbogears.org/ TurboGears front-to-back web development --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Tickets group. To post to this group, send email to turbogears-tickets@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-tickets -~--~~~~--~~--~--~---
[tg-tickets] [TurboGears] #747: Flash precedence fix
#747: Flash precedence fix --+- Reporter: [EMAIL PROTECTED] | Owner: anonymous Type: defect| Status: new Priority: normal| Milestone: Component: CherryPy | Version: 0.9a4 Severity: normal|Keywords: patch --+- Patch attached fixes a subtle bug in turbogears.flash mechanism: If a controller method sets a flash message and returns dictionary, flash message should be visible on rendered template. Currently turbogears works like this, with the only exception: if tg_flash cookie exists (it was set in one of the previous requests ), it is used as flash message, regardless of what was set in current request. Attached patch fixes this behavour: the latest flash will be displayed. Unit test included. -- Ticket URL: http://trac.turbogears.org/turbogears/ticket/747 TurboGears http://www.turbogears.org/ TurboGears front-to-back web development --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Tickets group. To post to this group, send email to turbogears-tickets@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-tickets -~--~~~~--~~--~--~---
[tg-tickets] Re: [TurboGears] #747: [PATCH] Flash precedence fix
#747: [PATCH] Flash precedence fix --+- Reporter: [EMAIL PROTECTED] |Owner: anonymous Type: defect| Status: new Priority: normal|Milestone: Component: CherryPy | Version: 0.9a4 Severity: normal| Resolution: Keywords: patch | --+- Changes (by michele): * summary: Flash precedence fix = [PATCH] Flash precedence fix -- Ticket URL: http://trac.turbogears.org/turbogears/ticket/747 TurboGears http://www.turbogears.org/ TurboGears front-to-back web development --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Tickets group. To post to this group, send email to turbogears-tickets@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-tickets -~--~~~~--~~--~--~---
[tg-tickets] Re: [TurboGears] #747: [PATCH] Flash precedence fix
#747: [PATCH] Flash precedence fix --+- Reporter: [EMAIL PROTECTED] |Owner: anonymous Type: defect| Status: closed Priority: normal|Milestone: Component: CherryPy | Version: 0.9a4 Severity: normal| Resolution: fixed Keywords: patch | --+- Changes (by alberto): * status: new = closed * resolution: = fixed Comment: Committed at [1134]. Thanks! -- Ticket URL: http://trac.turbogears.org/turbogears/ticket/747 TurboGears http://www.turbogears.org/ TurboGears front-to-back web development --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Tickets group. To post to this group, send email to turbogears-tickets@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-tickets -~--~~~~--~~--~--~---
[tg-tickets] Re: [TurboGears] #747: [PATCH] Flash precedence fix
#747: [PATCH] Flash precedence fix --+- Reporter: [EMAIL PROTECTED] |Owner: anonymous Type: defect| Status: reopened Priority: normal|Milestone: Component: CherryPy | Version: 0.9a4 Severity: normal| Resolution: Keywords: patch | --+- Changes (by [EMAIL PROTECTED]): * status: closed = reopened * resolution: fixed = Comment: Just discovered other small related problem: old stale cookie should be cleared after flash was read. Attaching patch to the latest svn revision. -- Ticket URL: http://trac.turbogears.org/turbogears/ticket/747 TurboGears http://www.turbogears.org/ TurboGears front-to-back web development --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Tickets group. To post to this group, send email to turbogears-tickets@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-tickets -~--~~~~--~~--~--~---
[tg-tickets] Re: [TurboGears] #749: [PATCH] Make Toolbox's breadcrumbs more consistent
#749: [PATCH] Make Toolbox's breadcrumbs more consistent --+- Reporter: roger.demetrescu |Owner: anonymous Type: enhancement | Status: new Priority: low |Milestone: Component: Toolbox | Version: 0.9a4 Severity: minor | Resolution: Keywords:| --+- Changes (by roger.demetrescu): * summary: Make Toolbox's breadcrumbs more consistent = [PATCH] Make Toolbox's breadcrumbs more consistent -- Ticket URL: http://trac.turbogears.org/turbogears/ticket/749 TurboGears http://www.turbogears.org/ TurboGears front-to-back web development --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Tickets group. To post to this group, send email to turbogears-tickets@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-tickets -~--~~~~--~~--~--~---
[tg-tickets] [TurboGears] #750: only_suggest on AutoCompleteField acts wrong when only 1 item autocompleted
#750: only_suggest on AutoCompleteField acts wrong when only 1 item autocompleted ---+ Reporter: [EMAIL PROTECTED] | Owner: anonymous Type: defect | Status: new Priority: normal | Milestone: Component: Widgets| Version: 0.9a4 Severity: normal |Keywords: ---+ Hi I'm using Firefox 1.06 (Linux) and TG 0.9a4. I have an AutoCompleteField and have set only_suggest to True. When I do this and there is only 1 item suggested, it will not let me arrow down and select it. (Maybe this has something to do with the selection starting on the second item when only_suggest is on and more than 1 selection available?) -- Ticket URL: http://trac.turbogears.org/turbogears/ticket/750 TurboGears http://www.turbogears.org/ TurboGears front-to-back web development --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears Tickets group. To post to this group, send email to turbogears-tickets@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-tickets -~--~~~~--~~--~--~---
[tg-trunk] Re: turbogears.flash() inconsitency
On 4/11/06, Max Ischenko [EMAIL PROTECTED] wrote: In current turbogears trunk turbogears.flash() function works a bit inconsistently: flash message is displayed only on next request after a message was set. This is because flash message is implemented via cookies and cookie is not accessible on the same request (before it is sent to client). That's a feature. This is the way it is to be able to display flash after issuing a redirect. I'm fully aware of this feature and I'm not proposing to remove it. I am proposing to add another feature to be able to display flash by not issuing redirect. This way, when program issues redirect after setting flash, it (flash) will be loaded from cookies. When program renders template after setting flash, it will be loaded from cherrypy.response or cherrypy.request. Actually I'm going to apply patch http://trac.turbogears.org/turbogears/attachment/ticket/297/%23297patch.diff (thanks for the link, Michele) but leave cookie stuff in place. This way turbogears.flash() would work as [uninformed] users expects it to (at least as I expected it to work when I was unaware of how flash actually works under the hood). -- Andrey Lebedev Software engineer --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] done r1124 [Re: broken FileField widget?]
Michele Cella wrote: Great, I will implement this solution late today. ;-) Thanks for the useful discussion that always leads to something better. :-) Ciao Michele I've implemented support for this in r1124, ATM to fully work as expected we will need a FE that uses my patch, Ian said to me that he will work to integrate that soon. ;-) In the meanwhile if you want to go ahead and add the FileUpload validator to the FileField... Ciao Michele --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: turbogears.flash() inconsitency
+1 from me. On 4/11/06, Alberto Valverde [EMAIL PROTECTED] wrote: On Apr 11, 2006, at 9:40 AM, Andrey Lebedev wrote: I'm fully aware of this feature and I'm not proposing to remove it. I am proposing to add another feature to be able to display flash by not issuing redirect. This way, when program issues redirect after setting flash, it (flash) will be loaded from cookies. When program renders template after setting flash, it will be loaded from cherrypy.response or cherrypy.request. I agree with this, flash should behave more or less like this IMO: 1) def method(...): flash(bang) return dict(...) (Display message on current request passing message via CP.request) 2) def method(...) ... flash(bong) redirect(...) (Display flash in next request passing message via cookie) This is something that has bugged me before too... I think flash should be a uniform interface to display status messages, regardless if we're redirectig to another page (after a save, for example) or not. My .2€ Regards, Alberto -- cheers elvelind grandin --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] error_handling dispatch problem?
I updated to r1122 and now when an exception occurs inside my controller I got this error instead of plain traceback. Can anyone confirm? Page handler: bound method ItemViewer.default of bookswap.controllers.ItemViewer object at 0x01711330 Traceback (most recent call last): File c:\python24\lib\site-packages\cherrypy-2.2.0-py2.4.egg\cherrypy\_cphttptools.py, line 106, in _run self.main() File c:\python24\lib\site-packages\cherrypy-2.2.0-py2.4.egg\cherrypy\_cphttptools.py, line 255, in main body = page_handler(*virtual_path, **self.params) File string, line 3, in default File d:\projects\3rd-party\turbogears\turbogears\controllers.py, line 206, in expose output = database.run_with_transaction(expose._expose,func, accept, allow_json, allow_json_from_config,*args, **kw) File d:\projects\3rd-party\turbogears\turbogears\database.py, line 216, in run_with_transaction retval = func(*args, **kw) File string, line 5, in _expose File d:\projects\3rd-party\turbogears\turbogears\controllers.py, line 227, in lambda expose._expose.when(rule)(lambda _func, accept, allow_json, allow_json_from_config,*args,**kw: _execute_func( File d:\projects\3rd-party\turbogears\turbogears\controllers.py, line 248, in _execute_func output = errorhandling.try_call(func, *args, **kw) File D:\Projects\3rd-party\turbogears\turbogears\errorhandling.py, line 81, in try_call output = dispatch_error(self, func, None, e, *args, **kw) File string, line 5, in dispatch_error File _speedups.pyx, line 362, in _speedups.BaseDispatcher.__getitem__ File C:\Python24\lib\site-packages\ruledispatch-0.5a0.dev_r2100-py2.4-win32.egg\dispatch\interfaces.py, line 15, in __call__ NoApplicableMethods: ((bookswap.controllers.ItemViewer object at 0x01711330, function default at 0x016CEBF0, None, dispatch.interfaces.NoApplicableMethods instance at 0x0178AC10, ('2dtwqskf7iek5yqc', 'edit'), {'pst': 'su5ikl5y3c089vax0waox5zp'}), {}) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: error_handling dispatch problem?
Brain fart, sorry. Fixed in [1127]. Cheers, Simon Max Ischenko wrote: I updated to r1122 and now when an exception occurs inside my controller I got this error instead of plain traceback. Can anyone confirm? Page handler: bound method ItemViewer.default of bookswap.controllers.ItemViewer object at 0x01711330 Traceback (most recent call last): File c:\python24\lib\site-packages\cherrypy-2.2.0-py2.4.egg\cherrypy\_cphttptools.py, line 106, in _run self.main() File c:\python24\lib\site-packages\cherrypy-2.2.0-py2.4.egg\cherrypy\_cphttptools.py, line 255, in main body = page_handler(*virtual_path, **self.params) File string, line 3, in default File d:\projects\3rd-party\turbogears\turbogears\controllers.py, line 206, in expose output = database.run_with_transaction(expose._expose,func, accept, allow_json, allow_json_from_config,*args, **kw) File d:\projects\3rd-party\turbogears\turbogears\database.py, line 216, in run_with_transaction retval = func(*args, **kw) File string, line 5, in _expose File d:\projects\3rd-party\turbogears\turbogears\controllers.py, line 227, in lambda expose._expose.when(rule)(lambda _func, accept, allow_json, allow_json_from_config,*args,**kw: _execute_func( File d:\projects\3rd-party\turbogears\turbogears\controllers.py, line 248, in _execute_func output = errorhandling.try_call(func, *args, **kw) File D:\Projects\3rd-party\turbogears\turbogears\errorhandling.py, line 81, in try_call output = dispatch_error(self, func, None, e, *args, **kw) File string, line 5, in dispatch_error File _speedups.pyx, line 362, in _speedups.BaseDispatcher.__getitem__ File C:\Python24\lib\site-packages\ruledispatch-0.5a0.dev_r2100-py2.4-win32.egg\dispatch\interfaces.py, line 15, in __call__ NoApplicableMethods: ((bookswap.controllers.ItemViewer object at 0x01711330, function default at 0x016CEBF0, None, dispatch.interfaces.NoApplicableMethods instance at 0x0178AC10, ('2dtwqskf7iek5yqc', 'edit'), {'pst': 'su5ikl5y3c089vax0waox5zp'}), {}) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: rev 962.
On 11/04/2006, at 12:57, Alberto wrote: @turbogears.expose(webpanel.templates.list) @turbogears.expose(json) Well, I managed to get it working with the good ol': @turbogears.expose(template=webpanel.templates.list, allow_json=True) Alberto --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: rev 962.
What if you reverse the order of the decorators? On 4/11/06, Alberto [EMAIL PROTECTED] wrote: Elvelind Grandin wrote: @expose(stringTemplate:.welcome, as_format=text) @expose(.templates.xml, accept_format=xml/foo) @expose(json) @expose(.templates.welcome) def .. Hi Elvelind, I'm trying to get something in this line working in a project but can't seem to get it right: @turbogears.expose(webpanel.templates.list) @turbogears.expose(json) def index(self, origin=None, destination=None): format = cherrypy.request.params.get(tg_format, default) print %s,%s,%s % (origin, destination, format) if format == json: return dict(message=returning json) else: return dict( list_widget=self.list_widget, data=self.sql_class.select(user_items(self.sql_class)), ) When I pass tg_format=json as a GET param I get (sic): Page handler: bound method AliasController.index of webpanel.mailbox.controllers.AliasController object at 0x20f5490 Traceback (most recent call last): File /sw/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cphttptools.py, line 106, in _run self.main() File /sw/lib/python2.4/site-packages/CherryPy-2.2.0-py2.4.egg/cherrypy/_cphttptools.py, line 255, in main body = page_handler(*virtual_path, **self.params) File string, line 3, in index File /Users/alberto/src/turbogears/turbogears/controllers.py, line 206, in expose output = database.run_with_transaction(expose._expose,func, accept, allow_json, allow_json_from_config,*args, **kw) File turbogears/database.py, line 216, in run_with_transaction File string, line 5, in _expose File _speedups.pyx, line 376, in _speedups.BaseDispatcher.__getitem__ File build/bdist.darwin-8.4.0-Power_Macintosh/egg/dispatch/interfaces.py, line 15, in __call__ NoApplicableMethods: ((function index at 0x209dc70, 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', None, False, (webpanel.mailbox.controllers.AliasController object at 0x20f5490,), {'origin': None, 'tg_format': 'json', 'destination': None}), {}) And when no tg_format param is passed a jsonify exception is raised which means that expose is treating it as if tg_format was json (and trying to jsonfiy the grid widget). Am I missing something? I'll explain what I'm trying to accomplish in case there's a better way to do it: I want to display a fastdata grid on default format and feed JSON data into a AjaxDataGrid on tg_format=json. Unfortunately, they expect data in slightly different formats so I need to branch depending on tg_format to feed them them correct dict. As a suggestion, a 'branch_to' (or better name) optional arg that branched to another method ( a là error_handler) will be very nice to support this kind of behavior without the ugly lookup at request.params Thanks for any help, Alberto P.S Using r1127 -- cheers elvelind grandin --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: r1126: to_unicode removed from Widget
In r1126 [1] I've removed the use of to_unicode from adjust_value, it should work all right since we are now using the CP decoding filter, anyway if you (for example Max and Jorge that I think need this feature) start experiencing problems we will just revert this change, it's just an attempt to reduce monkeypatching here and there. ;-) I appreciate the idea but not the results. ;-) The problem is that with the current setup there is no way it would work without to_unicode kludge. See, when I pass unicode string to field.display() it calls validator which turns it into utf-8 string which then fails when Kid interprets it as ascii string. May be we should fix the validator to do nothing in from_python but I'm far from sure. May be we should call adjust_value with convert=False whatever that means to skip validator. May be you'd better just put to_unicode back. ;-) One thing we should do for sure is to add a unit test which exercises unicode-related behaviour. I added primitive test_unicode_input() testcase to test_widgets.py. It passes with to_unicode() in-place and fails without. Please put to_unicode() back and then look for better solution. ;-) One pain with Kid is that once this encoded-string slips in and Kid fails it gives incomprehensible error message. May be we should try to detect such errors ourselves to at least fail in a meaningful way. I mean adding something like this to adjust_value(): if isinstance(value, str): try: unicode(value) except UnicodeDecodeError: raise ValueError(Non-unicode string in %s: %r % (self, value)) Max. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Identity Provider on Controllers (#206)
This bug has been bothering me for some time: http://trac.turbogears.org/turbogears/ticket/206 Basically, I originally wanted to have identity providers be tied to controller hierarchies, but expedience won out and I didn't do that. I'd like to fix this. It's been marked as being a 0.9 feature for some time. So I think I'll take a look at it in the coming days. If any one has any insight, I'd be happy to hear it -- unless it's something like: Dude, use Generic Functions they're the bomb and make everything so cool and flexible. Jeff -- Jeff Watkins http://newburyportion.com/ Just because you have the right to do something, doesn't mean it's the right thing to do. -- Fred Friendly, former president of CBS News --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: Identity Provider on Controllers (#206)
Dude, use Generic Functions they're the bomb and make everything s cool and flexible !! Sorry, couldn't resist... :D []s Roger On 4/11/06, Jeff Watkins [EMAIL PROTECTED] wrote: This bug has been bothering me for some time: http://trac.turbogears.org/turbogears/ticket/206 Basically, I originally wanted to have identity providers be tied to controller hierarchies, but expedience won out and I didn't do that. I'd like to fix this. It's been marked as being a 0.9 feature for some time. So I think I'll take a look at it in the coming days. If any one has any insight, I'd be happy to hear it -- unless it's something like: Dude, use Generic Functions they're the bomb and make everything so cool and flexible. Jeff -- Jeff Watkins http://newburyportion.com/ Just because you have the right to do something, doesn't mean it's the right thing to do. -- Fred Friendly, former president of CBS News --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] providing default error handler: how to get the traceback?
Hi, My post is mostly for Simon. I want to intercept all application errors that normally results in CherryPy's 500 Internal Error page to save error info and display it differently. My error handler defined like this: @dispatch_error.when(tg_exceptions is not None) def notify_on_error(controller, tg_source, tg_errors, tg_exceptions, *args, **kw): # record error and format for display return 'FAIL' The problem is that I cannot get to the traceback I usually see on 500 error page. The tg_exception is just an exception, sys.exc_info() and traceback.extract_stack() both give different tracebacks, unrelated to the source of error. Adding print stmts to try_call at errorhandler.py shows that orginal traceback is there but then (I guess) discarded. If I'm missing something, please explain how I can access original traceback. If it cannot be accessed please fix error handling so I can access it. ;) May be add another argument like tg_traceback to dispatch_error? Max. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: SqlSoup: SQLAlchemy keeps rocking...
Kevin Dangoor wrote: Hi Michele, Thanks for forwarding that. I hadn't seen that particular posting, but I did read about SQL Soup on the sqlalchemy list. Nice stuff (though I still with an ORM myself :) Yep, me too, but it's really nice (as Ian said on his post) to take any existing db and be able to use it with SQLAlchemy in such a straightforward way. :-) By the way, I exchanged a couple messages with Mike Bayer a couple weeks ago about SQLAlchemy's status. It sounds like SQLAlchemy is actually pretty well baked at this point. To make an official switch requires 1) a migration path for current users 2) New versions of CatWalk/Model Designer/tg-admin sql Since TurboGears already features some support for SQLAlchemy, these things can be tackled any time. (Of course, potentially destabilizing changes don't belong on the trunk... I guess the more times I say that, the more that means I should really just do the branch thing.) Yep, probably food for FirstClass (am I right?), I was wondering today (also inspired by Mark [1]) how much difficult could it be to write a SQLObject wrapper that maps things to a SQLAlchemy database for backward compatibility, the most difficult thing is probably the query mechanism and SQLBuilder, but I've not used SQLObject or SQLAlchemy that much so I'm probably plain wrong. Ciao Michele [1] http://compoundthinking.com/blog/index.php/2006/04/10/python-database-projects-arise/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: providing default error handler: how to get the traceback?
I'll look into it. However the main problem is the traceback is not a property of the exception but a completely separate entity. What I will probably do is wait for First Class (to become trunk) and than change [each item of] tg_exceptions to a tuple similar to what sys.exc_info() returns and add some automatic cleanups. If you are in dire need, I can conjure up a proof of concept before that. Cheers, Simon Max Ischenko wrote: Hi, My post is mostly for Simon. I want to intercept all application errors that normally results in CherryPy's 500 Internal Error page to save error info and display it differently. My error handler defined like this: @dispatch_error.when(tg_exceptions is not None) def notify_on_error(controller, tg_source, tg_errors, tg_exceptions, *args, **kw): # record error and format for display return 'FAIL' The problem is that I cannot get to the traceback I usually see on 500 error page. The tg_exception is just an exception, sys.exc_info() and traceback.extract_stack() both give different tracebacks, unrelated to the source of error. Adding print stmts to try_call at errorhandler.py shows that orginal traceback is there but then (I guess) discarded. If I'm missing something, please explain how I can access original traceback. If it cannot be accessed please fix error handling so I can access it. ;) May be add another argument like tg_traceback to dispatch_error? Max. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: r1126: to_unicode removed from Widget
Michele, In r1126 [1] I've removed the use of to_unicode from adjust_value, it should work all right since we are now using the CP decoding filter, anyway if you (for example Max and Jorge that I think need this feature) start experiencing problems we will just revert this change, it's just an attempt to reduce monkeypatching here and there. ;-) I appreciate the idea but not the results. ;-) IOW, my code no longer works: File string, line 25, in _pull File c:\python24\lib\site-packages\kid-0.9-py2.4.egg\kid\template_util.py, line 60, in make_attrib ls = [to_unicode(i, encoding) for i in v if i is not None] File c:\python24\lib\site-packages\kid-0.9-py2.4.egg\kid\pull.py, line 190, in to_unicode return unicode(value, encoding) UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: r1126: to_unicode removed from Widget
Back in r1132. :-) Ciao Michele Michele Cella wrote: Max Ischenko wrote: In r1126 [1] I've removed the use of to_unicode from adjust_value, it should work all right since we are now using the CP decoding filter, anyway if you (for example Max and Jorge that I think need this feature) start experiencing problems we will just revert this change, it's just an attempt to reduce monkeypatching here and there. ;-) I appreciate the idea but not the results. ;-) The problem is that with the current setup there is no way it would work without to_unicode kludge. See, when I pass unicode string to field.display() it calls validator which turns it into utf-8 string which then fails when Kid interprets it as ascii string. May be we should fix the validator to do nothing in from_python but I'm far from sure. May be we should call adjust_value with convert=False whatever that means to skip validator. May be you'd better just put to_unicode back. ;-) One thing we should do for sure is to add a unit test which exercises unicode-related behaviour. I added primitive test_unicode_input() testcase to test_widgets.py. It passes with to_unicode() in-place and fails without. Please put to_unicode() back and then look for better solution. ;-) One pain with Kid is that once this encoded-string slips in and Kid fails it gives incomprehensible error message. May be we should try to detect such errors ourselves to at least fail in a meaningful way. I mean adding something like this to adjust_value(): if isinstance(value, str): try: unicode(value) except UnicodeDecodeError: raise ValueError(Non-unicode string in %s: %r % (self, value)) Max. Hi Max, It's great to have you watching unicode related things as I'm not experienced on this camp, thanks for the test, as I said there is not problem, I'm going to put to_unicode back into the game! ;-) Ciao Michele --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: SqlSoup: SQLAlchemy keeps rocking...
On Tue, 11 Apr 2006 14:10:35 - Michele Cella [EMAIL PROTECTED] wrote: Kevin Dangoor wrote: Hi Michele, Thanks for forwarding that. I hadn't seen that particular posting, but I did read about SQL Soup on the sqlalchemy list. Nice stuff (though I still with an ORM myself :) Yep, me too, but it's really nice (as Ian said on his post) to take any existing db and be able to use it with SQLAlchemy in such a straightforward way. :-) By the way, I exchanged a couple messages with Mike Bayer a couple weeks ago about SQLAlchemy's status. It sounds like SQLAlchemy is actually pretty well baked at this point. To make an official switch requires 1) a migration path for current users 2) New versions of CatWalk/Model Designer/tg-admin sql Since TurboGears already features some support for SQLAlchemy, these things can be tackled any time. (Of course, potentially destabilizing changes don't belong on the trunk... I guess the more times I say that, the more that means I should really just do the branch thing.) Yep, probably food for FirstClass (am I right?), I was wondering today (also inspired by Mark [1]) how much difficult could it be to write a SQLObject wrapper that maps things to a SQLAlchemy database for backward compatibility, the most difficult thing is probably the query mechanism and SQLBuilder, but I've not used SQLObject or SQLAlchemy that much so I'm probably plain wrong. Ciao Michele [1] http://compoundthinking.com/blog/index.php/2006/04/10/python-database-projects-arise/ I know my opinion doesn't really matter, but my company is planning on sticking with 1.0 when it's released and then waiting for First Class to become more stable. My understanding is that some things from SQLAlchemy would make our lives much easier. It would be nice if SQLAlchemy was at least an option in 1.0 (even if it was something added after release). Heck, if the changes were straightforward enough, I might even maintain a backport myself. Jason signature.asc Description: PGP signature
[tg-trunk] Re: SqlSoup: SQLAlchemy keeps rocking...
On 4/11/06, Jason Chu [EMAIL PROTECTED] wrote: I know my opinion doesn't really matter, but my company is planning on sticking with 1.0 when it's released and then waiting for First Class to become more stable. My understanding is that some things from SQLAlchemy would make our lives much easier. It would be nice if SQLAlchemy was at least an option in 1.0 (even if it was something added after release). I promise that we're working on that documentation thing TurboGears already offers support for SQLAlchemy. It just doesn't offer backwards compatibility or fancy things like CatWalk, Model Designer and FastData. Kevin --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: r1126: to_unicode removed from Widget
Michele, It's great to have you watching unicode related things as I'm not experienced on this camp, thanks for the test, as I said there is not problem, I'm going to put to_unicode back into the game! ;-) I'm all for removing monkeypatching code. In this specific case, leaving to_unicode as is probably the way to go until a better solution found. Besides, how about raising an exception instead of ignoring it (line 39): try: encoding = config.get('kid.encoding', 'utf8') value = unicode(value, encoding) except UnicodeDecodeError: raise ValueError(Non-unicode string: %r % value) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: SqlSoup: SQLAlchemy keeps rocking...
On Tue, 11 Apr 2006 12:22:51 -0400 Kevin Dangoor [EMAIL PROTECTED] wrote: On 4/11/06, Jason Chu [EMAIL PROTECTED] wrote: I know my opinion doesn't really matter, but my company is planning on sticking with 1.0 when it's released and then waiting for First Class to become more stable. My understanding is that some things from SQLAlchemy would make our lives much easier. It would be nice if SQLAlchemy was at least an option in 1.0 (even if it was something added after release). I promise that we're working on that documentation thing TurboGears already offers support for SQLAlchemy. It just doesn't offer backwards compatibility or fancy things like CatWalk, Model Designer and FastData. Kevin Ok, let me rephrase my statement: I hope that 1.0 has support w.r.t. FastData, Identity, and CatWalk for SQLAlchemy. ;) Backwards compatibility would also be nice, but not entirely necessary, because we've already done a bunch of development using SQLObject. I think the guys would kill me if I tried to convert over to SQLAlchemy right now anyway... Jason signature.asc Description: PGP signature
[tg-trunk] Re: SqlSoup: SQLAlchemy keeps rocking...
On 4/11/06, Jason Chu [EMAIL PROTECTED] wrote: Ok, let me rephrase my statement: I hope that 1.0 has support w.r.t. FastData, Identity, and CatWalk for SQLAlchemy. ;) 1.0 is done, other than cleanup. Backwards compatibility would also be nice, but not entirely necessary, because we've already done a bunch of development using SQLObject. I think the guys would kill me if I tried to convert over to SQLAlchemy right now anyway... Rightfully so :) Kevin --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: r1126: to_unicode removed from Widget
Max Ischenko wrote: Michele, It's great to have you watching unicode related things as I'm not experienced on this camp, thanks for the test, as I said there is not problem, I'm going to put to_unicode back into the game! ;-) I'm all for removing monkeypatching code. In this specific case, leaving to_unicode as is probably the way to go until a better solution found. Yes, indeed. ;-) Besides, how about raising an exception instead of ignoring it (line 39): try: encoding = config.get('kid.encoding', 'utf8') value = unicode(value, encoding) except UnicodeDecodeError: raise ValueError(Non-unicode string: %r % value) Seems good and I've seen you've already done that. ;-) Ciao Michele --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[tg-trunk] Re: providing default error handler: how to get the traceback?
Max Ischenko wrote: I'll look into it. However the main problem is the traceback is not a property of the exception but a completely separate entity. That's true. But the error handling code seems to be messing it up. Actually, it doesn't mess it up, it just catches the exception, removing any guaranties that the caught exception is the last in the execution path (making exc_info() and relatives inconsistent). Cheers, Simon --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[TurboGears] Re: how to debug: 'NoneType' object is not callable
Remember to save and show us the trackback when this happens again, just to collect more info... Ciao Michele Max Ischenko wrote: Michele, I get this error with latest SVN. The most troublesome thing is that I haven't got this error until the service was deployed and left running for about a day. ;-( Restart did help but I can expect it to happen again and thus just *have to* find out what's going on. --~--~-~--~~~---~--~~ 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: Why Cheetah is being install with tg0.9+?
Jorge Vargas wrote: It's my undestanding Cheetah is an optional package after the subway comunity join us, but my tg-admin info show Cheetah 1.0 but the requires.txt file for 0.9a4 doesn't shows Cheetah, is it being install as a dependancy of anothey package? Yes, I pretty sure PasteScript uses it. Ciao Michele --~--~-~--~~~---~--~~ 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: how to debug: 'NoneType' object is not callable
The traceback is as usual, (most probably) unrelated to actual problem's cause: File /users/home/mak-sim/lib/python2.4/site-packages/TurboGears-0.9a5dev_r1105-p y2.4.egg/turbogears/controllers.py, line 56, in _process_output mapping=mapping, content_type=content_type,fragment=fragment) File /users/home/mak-sim/lib/python2.4/site-packages/TurboGears-0.9a5dev_r1105-p y2.4.egg/turbogears/view/base.py, line 131, in render return engine.render(**kw) File /users/home/mak-sim/lib/python2.4/site-packages/TurboKid-0.9.4dev_r1090-py2 .4.egg/turbokid/kidsupport.py, line 154, in render return t.serialize(encoding=self.defaultencoding, output=format, fragment=fragm ent) File /users/home/mak-sim/lib/python2.4/site-packages/kid-0.9-py2.4.egg/kid/__ini t__.py, line 236, in serialize return serializer.serialize(self, encoding, fragment) File /users/home/mak-sim/lib/python2.4/site-packages/kid-0.9-py2.4.egg/kid/seria lization.py, line 51, in serialize text = list(self.generate(stream, encoding, fragment)) File /users/home/mak-sim/lib/python2.4/site-packages/kid-0.9-py2.4.egg/kid/seria lization.py, line 324, in generate stream = iter(stream) File /users/home/mak-sim/lib/python2.4/site-packages/kid-0.9-py2.4.egg/kid/__ini t__.py, line 261, in __iter__ return iter(self.transform()) File /users/home/mak-sim/lib/python2.4/site-packages/kid-0.9-py2.4.egg/kid/__ini t__.py, line 316, in transform stream = self.pull() File /users/home/mak-sim/lib/python2.4/site-packages/kid-0.9-py2.4.egg/kid/__ini t__.py, line 275, in pull self.initialize() File /users/home/mak-sim/lib/python2.4/site-packages/BookSwap-1.0-py2.4.egg/book swap/templates/feedback.py, line 20, in initialize File /users/home/mak-sim/lib/python2.4/site-packages/BookSwap-1.0-py2.4.egg/book swap/templates/master.py, line 21, in initialize TypeError: 'NoneType' object is not callable --~--~-~--~~~---~--~~ 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] IdentityMangement - troubles
Hi, following the IdentityManagement tutorial, i found an error when i try to insert a new user using Catwalk. When I press Save, the page doesn't proceed, and looking at the debug window, i see: 10/Apr/2006:21:10:29 HTTP INFO Page handler: bound method CatWalk.add of turbogears.toolbox.catwalk.CatWalk object at 0x01459590 Traceback (most recent call last): File c:\python24\lib\site-packages\cherrypy-2.2.0-py2.4.egg\cherrypy\_cphttptools.py, line 106, in _run self.main() File c:\python24\lib\site-packages\cherrypy-2.2.0-py2.4.egg\cherrypy\_cphttptools.py, line 255, in main body = page_handler(*virtual_path, **self.params) File string, line 3, in add File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears\controllers.py, line 206, in expose output = database.run_with_transaction(expose._expose,func, accept, allow_json, allow_json_from_config,*args, **kw) File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears\database.py, line 216, in run_with_transaction retval = func(*args, **kw) File string, line 5, in _expose File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears\controllers.py, line 227, in lambda expose._expose.when(rule)(lambda _func, accept, allow_json, allow_json_from_config,*args,**kw: _execute_func( File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears\controllers.py, line 248, in _execute_func output = errorhandling.try_call(func, *args, **kw) File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears\errorhandling.py, line 71, in try_call output = func(self, *args, **kw) File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears\toolbox\catwalk\__init__.py, line 786, in add new_object = obj(**params) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\declarative.py, line 92, in _wrapper return_value = fn(self, *args, **kwargs) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\main.py, line 1197, in __init__ self._create(id, **kw) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\inheritance\__init__.py, line 218, in _create super(InheritableSQLObject, self)._create(id, **kw) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\main.py, line 1216, in _create raise TypeError, %s() did not get expected keyword argument %s % (self.__class__.__name__, column.name) TypeError: TG_User() did not get expected keyword argument user_name Request Headers: COOKIE: tg-visit=5ea0f88808457095144a1341f87c76df1eae0a38 Content-Length: 125 ACCEPT-CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.7 USER-AGENT: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1 CONNECTION: keep-alive PRAGMA: no-cache CONTENT-LENGTH: 125 HOST: localhost:7654 CACHE-CONTROL: no-cache CONTENT-TYPE: application/x-www-form-urlencoded ACCEPT: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Remote-Addr: 127.0.0.1 ACCEPT-LANGUAGE: it-it,it;q=0.8,en;q=0.5,en-us;q=0.3 Content-Type: application/x-www-form-urlencoded Remote-Host: 127.0.0.1 ACCEPT-ENCODING: gzip,deflate KEEP-ALIVE: 300 127.0.0.1 - - [10/Apr/2006:21:10:29] POST /catwalk/add HTTP/1.1 500 3264 Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.0.1) Gecko/20060111 Firefox/1 .5.0.1 In addiction, if i try to add a new user using tg-admin shell, the error is: from turbogears.identity.soprovider import * hub.begin() sqlobject.dbconnection.Transaction object at 0x00DAC970 u=TG_User(user_name=jeff, email_address=[EMAIL PROTECTED], ... display_name=Jeff Watkins, password=x) Traceback (most recent call last): File console, line 2, in ? File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\declarative.py, line 92, in _wrapper return_value = fn(self, *args, **kwargs) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\main.py, line 1197, in __init__ self._create(id, **kw) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\inheritance\__init__.py, line 218, in _create super(InheritableSQLObject, self)._create(id, **kw) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\main.py, line 1221, in _create self.set(**kw) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\main.py, line 1097, in set setattr(self, name, value) File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears\identity\soprovider.py, line 316, in _set_password hash = identity.current_provider.encrypt_password(cleartext_password) File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears\identity\__init__.py, line 79, in
[TurboGears] Re: IdentityMangement - troubles
Moving the DB from SQLite to MySQL 5.0.19, and launching the start-myprojectname.py i see an other error, but i'm not able to understand if it is connected to the errors specified above: C:\Documents and Settings\renzo\Desktop\identstart-ident.py 10/Apr/2006:23:41:59 CONFIG INFO Server parameters: 10/Apr/2006:23:41:59 CONFIG INFO server.environment: development 10/Apr/2006:23:41:59 CONFIG INFO server.log_to_screen: True 10/Apr/2006:23:41:59 CONFIG INFO server.log_file: 10/Apr/2006:23:41:59 CONFIG INFO server.log_tracebacks: True 10/Apr/2006:23:41:59 CONFIG INFO server.log_request_headers: True 10/Apr/2006:23:41:59 CONFIG INFO server.protocol_version: HTTP/1.0 10/Apr/2006:23:41:59 CONFIG INFO server.socket_host: 10/Apr/2006:23:41:59 CONFIG INFO server.socket_port: 8080 10/Apr/2006:23:41:59 CONFIG INFO server.socket_file: 10/Apr/2006:23:41:59 CONFIG INFO server.reverse_dns: False 10/Apr/2006:23:41:59 CONFIG INFO server.socket_queue_size: 5 10/Apr/2006:23:41:59 CONFIG INFO server.thread_pool: 10 2006-04-10 23:41:59,828 turbogears.visit INFO Visit Tracking starting 2006-04-10 23:41:59,828 turbogears.visit DEBUG Loading visit manager from plugin : sqlobject 2006-04-10 23:41:59,905 turbogears.visit INFO Visit filter initialised 2006-04-10 23:42:00,312 turbogears.identity INFO Identity starting 2006-04-10 23:42:00,312 turbogears.identity DEBUG Loading provider from plugin: sqlobject 2006-04-10 23:42:00,312 turbogears.identity.soprovider INFO Succesfully loaded turbogears.identity.soprovider.TG_User 2006-04-10 23:42:00,312 turbogears.identity.soprovider INFO Succesfully loaded turbogears.identity.soprovider.TG_Group 2006-04-10 23:42:00,312 turbogears.identity.soprovider INFO Succesfully loaded turbogears.identity.soprovider.TG_Permission Unhandled exception in thread started by bound method Server._start of cherrypy._cpserver.Server object at 0x00B9F610 Traceback (most recent call last): File c:\python24\lib\site-packages\cherrypy-2.2.0-py2.4.egg\cherrypy\_cpserver.py, line 78, in _start Engine._start(self) File c:\python24\lib\site-packages\cherrypy-2.2.0-py2.4.egg\cherrypy\_cpengine.py, line 108, in _start func() File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears\startup.py, line 204, in startTurboGears ext.start_extension() File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears\identity\visitor.py, line 33, in start_extension create_extension_model() File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears\identity\visitor.py, line 48, in create_extension_model provider.create_provider_model() File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears\identity\soprovider.py, line 179, in create_provider_model TG_VisitIdentity.createTable(ifNotExists=True) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\main.py, line 1322, in createTable conn.createTable(cls) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\dbconnection.py, line 524, in createTable self.query(self.createTableSQL(soClass)) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\dbconnection.py, line 747, in query return self._dbConnection._query(self._connection, s) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\dbconnection.py, line 302, in _query self._executeRetry(conn, conn.cursor(), s) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg\sqlobject\mysql\mysqlconnection.py, line 60, in _executeRetry return cursor.execute(query) File C:\Python24\Lib\site-packages\MySQLdb\cursors.py, line 137, in execute self.errorhandler(self, exc, value) File C:\Python24\Lib\site-packages\MySQLdb\connections.py, line 33, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.OperationalError: (1170, BLOB/TEXT column 'visit_key' used in key specification without a key length) Note that turbogears.identity.soprovider.* is imported into my model. And looking at the MySQL database, after this error it contains: tg_group, tg_group_permission, tg_permission, tg_user, tg_user_group, tg_visit. Thanks, Renzo --~--~-~--~~~---~--~~ 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: IdentityMangement - troubles
This last problem was my fault, I forgot to specify the length on the visit_key index for the lookup table that associates visits with identities. Sorry. It's fixed in r1128. On 11 Apr, 2006, at 7:33 am, Renzo wrote: Moving the DB from SQLite to MySQL 5.0.19, and launching the start-myprojectname.py i see an other error, but i'm not able to understand if it is connected to the errors specified above: C:\Documents and Settings\renzo\Desktop\identstart-ident.py 10/Apr/2006:23:41:59 CONFIG INFO Server parameters: 10/Apr/2006:23:41:59 CONFIG INFO server.environment: development 10/Apr/2006:23:41:59 CONFIG INFO server.log_to_screen: True 10/Apr/2006:23:41:59 CONFIG INFO server.log_file: 10/Apr/2006:23:41:59 CONFIG INFO server.log_tracebacks: True 10/Apr/2006:23:41:59 CONFIG INFO server.log_request_headers: True 10/Apr/2006:23:41:59 CONFIG INFO server.protocol_version: HTTP/1.0 10/Apr/2006:23:41:59 CONFIG INFO server.socket_host: 10/Apr/2006:23:41:59 CONFIG INFO server.socket_port: 8080 10/Apr/2006:23:41:59 CONFIG INFO server.socket_file: 10/Apr/2006:23:41:59 CONFIG INFO server.reverse_dns: False 10/Apr/2006:23:41:59 CONFIG INFO server.socket_queue_size: 5 10/Apr/2006:23:41:59 CONFIG INFO server.thread_pool: 10 2006-04-10 23:41:59,828 turbogears.visit INFO Visit Tracking starting 2006-04-10 23:41:59,828 turbogears.visit DEBUG Loading visit manager from plugin : sqlobject 2006-04-10 23:41:59,905 turbogears.visit INFO Visit filter initialised 2006-04-10 23:42:00,312 turbogears.identity INFO Identity starting 2006-04-10 23:42:00,312 turbogears.identity DEBUG Loading provider from plugin: sqlobject 2006-04-10 23:42:00,312 turbogears.identity.soprovider INFO Succesfully loaded turbogears.identity.soprovider.TG_User 2006-04-10 23:42:00,312 turbogears.identity.soprovider INFO Succesfully loaded turbogears.identity.soprovider.TG_Group 2006-04-10 23:42:00,312 turbogears.identity.soprovider INFO Succesfully loaded turbogears.identity.soprovider.TG_Permission Unhandled exception in thread started by bound method Server._start of cherrypy._cpserver.Server object at 0x00B9F610 Traceback (most recent call last): File c:\python24\lib\site-packages\cherrypy-2.2.0-py2.4.egg\cherrypy \_cpserver.py, line 78, in _start Engine._start(self) File c:\python24\lib\site-packages\cherrypy-2.2.0-py2.4.egg\cherrypy \_cpengine.py, line 108, in _start func() File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears \startup.py, line 204, in startTurboGears ext.start_extension() File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears \identity\visitor.py, line 33, in start_extension create_extension_model() File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears \identity\visitor.py, line 48, in create_extension_model provider.create_provider_model() File c:\documents and settings\renzo\documenti\sw\python\turbogears\svn\turbogears \identity\soprovider.py, line 179, in create_provider_model TG_VisitIdentity.createTable(ifNotExists=True) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg \sqlobject\main.py, line 1322, in createTable conn.createTable(cls) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg \sqlobject\dbconnection.py, line 524, in createTable self.query(self.createTableSQL(soClass)) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg \sqlobject\dbconnection.py, line 747, in query return self._dbConnection._query(self._connection, s) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg \sqlobject\dbconnection.py, line 302, in _query self._executeRetry(conn, conn.cursor(), s) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1684-py2.4.egg \sqlobject\mysql\mysqlconnection.py, line 60, in _executeRetry return cursor.execute(query) File C:\Python24\Lib\site-packages\MySQLdb\cursors.py, line 137, in execute self.errorhandler(self, exc, value) File C:\Python24\Lib\site-packages\MySQLdb\connections.py, line 33, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.OperationalError: (1170, BLOB/TEXT column 'visit_key' used in key specification without a key length) Note that turbogears.identity.soprovider.* is imported into my model. And looking at the MySQL database, after this error it contains: tg_group, tg_group_permission, tg_permission, tg_user, tg_user_group, tg_visit. Thanks, Renzo -- Jeff Watkins [EMAIL PROTECTED] We're growing the government at a pace that makes Democrats look thrifty. -- Senator Lindsey Graham, (R) South Carolina --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups TurboGears group. To post to this group,
[TurboGears] Re: Can't name a class Group with SQLObject
On 4/10/06, Steve Bergman [EMAIL PROTECTED] wrote: I'm not sure 'fault' is the right word. I never use words which are reserved in any of the underlying packages that I am using, even if I *could* do it. It's a sure recipe for confusion down the road. I'm with you here. Just because you can INSERT INTO SELECT (SELECT) VALUES (SELECT) doesn't mean you should. :-) -- Tim Lesher [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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: IdentityMangement - troubles
Hi Jeff, perfect! Now Turbogears is able to create all the necessaty table using MySQL. But the first problem written above is still present. It's strange but it's impossible to create a user, using Catwalk or the Turbogears shell. Thanks! Renzo --~--~-~--~~~---~--~~ 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] 0.9a4 and mod_python
I followed instructions on http://trac.turbogears.org/turbogears/wiki/ModPythonIntegration09. Everything works but I'm thiese errors in apache log. [client 192.168.0.8] Request exceeded the limit of 10 subrequest nesting levels due to probable confguration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. ... [Mon Apr 10 23:36:50 2006] [debug] /home/adconrad/build/apache2/security/sarge/apache2-2.0.54/build-tree/ap ache2/server/core.c(2756): [client 87.206.217.140] subrequested from r-uri = /tg_widgets/turbogears.widgets/spinnerstopped.png [Mon Apr 10 23:36:50 2006] [debug] /home/adconrad/build/apache2/security/sarge/apache2-2.0.54/build-tree/ap ache2/server/core.c(2756): [client 87.206.217.140] subrequested from r-uri = /tg_widgets/turbogears.widgets/spinnerstopped.png Raising LimitInternalRecursio to 100 didn't help. So something might be wrong. Any ideas what could be wrong ? How to debug it ? Requesting /tg_widgets/turbogears.widgets/spinnerstopped.png returns a valid object. Thanks in advance for Your time. -- Lazy --~--~-~--~~~---~--~~ 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: IdentityMangement - troubles
Well, the turbogears shell problem is somewhat well known. The problem is that a change was made some time ago to automatically encrypt passwords (if encryption is enabled) when they are set in the TG_User object. Unfortunately, this works by asking the current Identity provider to encrypt the password based on configuration settings. However, the current identity provider isn't available because it is stashed in the request, and there is no request.Hence the RequestRequiredException.I'm not certain what the problem is with CatWalk, but I did notice it the other day. I just don't have time to track it down.On 11 Apr, 2006, at 8:14 am, Renzo wrote:It's strange but it's impossible to create a user, using Catwalk or the Turbogears shell. --Jeff Watkinshttp://newburyportion.com/'I know about people who talk about suffering for the common good. It's never bloody them! When you hear a man shouting "Forward, brave comrades!" you'll see he's the one behind the bloody big rock and the one wearing the only really arrow-proof helmet!'-- Rincewind gives a speech on politics. (Terry Pratchett, Interesting Times) --~--~-~--~~~---~--~~ 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: Why Cheetah is being install with tg0.9+?
On 4/11/06, Jorge Vargas [EMAIL PROTECTED] wrote: It's my undestanding Cheetah is an optional package after the subway comunity join us, but my tg-admin info show Cheetah 1.0 but the requires.txt file for 0.9a4 doesn't shows Cheetah, is it being install as a dependancy of anothey package? Yeah, it's being brought in by PasteScript. I've exchanged a couple of emails with Ian about this. PasteScript doesn't *really* need Cheetah. But, I can imagine that our quickstart templates might get to the point where they have optional bits that really benefit from being able to do if/then rather than just variable substitution. 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: o3 magazine wants TurboGears articles
On 4/10/06, Simon Belak [EMAIL PROTECTED] wrote: What's the deadline? I'm thinking about something along the lines use- cases for generic functions in TG. OK, now that I know there's interest in writing some articles... I have confirmed a deadline date of June 26th. I'd like to bundle up a list of names and article ideas to pass by the editor. Before you start writing something, he should say whether or not the idea fits well into the magazines columns. But, I think it's best for us to start with what we'd really like to write. 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] Context sensitive help support via CP filter
I would like to make context sensitive help support in my intranet app. There are two elements that define this help system:1. Context - created by appending /help at the end of current (RESTful) path.2. Help text - KID files from myproj/templates/help directory tree. Template files are located by matching parts from context path to files from help directory. For example, for context /cc/kampanja/1/show/help, following files and/or directories will be searched for:- templates/help/cc/kampanja/1/show.kid- templates/help/cc/kampanja/1/show/index.kid - templates/help/cc/kampanja/1/show/- templates/help/cc/kampanja/1.kid - templates/help/cc/kampanja/1/index.kid - templates/help/cc/kampanja/1/ - templates/help/cc/kampanja.kid - templates/help/cc/kampanja/index.kid - templates/help/cc/kampanja/ - templates/help/cc.kid - templates/help/cc/index.kid - templates/help/cc/ - templates/help/index.kid - templates/help/ First one that is found is being served. If system finds directory instead of file then a directory listing is automatically created and returned.This way I can write most specific help file to the given task the user is performing by simply creating the file in the appropriate location within templates/help tree. Currently I have a function that I call from all my default() handlers and from help() handler found inside every controller like this:class KampanjaControler(controllers.Controller): @turbogears.expose () @identity.require(identity.in_group(user)) def help(self, *vpath, **kw): return context_sensitive_help() @turbogears.expose(html=.templates.kampanja) @ identity.require(identity.in_group(user)) def default(self, *vpath, **kw): if vpath and vpath[-1].lower()=='help': return context_sensitive_help() ...Simplified version of context_sensitive_help() function looks like this: base = r'D:\OZ\Projects\ccleads\ccleads\templates\help'def context_sensitive_help(): parts = cherrypy.request.path.strip(r\/).split(/) if parts and parts[-1]=='help': parts.pop(-1) while parts: # Find file ... req = os.path.join(base, *parts) if os.path.exists(req + '.kid'): template = .templates.help. + (..join(parts)) return dict(tg_template = template, **get_page_params(base, parts)) # ... or directory elif os.path.isdir(req): # Served by explicit index file if os.path.exists (os.path.join(req, 'index.kid')): template = .templates.help. + (..join(parts+['index'])) return dict(tg_template = template, **get_page_params(base, parts)) # Served by dynamically generated index file else: return dict(tg_template = .templates.help._index, **get_index_params(base, parts)) parts.pop(-1) # Served by dynamically generated index file return dict(tg_template = .templates.help._index, **get_index_params(base))My solution requires sprinkling of my controller code with context_sensitive_help() calls which I really don't like. I would like to turn this into CherryPy Filter but don't know how. It should be enough to just install it as _cp_filter on my root controller and that it processes all requests ending with /help and returns processed KID template. Thanks,Tvrtko --~--~-~--~~~---~--~~ 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: Can't name a class Group with SQLObject
2006/4/11, Tim Lesher [EMAIL PROTECTED]: On 4/10/06, Steve Bergman [EMAIL PROTECTED] wrote: I'm not sure 'fault' is the right word.I never use words which are reserved in any of the underlying packages that I am using, even if I *could* do it.It's a sure recipe for confusion down the road. I'm with you here.Just because you canINSERT INTO SELECT (SELECT) VALUES (SELECT)doesn't mean you should. :-)--Tim Lesher [EMAIL PROTECTED] in my case,while wanting to create a Order(SQLObject) in mySQL database,error occurs! maybe the answer is order is a reserver word in SQL-language. solution like this: class Order(SQLObject): class sqlmeta: table = order_table --~--~-~--~~~---~--~~ 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: Why Cheetah is being install with tg0.9+?
Cheetah 2.0 rc6 is out. Any reason not to include Cheetah 2? On 4/11/06, Kevin Dangoor [EMAIL PROTECTED] wrote: On 4/11/06, Jorge Vargas [EMAIL PROTECTED] wrote: It's my undestanding Cheetah is an optional package after the subway comunity join us, but my tg-admin info show Cheetah 1.0 but the requires.txt file for 0.9a4 doesn't shows Cheetah, is it being install as a dependancy of anothey package?Yeah, it's being brought in by PasteScript. I've exchanged a couple ofemails with Ian about this. PasteScript doesn't *really* need Cheetah. But, I can imagine that our quickstart templates might get to thepoint where they have optional bits that really benefit from beingable to do if/then rather than just variable substitution.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: Can't name a class Group with SQLObject
On 4/11/06, lew ghiewa [EMAIL PROTECTED] wrote: in my case,while wanting to create a Order(SQLObject) in mySQL database,error occurs! maybe the answer is order is a reserver word in SQL-language. That's correct. For example, this SQL query gets the name and age fields from the table named people, and returns them ordered by age: SELECT name, age FROM people ORDER BY age Personally, I've taken the approach of _always_ specifying a project prefix in either the SQLObject class name or in the sqlmeta. For example, if your app name is Spam, either name your objects: class SpamOrder(SQLObject): or else put it in the sqlmeta inner class: class Order(SQLObject): class sqlmeta: table = 'spam_order' This gets even more important when you start using multiple apps together. -- Tim Lesher [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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] Retrieve object back from form submission
Hello, I do not know if this is yet implemented in TurboGears, or how easily it would be to implement. What I would like is to receive the objects I am sending to the HTML form, back when the form is submitted. i.e. in below exemple I would send a myobject object; and use its bar property in a kid template (let's say a form input). When the user submits; the save method would be called with the myobject object as a parameter (and not the bar property). turbogears.expose(mytemplate) def index(self): myobject = Foo(bar=1) return dict(publish_object=myobject) turbogears.expose(mytemplate2) def save(self, publish_object): print value is: %d % publish_object.bar return dict() I think that this would really help when objects have a lot of properties. Any thoughts, comments (or working implementations ;-) ) ? Thanks, Yannick --~--~-~--~~~---~--~~ 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: Context sensitive help support via CP filter
You should be able to extend the base controller and add a help function to that. I just tested it using a mixin which seems to work pretty well. Here is what I did: class Helper: @turbogears.expose() def help(self): return dict(path=cherrypy.request.path) class Root(controllers.RootController, Helper): ... At that point root automatically gets a help method, and to add it to anything other objects you would just mixin that same class. I had some success adding it as an attribute of a method too, but I am not too sure if that is a good way to handle it. Anyways, here is what I did for that: class Root(controllers.RootController, Helper): ... @turbogears.expose() def test(self) return dict(test=This is a test.) test.help = Helper().help With testing it seems like this works well, even with the test function accepting parameters. My guess is that calls to test/help are processed by any attributes of test before they are turned into parameters of the test method call. Anyways, hope that helps. It does not entirely avoid having to make calls to context_sensitive_help(), but it does limit the whole thing to mixins and assigning attributes to methods. I have absolutely zero experience with cherrypy filters, so I may be reinventing the wheel there ... guess I have reading to do. --~--~-~--~~~---~--~~ 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] cryptic testing failure
I am trying to setup my application for unit testing, but I am getting a very cryptic failure right off the batch. (Seel below). Could someone please tell me what is going on (BTW: My mode.py defines the object Test() with a foreign key testType.) Thanks! = C:\dev\sgresultsdb\trunkpython setup.py test running test running egg_info writing requirements to sgresultsdb.egg-info\requires.txt writing sgresultsdb.egg-info\PKG-INFO writing top-level names to sgresultsdb.egg-info\top_level.txt writing manifest file 'sgresultsdb.egg-info\SOURCES.txt' running build_ext ERROR ERROR Object creation should set the name ... ERROR Traceback (most recent call last): File setup.py, line 23, in ? test_suite = 'nose.collector', File C:\Python24\lib\distutils\core.py, line 149, in setup dist.run_commands() File C:\Python24\lib\distutils\dist.py, line 946, in run_commands self.run_command(cmd) File C:\Python24\lib\distutils\dist.py, line 966, in run_command cmd_obj.run() File c:\python24\lib\site-packages\setuptools-0.6a10-py2.4.egg\setuptools\command\test.py, line 59, in run self.run_tests() File c:\python24\lib\site-packages\setuptools-0.6a10-py2.4.egg\setuptools\command\test.py, line 73, in run_test s unittest.main(None, None, [unittest.__file__]+self.test_args) File c:\python24\lib\unittest.py, line 759, in __init__ self.runTests() File c:\python24\lib\unittest.py, line 796, in runTests result = self.testRunner.run(self.test) File c:\python24\lib\unittest.py, line 696, in run test(result) File c:\python24\lib\unittest.py, line 428, in __call__ return self.run(*args, **kwds) File c:\python24\lib\unittest.py, line 424, in run test(result) File c:\python24\lib\site-packages\nose-0.8.6-py2.4.egg\nose\core.py, line 298, in __call__ self.run(*args, **kwds) File c:\python24\lib\site-packages\nose-0.8.6-py2.4.egg\nose\core.py, line 414, in run test(result) File c:\python24\lib\site-packages\nose-0.8.6-py2.4.egg\nose\core.py, line 298, in __call__ self.run(*args, **kwds) File c:\python24\lib\site-packages\nose-0.8.6-py2.4.egg\nose\core.py, line 414, in run test(result) File c:\python24\lib\site-packages\nose-0.8.6-py2.4.egg\nose\core.py, line 298, in __call__ self.run(*args, **kwds) File c:\python24\lib\site-packages\nose-0.8.6-py2.4.egg\nose\core.py, line 410, in run for test in self.collectTests(): File c:\python24\lib\site-packages\nose-0.8.6-py2.4.egg\nose\core.py, line 501, in collectTests for test in self.findTestsInModule(self.module): File c:\python24\lib\site-packages\nose-0.8.6-py2.4.egg\nose\core.py, line 554, in findTestsInModule [ tests.append(case) for case in File c:\python24\lib\site-packages\nose-0.8.6-py2.4.egg\nose\core.py, line 201, in loadTestsFromClass tests.append(MethodTestCase(klass, item)) File c:\python24\lib\site-packages\nose-0.8.6-py2.4.egg\nose\core.py, line 149, in __init__ self.testInstance = self.klass() File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1457-py2.4.egg\sqlobject\main.py, line 1197, in __init__ self._create(id, **kw) File c:\python24\lib\site-packages\sqlobject-0.7.1dev_r1457-py2.4.egg\sqlobject\main.py, line 1216, in _create raise TypeError, %s() did not get expected keyword argument %s % (self.__class__.__name__, column.name) TypeError: Test() did not get expected keyword argument testTypeID --~--~-~--~~~---~--~~ 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: Retrieve object back from form submission
You could make publish_object the contents of a hidden form field (assuming you are using a form to access the save method. Try the following in your mytemplate.kid file. This only works, of course, if publish_object can be represented as a string. input type=hidden value=${publish_object}/input --~--~-~--~~~---~--~~ 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] Identity - unexpected behaviour
Hi, In my application all pages can be viewed by both anonymous and identified users. On the index() page of the root controller there is a login form. The user ofcourse is not obligated to fill it to proceed, as the site is entirely accessible to anonymous users. I exhibit the following unexpected behaviour: a user may login, then click the back button and return to the root page. If he enters invalid login information now, he will be still identified as the previous user (since the authorisation by visit will still work). I think it is reasonable that if an identified user attemps a login and fails, he will be disconnected from the current identity. Any suggestions? Thanks, Nadav --~--~-~--~~~---~--~~ 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: Context sensitive help support via CP filter
Here is what I came up with:class HelpFilter(cherrypy.filters.basefilter.BaseFilter): def before_main(self): if cherrypy.request.path.endswith('help'): output = context_sensitive_help() template = output.pop(tg_template) if template.startswith(.): template = 'ccleads' + template format = 'html' content_type = 'text/html' mapping = None body = controllers._process_output(output, template, format, content_type, mapping) cherrypy.response.status = 200 OK cherrypy.response.body = body cherrypy.request.execute_main = Falsedef installHelpFilter(): cherrypy.root._cp_filters.append(HelpFilter())if installHelpFilter not in cherrypy.server.on_start_server_list: cherrypy.server.on_start_server_list.append(installHelpFilter)You just have to paste it into your controller.py and it just works. Of course there are some elements which are hard-coded to my application until I create a module. I'm not very intimate with TG internals so I'm not sure if this is the right way to do it (I'm calling and underscore _ function). Maybe somebody will have a better idea on how to do it.Also, I had some problems with Identity while I was trying to install my filter using this notation:class Root(controllers.RootController): _cp_filters = [UputeFilter()] Problem was that, apparently, identity is also installed as a filter. I guess that you remove identity from filters by using _cp_filters = [...] approach. If identity filter is not in the filter list before help filter (or at all) I cannot access identity variables, such as current user, in my templates. Also, in my initial approach (before posting first mail) I played with:cherrypy.request.executeMain = False as CP docs state that it should be done. It just didn't work so I gave up. Now, I discovered that you should use: cherrypy.request.execute_main = FalseOn 4/11/06, ajones [EMAIL PROTECTED] wrote: You should be able to extend the base controller and add a helpfunction to that. I just tested it using a mixin which seems to work pretty well. Here is what I did:class Helper:@turbogears.expose()def help(self):return dict(path=cherrypy.request.path)class Root(controllers.RootController, Helper):... At that point root automatically gets a help method, and to add it toanything other objects you would just mixin that same class. I had somesuccess adding it as an attribute of a method too, but I am not too sure if that is a good way to handle it. Anyways, here is what I didfor that:class Root(controllers.RootController, Helper):...@turbogears.expose()def test(self)return dict(test=This is a test.) test.help = Helper().helpWith testing it seems like this works well, even with the test functionaccepting parameters. My guess is that calls to test/help are processedby any attributes of test before they are turned into parameters of the test method call.Anyways, hope that helps. It does not entirely avoid having to makecalls to context_sensitive_help(), but it does limit the whole thing tomixins and assigning attributes to methods. I have absolutely zero experience with cherrypy filters, so I may be reinventing the wheelthere ... guess I have reading to do. --~--~-~--~~~---~--~~ 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: Retrieve object back from form submission
Other way to get this is to create a dict on session object and associate the object with an ID. In the hidden field put the ID, At save function expect the ID, search it on the dict, get the object a proccess according the other results. On this way you don't deppend whether the object could be represented as a string.IMO this could be put in a CP filter.Regards.On 4/11/06, Steven James [EMAIL PROTECTED] wrote: You could make publish_object the contents of a hidden form field(assuming you are using a form to access the save method.Try the following in your mytemplate.kid file. This only works, of course, if publish_object can be represented as a string.input type=hidden value=${publish_object}/input --~--~-~--~~~---~--~~ 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: Context sensitive help support via CP filter
If I decide to write a TG extension, how can I make sure that my CP filter is installed after Identity filter? --~--~-~--~~~---~--~~ 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] Tg-admin not accepting configuration file
As far as I can tell tg-admin does not accept a parameter for which configuration file to use. How am I supposed to create databases for dev, testing, staging, and production? Thanks --~--~-~--~~~---~--~~ 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: Tg-admin not accepting configuration file
I that's the case, which I wouldn't be supriced is, it's a bug that needs to be fixed. Please open a ticket on it. On 4/11/06, kavikaBldr [EMAIL PROTECTED] wrote: As far as I can tell tg-admin does not accept a parameter for which configuration file to use. How am I supposed to create databases for dev, testing, staging, and production? Thanks -- cheers elvelind grandin --~--~-~--~~~---~--~~ 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: Context sensitive help support via CP filter
I On Apr 11, 2006, at 8:50 PM, Qvx wrote: If I decide to write a TG extension, how can I make sure that my CP filter is installed after Identity filter? Good question. That should depend on the order entry_points are loaded in startup which I believe there is no way to guarantee a given order right now (that I'm aware of). I'm facing a similar problem right now implementing an authorization filter for TurboPeakSecurity because I need identity to kick in before authorization to retrieve the current user from there. One idea that comes to mind is subtituting the filter list with a priority queue of some sort that maintins the list interface. Extensions could then insert their filters at the prio. queue with the right priority. Something like SystemVs init levels (S20_network, S50_sshd, etc...). CP will then get the filters in the correct order when iterating this prio-list. Any comments on this? Alberto --~--~-~--~~~---~--~~ 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] TG and multiple apps
Hey there I was wondering what the situation with multiple applications is? For example, my work is gaining a suite of TG-powered in-house apps, which look a bit like this (from memory so won't be perfect): # /myapp/controllers.py import app1 class Root(controller): app1 = app1.Root() # /myapp/app1/controllers.py class Root(controller): etc... You get what I mean. However, each app (should) have its own database (and therefore a different DB URI), as well as its own models and such. The upshot of all this is tg-admin just doesn't work at all, and it's a pain having to symlink model.py all the time so the tg-admin sql commands work. Am I going about this the wrong way, and is there another way I should so it? Or does TG not support this? Thanks :-) -Rob --~--~-~--~~~---~--~~ 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: Retrieve object back from form submission
Um. Pickle? Yannick wrote: Hello, I do not know if this is yet implemented in TurboGears, or how easily it would be to implement. What I would like is to receive the objects I am sending to the HTML form, back when the form is submitted. i.e. in below exemple I would send a myobject object; and use its bar property in a kid template (let's say a form input). When the user submits; the save method would be called with the myobject object as a parameter (and not the bar property). turbogears.expose(mytemplate) def index(self): myobject = Foo(bar=1) return dict(publish_object=myobject) turbogears.expose(mytemplate2) def save(self, publish_object): print value is: %d % publish_object.bar return dict() I think that this would really help when objects have a lot of properties. Any thoughts, comments (or working implementations ;-) ) ? Thanks, Yannick --~--~-~--~~~---~--~~ 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: Tg-admin not accepting configuration file
I filed the bug. --~--~-~--~~~---~--~~ 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: Retrieve object back from form submission
Thank you all for your suggestions! I am afraid that it wouldn't fully answer my problem though... Should I encode this object in a hidden field, or a session dict on the server, then the object's parameter won't be updated by the user. .i.e. In my kid template I want: form action=save Modify Bar: input name=publish_object.bar value=${publish_object.bar} / /form And then in my save method, I want to be able to retrieve the value that the user submitted (without having to type all the form's input fields one by one in the method signature, but just the publish_object): turbogears.expose(mytemplate2) def save(self, publish_object): print value is: %d % publish_object.bar return dict() Thanks, Yannick --~--~-~--~~~---~--~~ 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: where set sqlite encoding?
Hello all, Many thanks for your kind help. Unfortunately, I haven't found a solution to my problem yet, but I think with your comments I now understand it a lot better... :-) Jorge and Italo wrote: [... kid.encoding in dev.cfg, encoding in kid templates ...] My kid template encoding was 'iso-8859-1'. I indeed didn't have kid.encoding set in the dev.cfg file. I have that now, but that unfortunately hasn't changed my results. I experimented with different setttings, too, but none of that seems to solve my problem. Italo Maia wrote: One more thing, prefer unicodecol to stringcol. I guess this really pinpoints my problem. I use: class sqlmeta: fromDatabase = True in my models. The database contains columns with iso-8859-1 text. (The database was generated with and is currently maintained by a non-TurboGears application.) What I think happens is that the kid system retrieves 8-bit strings with iso-8859-1 characters in it from the model, and then tries to convert it to unicode strings. Unfortunately, no-one told it which encoding to use, so it tries 'ascii', and then (rightly) throws an exception when it finds a non-Ascii character. I gather from your comments that it would be best to just change the table definition(s). The problem is that I also use other programs to access the same database, so I can't easily change my table structure. Changing the table structure would make it really easy for TurboGears, but I would have to put in all the work elsewhere, so that's cheating. :-) I plan to convert it all over to Python TurboGears eventually, but since this is only a weekend project, that will take some more time. So... I think with your help I now know a high-effort way to solve my problem. What I would really like to do is find a more TurboGears-like way :) in which I could somehow tell SQLObject (or whichever other component is responsible) that my database has 'iso-8859-1' column data, and have the system handle the conversions automatically. Any ideas? Am I overlooking something? Is there a better approach? Thanks again! Sincerely, Daniel P.S.: Here is a transcript of the exception that is throw. I can't really read a whole lot out of it, but maybe someone else could. - 500 Internal error The server encountered an unexpected condition which prevented it from fulfilling the request. Page handler: bound method Root.db2 of stammbaum.controllers.Root object at 0x01C21090 Traceback (most recent call last): File c:\dev\python\lib\site-packages\CherryPy-2.2.0-py2.4.egg\cherrypy\_cphttptools.py, line 106, in _run self.main() File c:\dev\python\lib\site-packages\CherryPy-2.2.0-py2.4.egg\cherrypy\_cphttptools.py, line 255, in main body = page_handler(*virtual_path, **self.params) File string, line 3, in db2 File c:\dev\python\lib\site-packages\TurboGears-0.9a4-py2.4.egg\turbogears\controllers.py, line 211, in expose output = database.run_with_transaction(expose._expose,func, accept, allow_json, allow_json_from_config,*args, **kw) File c:\dev\python\lib\site-packages\TurboGears-0.9a4-py2.4.egg\turbogears\database.py, line 216, in run_with_transaction retval = func(*args, **kw) File string, line 5, in _expose File c:\dev\python\lib\site-packages\TurboGears-0.9a4-py2.4.egg\turbogears\controllers.py, line 232, in lambda expose._expose.when(rule)(lambda _func, accept, allow_json, allow_json_from_config,*args,**kw: _execute_func( File c:\dev\python\lib\site-packages\TurboGears-0.9a4-py2.4.egg\turbogears\controllers.py, line 265, in _execute_func return _process_output(output, template, format, content_type, mapping, fragment) File c:\dev\python\lib\site-packages\TurboGears-0.9a4-py2.4.egg\turbogears\controllers.py, line 56, in _process_output mapping=mapping, content_type=content_type,fragment=fragment) File c:\dev\python\lib\site-packages\TurboGears-0.9a4-py2.4.egg\turbogears\view\base.py, line 131, in render return engine.render(**kw) File c:\dev\python\lib\site-packages\TurboKid-0.9.3-py2.4.egg\turbokid\kidsupport.py, line 154, in render return t.serialize(encoding=self.defaultencoding, output=format, fragment=fragment) File c:\dev\python\lib\site-packages\kid-0.9.1-py2.4.egg\kid\__init__.py, line 236, in serialize return serializer.serialize(self, encoding, fragment) File c:\dev\python\lib\site-packages\kid-0.9.1-py2.4.egg\kid\serialization.py, line 51, in serialize text = list(self.generate(stream, encoding, fragment)) File c:\dev\python\lib\site-packages\kid-0.9.1-py2.4.egg\kid\serialization.py, line 327, in generate for ev, item in self.apply_filters(stream): File c:\dev\python\lib\site-packages\kid-0.9.1-py2.4.egg\kid\serialization.py, line 84, in balancing_filter for ev, item in stream: File c:\dev\python\lib\site-packages\kid-0.9.1-py2.4.egg\kid\pull.py, line 206, in _coalesce for ev, item in stream: File
[TurboGears] Ajax sortable list widget
Hi all, I posted a sortable list widget on my blog. It still has a few warts, but it's functional enough to be worth taking a look: http://lumpus.info/nerkalog/archives/2006/04/turbogears-ajax-widgets or: http://tinyurl.com/g9qlk A few features: * you can throw a list of just about anything at it. * pass the class to its controller and it updates the sort order for you * restore the order to before you started messing with it * identity/permissions integration on the Ajax updates Comments, questions, suggestions wanted. My current host doesn't do Python so there's no live demo, just a screenshot and download. If anyone is interested, I'd like to see this develop into a package of Ajax widgets for TG, or if somebody has already started one, let's get together on that. --Isaac --~--~-~--~~~---~--~~ 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: Ajax sortable list widget
On Apr 11, 2006, at 11:15 PM, isaac wrote: Hi all, I posted a sortable list widget on my blog. It still has a few warts, but it's functional enough to be worth taking a look: http://lumpus.info/nerkalog/archives/2006/04/turbogears-ajax-widgets or: http://tinyurl.com/g9qlk Hi Isaac, I've taken a look at your widget's code and I have a few comments and questions: 1) Is the Mochikit you're using any different from the one TG bundles? If not, you could skip all those mochi JSLinks and: from turbogears.widgets import mochikit javascript = [mochikit, ...] (Probably you already know this, but just in case... ;) 2) All variables you list at template_vars you don't need to bind to self at __init__, as long as you call super cooperatively if overriding __init__ then Widget will do it for you. This might let you skip __init__ completely. And, besides that, anyone looking at the code knows from a quick glance that those variables can be overriden when i) subclassing ii) initializing, iii) displaying 3) You might want to try quickstarting a widgets project (tg-admin quickstart -twidgets sortable) so you can tweak setup.py and have a nice widget package that, once installed, can show a demo on the widget browser (I can lend a hand on this if you want). This is the preferred way of distribuitng them (and posting them at the cheesshop so they appear at the Cogbin). You can take a look at the widget packages at http://www.turbogears.org/svn/turbogears/widgets for some examples. I can't comment any further as I haven't tried it yet (your controllers doesn't include any demo). Now is time to sleep here, tomorrow I'll proably give it a closer look with more time... Nice work! and thanks for sharing it :) Alberto --~--~-~--~~~---~--~~ 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] Gcc failed with TurboGears 0.9a4 + Ubuntu Dapper Draker
Anybody find one error installing TG in Ubuntu Dapper Draker? --~--~-~--~~~---~--~~ 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: Gcc failed with TurboGears 0.9a4 + Ubuntu Dapper Draker
2006/4/11, Claudio Torcato [EMAIL PROTECTED]: Anybody find one error installing TG in Ubuntu Dapper Draker? Yes, I got an error here: Processing cElementTree-1.0.5-20051216.tar.gz Running cElementTree-1.0.5-20051216/setup.py -q bdist_egg --dist-dir /tmp/easy_install-lrCPUw/cElementTree-1.0.5-20051216/egg-dist-tmp-lywlxw error: /usr/include/python2.4/pyconfig.h: No such file or directory If it's the same error, just apt-get install python2.4-dev. -- Dirceu Pereira Tiegs http://dirceu.info/ --~--~-~--~~~---~--~~ 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: Gcc failed with TurboGears 0.9a4 + Ubuntu Dapper Draker
Actually, I also got this error last weekend using Dapper (Flight 6). The error was related to gcc and the specific module RuleDispatch, if I remember correctly. Installing python2.4-dev didn't make the error go away. --~--~-~--~~~---~--~~ 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] Explain the implications of implicit transactions
Hi, A suggestion for the documentation of 0.9. It would be great to have a section that goes over some of the practical issues and gotchas arising from database transactions and how they are managed by default in TG 0.9 For example, I had a pattern where I try to pass objects from one web app page (exposed method) to the next page (i.e. to the page that I redirect to) by having the objects be the value of a session key. However, I'm getting this transaction has already gone through ROLLBACK errors when I try to access the attributes of the object in the 2nd page's code. I imagine this to be because the transaction in which the object was created has been committed (or something) and the same object is no longer valid inside the next transaction? I'm not sure what causes this problem but I've come to the conclusion that I ought to pass object identifiers around for page to page rather than object themselves, then re-get the object from the database within the next page's code. Is this a correct observation, a necessary pattern? Any best-practices patterns or advice to go along with the implicit transactions design would be very handy. --~--~-~--~~~---~--~~ 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: where set sqlite encoding?
I don't know how the database enconding could damage your other products.if you may, could you tell which they are? they may not depend on iso-8859-, just happen to be created that way then you may *fix* that problem. also there is no db schema to be change all your code should stay the same, it will only affect the data stored so in theory the change should not be a problem, you could replicate your environment to test if your other code is affected by it. Even if it's more work it's better to correct the error then to work around it :)On 4/11/06, Daniel Vogelheim [EMAIL PROTECTED] wrote:Hello all,Many thanks for your kind help. Unfortunately, I haven't found a solution to my problem yet, but I think with your comments I nowunderstand it a lot better... :-)Jorge and Italo wrote: [... kid.encoding in dev.cfg, encoding in kid templates ...]My kid template encoding was 'iso-8859-1'. I indeed didn't have kid.encoding set in the dev.cfg file. I have that now, but thatunfortunately hasn't changed my results. I experimented with differentsetttings, too, but none of that seems to solve my problem.Italo Maia wrote: One more thing, prefer unicodecol to stringcol.I guess this really pinpoints my problem. I use:class sqlmeta:fromDatabase = Truein my models. The database contains columns with iso-8859-1 text. (The database was generated with and is currently maintained by anon-TurboGears application.) What I think happens is that the kidsystem retrieves 8-bit strings with iso-8859-1 characters in it fromthe model, and then tries to convert it to unicode strings. Unfortunately, no-one told it which encoding to use, so it tries'ascii', and then (rightly) throws an exception when it finds anon-Ascii character.I gather from your comments that it would be best to just change the table definition(s). The problem is that I also use other programs toaccess the same database, so I can't easily change my table structure.Changing the table structure would make it really easy for TurboGears, but I would have to put in all the work elsewhere, so that's cheating.:-)I plan to convert it all over to Python TurboGears eventually,but since this is only a weekend project, that will take some more time.So... I think with your help I now know a high-effort way to solve myproblem. What I would really like to do is find a more TurboGears-likeway :) in which I could somehow tell SQLObject (or whichever other component is responsible) that my database has 'iso-8859-1' columndata, and have the system handle the conversions automatically.Any ideas? Am I overlooking something? Is there a better approach?Thanks again! Sincerely,DanielP.S.: Here is a transcript of the exception that is throw. I can'treally read a whole lot out of it, but maybe someone else could.-500 Internal error The server encountered an unexpected condition which prevented it fromfulfilling the request.Page handler: bound method Root.db2 of stammbaum.controllers.Rootobject at 0x01C21090 Traceback (most recent call last):Filec:\dev\python\lib\site-packages\CherryPy-2.2.0-py2.4.egg\cherrypy\_cphttptools.py,line 106, in _runself.main()Filec:\dev\python\lib\site-packages\CherryPy- 2.2.0-py2.4.egg\cherrypy\_cphttptools.py,line 255, in mainbody = page_handler(*virtual_path, **self.params)File string, line 3, in db2Filec:\dev\python\lib\site-packages\TurboGears- 0.9a4-py2.4.egg\turbogears\controllers.py,line 211, in exposeoutput = database.run_with_transaction(expose._expose,func,accept, allow_json, allow_json_from_config,*args, **kw)Filec:\dev\python\lib\site-packages\TurboGears- 0.9a4-py2.4.egg\turbogears\database.py,line 216, in run_with_transactionretval = func(*args, **kw)File string, line 5, in _exposeFilec:\dev\python\lib\site-packages\TurboGears- 0.9a4-py2.4.egg\turbogears\controllers.py,line 232, in lambdaexpose._expose.when(rule)(lambda _func, accept, allow_json,allow_json_from_config,*args,**kw: _execute_func(Filec:\dev\python\lib\site-packages\TurboGears- 0.9a4-py2.4.egg\turbogears\controllers.py,line 265, in _execute_funcreturn _process_output(output, template, format, content_type,mapping, fragment)Filec:\dev\python\lib\site-packages\TurboGears- 0.9a4-py2.4.egg\turbogears\controllers.py,line 56, in _process_outputmapping=mapping, content_type=content_type,fragment=fragment)Filec:\dev\python\lib\site-packages\TurboGears-0.9a4-py2.4.egg\turbogears\view\base.py ,line 131, in renderreturn engine.render(**kw)Filec:\dev\python\lib\site-packages\TurboKid-0.9.3-py2.4.egg\turbokid\kidsupport.py,line 154, in renderreturn t.serialize(encoding= self.defaultencoding, output=format,fragment=fragment)Filec:\dev\python\lib\site-packages\kid-0.9.1-py2.4.egg\kid\__init__.py,line 236, in serializereturn serializer.serialize(self, encoding, fragment) Filec:\dev\python\lib\site-packages\kid-0.9.1-py2.4.egg\kid\serialization.py,line 51, in serializetext = list(self.generate(stream, encoding, fragment))Filec:\dev\python\lib\site-packages\kid-
[TurboGears] Re: Why Cheetah is being install with tg0.9+?
lateef Cheetah is not the templating package choose for TG, it was added as a plugin for people that need/want it. right now as Kevin pointed it seems to be a depencency of PasteScriptI have never use it but the TurboCheetah package is for 1.0. I believe that after all the excitement of using Cheetah noone really used it that much (at least from the develpers) to update the package.Maybe Kevin will update to Cheetah 2 went the final version is released. On 4/11/06, lateef jackson [EMAIL PROTECTED] wrote: Cheetah 2.0 rc6 is out. Any reason not to include Cheetah 2? On 4/11/06, Kevin Dangoor [EMAIL PROTECTED] wrote: On 4/11/06, Jorge Vargas [EMAIL PROTECTED] wrote: It's my undestanding Cheetah is an optional package after the subway comunity join us, but my tg-admin info show Cheetah 1.0 but the requires.txt file for 0.9a4 doesn't shows Cheetah, is it being install as a dependancy of anothey package?Yeah, it's being brought in by PasteScript. I've exchanged a couple ofemails with Ian about this. PasteScript doesn't *really* need Cheetah. But, I can imagine that our quickstart templates might get to thepoint where they have optional bits that really benefit from beingable to do if/then rather than just variable substitution.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: Tg-admin not accepting configuration file
On 4/11/06, kavikaBldr [EMAIL PROTECTED] wrote: As far as I can tell tg-admin does not accept a parameter for whichconfiguration file to use. How am I supposed to create databases fordev, testing, staging, and production?how about the .cfg files? isn't that the point of them? Thanks --~--~-~--~~~---~--~~ 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: Explain the implications of implicit transactions
On 4/11/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:Hi,A suggestion for the documentation of 0.9.It would be great to have a section that goes over some of the practical issues and gotchas arising from database transactions and howthey are managed by defaultin TG 0.9Each method call is a transaction unless you say otherwise For example, I had a pattern where I try to pass objects from one webapp page (exposed method) to the next page (i.e. to the page that Iredirect to) by having the objects be the value of a session key. I'm sorry but that sounds so php, python/tg is not php don't try to use it like that. if you must I believe what you need is a class variable. but it seems more like a need to reestructure the code so each method is one web call (or calls methods that are not exposed to factor the work. However, I'm getting this transaction has already gone throughROLLBACK errors when I try to access the attributes of the object in the 2nd page's code. I imagine this to be because the transaction in which the object wascreated has been committed (or something) and the same object is nolonger valid inside the next transaction? since the backend is change the lock is lost so SQLObject can not be sure that is the most recent copy. I'm not sure what causes thisproblem but I've come to the conclusion thatI ought to pass object identifiers around for page to page rather thanobject themselves, that doesn't makes sence. then re-get the object from the database within thenext page's code. Is this a correct observation, a necessary pattern? Any best-practices patterns or adviceto go along with the implicittransactions design would be very handy. --~--~-~--~~~---~--~~ 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: Explain the implications of implicit transactions
On 12/04/2006, at 2:55, [EMAIL PROTECTED] wrote: However, I'm getting this transaction has already gone through ROLLBACK errors when I try to access the attributes of the object in the 2nd page's code. I imagine this to be because the transaction in which the object was created has been committed (or something) and the same object is no longer valid inside the next transaction? I'm not sure what causes this problem but I've come to the conclusion that I ought to pass object identifiers around for page to page rather than object themselves, then re-get the object from the database within the next page's code. Is this a correct observation, a necessary pattern? Yep, this a correct observation. All requests are implicitly wrapped in a transaction to guarantee that all changes made in your DB during that request will be atomic. This isn't absolutely necessary, but good practice. The reason for this is that the records those objects represent might be modified in a race-condition fashion (by a concurrent request) leading to inconsitent data messing your DB and hard to track bugs. It was decided long ago to make this default behavior. If you need to store SQLObject in session storage, you can wrap them in a proxy of some sort that does this automatically for you. ASPN has plenty of recipes for proxies which you can use for inspiration. Alberto --~--~-~--~~~---~--~~ 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: Explain the implications of implicit transactions
Hi, Thanks for the suggestion. On 4/11/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I ought to pass object identifiers around for page to page rather than object themselves, then re-get the object from the database within the next page's code. Is this a correct observation, a necessary pattern? I actually think that this is more an observation about use of sessions than the implicit transactions. Generally speaking, implicit transactions do what you really want to happen anyhow. There are no guarantees about putting an SQLObject (or other kind of persistent object) into a session. Most persistent objects have some kind of association with the connection they were created from. From request to request, you can't count on that being the same connection. Hanging on to the object id is a good solution, imho. 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: TG and multiple apps
Hi Rob, On 4/11/06, Robin Haswell [EMAIL PROTECTED] wrote: I was wondering what the situation with multiple applications is? Aspects of multiple application support (particularly configuration) are not where I'd like them to be. Beyond configuration, I also want to see a mechanism for template overrides. This is the primary subject of the next major release of TurboGears (codename First Class, if you see us mentioning that). In the meantime, I have these suggestions: 1) use CherryPy 2.2's tree.mount() feature. (I don't have a doc link handy, but it's one of the main new features in CP 2.2). This will ensure that your configuration is sane between apps. Using tree.mount() is something you'd do externally to your main tree (ie you don't just instantiate your subapp and attach it to your Root). You can do this in your start script. First Class should allow you to just instantiate and attach to your Root in normal CherryPy style. 2) Put each app in its own quickstarted project, rather than just a separate package in one project. Each app will get its own egg, and one app can easily depend on another (even a specific version of another). Again, configuration will become saner in First Class. Note that the tg-admin sql command takes an -egg parameter so that you can specify that you want to create the database that goes along with a specific app. If you don't put each app in a quickstarted project, its Root should at least extend controllers.Root, so that URL generation works correctly. HTH, 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: Explain the implications of implicit transactions
On Apr 11, 2006, at 6:50 PM, Kevin Dangoor wrote: On 4/11/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I ought to pass object identifiers around for page to page rather than object themselves, then re-get the object from the database within the next page's code. Is this a correct observation, a necessary pattern? I actually think that this is more an observation about use of sessions than the implicit transactions. Generally speaking, implicit transactions do what you really want to happen anyhow. There are no guarantees about putting an SQLObject (or other kind of persistent object) into a session. Most persistent objects have some kind of association with the connection they were created from. From request to request, you can't count on that being the same connection. Hanging on to the object id is a good solution, imho. I don't know the specifics of how sessions work in TG, but there's no technical reason you couldn't put SQLObjects in a session correctly if sessions were treated kinda like a pickle store. The session- serialization for a SQLObject would simply be a reference to the class and the object's id. When you pull it out of the session from some other request, it would simply resurrect that object using the current connection. Personally I prefer the explicit by-identifier way and try and keep the state on the client instead of in a session (for a lot of reasons) but there's nothing inherently dangerous about the pattern that the user tried first (if the pieces fit together properly). -bob --~--~-~--~~~---~--~~ 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: Want to help with 0.9 development? I can help you!
Hi Kevin, On 4/6/06, Kevin Dangoor [EMAIL PROTECTED] wrote: [snip] No problem. Feel free to ask as questions come up. Kevin I sent you a private message with a little patch... did you receive it ? I hope it didn't fall in a junk mail control... :) []s Roger --~--~-~--~~~---~--~~ 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] 'mysql server has gone away'
I'm getting the following after a couple of hours inactivity: File /usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1631-py2.4.egg/sqlobject/main.py, line 1329, in selectBy conn = connection or cls._connection File /usr/lib/python2.4/site-packages/TurboGears-0.9a4-py2.4.egg/turbogears/database.py, line 150, in __get__ return self.hub.__get__(obj, type) File /usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1631-py2.4.egg/sqlobject/dbconnection.py, line 935, in __get__ return self.getConnection() File /usr/lib/python2.4/site-packages/TurboGears-0.9a4-py2.4.egg/turbogears/database.py, line 56, in getConnection return self.begin(conn) File /usr/lib/python2.4/site-packages/TurboGears-0.9a4-py2.4.egg/turbogears/database.py, line 87, in begin trans = conn.transaction() File /usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1631-py2.4.egg/sqlobject/dbconnection.py, line 365, in transaction return Transaction(self) File /usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1631-py2.4.egg/sqlobject/dbconnection.py, line 790, in __init__ self._dbConnection._setAutoCommit(self._connection, 0) File /usr/lib/python2.4/site-packages/SQLObject-0.8dev_r1631-py2.4.egg/sqlobject/mysql/mysqlconnection.py, line 61, in _setAutoCommit conn.autocommit(auto) OperationalError: (2006, 'MySQL server has gone away') This also happens when I 'killall -9 mysqld' (ie kill the current open threads) From looking at the turbogears PackageManager in database.py, it seems it is meant to reconnect, but it doesn't for me. I've been unable to figure it out - am I doing something wrong or is this a bug? -- Dan Ros --~--~-~--~~~---~--~~ 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: Ajax sortable list widget
Hi again, On Apr 11, 2006, at 5:30 PM, Alberto Valverde wrote: 1) Is the Mochikit you're using any different from the one TG bundles? If not, you could skip all those mochi JSLinks and: [snip] It's the scriptaculous port branch from MochiKit's svn, and it uses Sortable.js which for some reason doesn't make it into the packed version yet. So for now it needs all those individual files AFAICT. Hopefully that won't be the case for much longer. 2) All variables you list at template_vars you don't need to bind to self at __init__, as long as you call super cooperatively if overriding __init__ then Widget will do it for you. This might let you skip __init__ completely. And, besides that, anyone looking at the code knows from a quick glance that those variables can be overriden when i) subclassing ii) initializing, iii) displaying 3) You might want to try quickstarting a widgets project (tg-admin quickstart -twidgets sortable) so you can tweak setup.py and have a nice widget package that, once installed, can show a demo on the widget browser (I can lend a hand on this if you want). This is the preferred way of distribuitng them (and posting them at the cheesshop so they appear at the Cogbin). You can take a look at the widget packages at http://www.turbogears.org/svn/turbogears/widgets for some examples. Yeah I think with 2 3 it's just that I haven't studied the TG code docs enough. (I haven't been following the list svn as much I'd like lately.) I didn't know there was a special widgets option for quickstart. That's way cool. ;) I can't comment any further as I haven't tried it yet (your controllers doesn't include any demo). Now is time to sleep here, tomorrow I'll proably give it a closer look with more time... Nice work! and thanks for sharing it :) Alberto Looking forward to further commentary! I'll work on repacking it into a widgets project over the next few days. Later, --i --~--~-~--~~~---~--~~ 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] maximum recursion depth exceeded @_O
Well, I started a new project and extended the identity classes, TG_User , TG_Group, and TG_Permission. After doing that, i changed the app.cfg to use my new classes. Big was surprise seeing this error. When i set the identity provider to default, the error vanquishes. Here are my extended classes: class Usr(TG_User): matricula=UnicodeCol(length=20,notNone=True,alternateID=True) #emailAdress #userId #password #groups #permissions #displayName class Grp(TG_Group): criado=DateCol(default=datetime.now()) class Prm(TG_Permission): criado=DateCol(default=datetime.now()) --~--~-~--~~~---~--~~ 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] Small Steps
SQLite on Windows 2000 using Turbogears 9a4. O.K. Lets use the Brian Becks Multiuser Todo List as a reference. http://www.turbogears.org/preview/docs/tutorials/todolist/ After installing Turbogears I installed pysqlite on win2k and tested it directly in python. from sqlobject import * import sys, os connection_string = sqlite:/:memory: connection = connectionForURI(connection_string) sqlhub.processConnection = connection class Person(SQLObject): firstName = StringCol() middleInitial = StringCol(length=1, default=None) lastName = StringCol() Person.createTable() Person(firstName=John, lastName=Doe) print Person.get(1) Output: Person 1 firstName='John' middleInitial=None lastName='Doe' So far so good! Now enter the following in all my config files: sqlobject.dburi=sqlite:///c|/ajax/ajax.db Now edit model.py: from sqlobject import * from turbogears.database import PackageHub hub = PackageHub(ajax) __connection__ = hub class Genre(SQLObject): name = StringCol(length=200) artists = RelatedJoin('Artist') class Artist(SQLObject): name = StringCol(length=200) genres = RelatedJoin('Genre') albums = MultipleJoin('Album') class Song(SQLObject): name = StringCol(length=200) album = ForeignKey('Album') class Album(SQLObject): name = StringCol(length=200) artist = ForeignKey('Artist') songs = MultipleJoin('Song') The result: C:\ajaxtg-admin sql create Using database URI sqlite:///c|/ajax/ajax.db Exception exceptions.AttributeError: 'pysqlite2.dbapi2.Connection' object has n o attribute 'autocommit' in bound method Transaction.__del__ of sqlobject.dbc onnection.Transaction object at 0x01261CF0 ignored The database is created and is empty. Any Suggestions? I may get this some day! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---