[TurboGears] Re: How to use widgets.FieldSet?

2006-01-26 Thread David Bernard
I do a mistake, I thought the 'widgets' attribute need by Kid is for the main page, but not it seems to be need by the FieldSet kid template (as you wrote), sorry. Try to force the setting of the 'widgets' attribute of FieldSet, replace widgets.FieldSet([ by widgets.FieldSet(widgets=[ Jorge

[TurboGears] Re: How to use widgets.FieldSet?

2006-01-26 Thread Michele Cella
Dan Jacob wrote: If you add to your dict_new widget=None it will work: data_new = dict( widget = None, contrato_assinatura = '', contrato_vencimento = '', cliente_id = None, nome_abreviado = None, nome_completo =

[TurboGears] Re: widgets undergoing some breaking changes

2006-01-26 Thread Michele Cella
Michele Cella wrote: I've attached my work (based on Ian Bicking conservative metaclass [1] and a snippets of code from formencode) to this ticket: http://trac.turbogears.org/turbogears/ticket/454 All comments are *very* welcome. From r581 you can use again declarative forms, that's an

[TurboGears] Re: Problems with SVN version of TurboGears

2006-01-26 Thread Max Ischenko
Well, I seem to get into the same problem now: 'Request' object has no attribute 'app_path' I've been following SVN for a some time and it work just fine. I suspect the problem is with CherryPy - today I decided to update installed version, went to thirdparty/cherryp and performed easy_install

[TurboGears] Re: Problems with SVN version of TurboGears

2006-01-26 Thread Max Ischenko
I think the following may explain this: thirdparty\cherrypysvn diff -r 931 Index: cherrypy/_cphttptools.py === --- cherrypy/_cphttptools.py(revision 931) +++ cherrypy/_cphttptools.py(working copy) @@ -269,15 +269,6 @@

[TurboGears] Re: Startdate of CalendarDatePicker widget

2006-01-26 Thread Uwe Grauer
Ticket # is 420. Uwe Ronald Jaramillo wrote: Can you open a ticket about this? Cheers. Ronald On Jan 26, 2006, at 12:54 AM, Uwe Grauer wrote: [EMAIL PROTECTED] wrote: I'm sorry but that seems correct it's a time value and all time is measured in seconds since 1/1/1970. How would i

[TurboGears] Re: howto configure server start page

2006-01-26 Thread Lee McFadden
Another option could be to simply open the file and stream it directly without redirecting anywhere. I'm not sure how fast/slow this method would be though. @turbogears.expose() def index(self): import os return cherrypy.lib.cptools.fileGenerator(open(os.path.join(static,index.html),

[TurboGears] Re: Startdate of CalendarDatePicker widget

2006-01-26 Thread Ronald Jaramillo
Thanks. -ronald On Jan 26, 2006, at 12:20 PM, Uwe Grauer wrote: Ticket # is 420. Uwe Ronald Jaramillo wrote: Can you open a ticket about this? Cheers. Ronald On Jan 26, 2006, at 12:54 AM, Uwe Grauer wrote: [EMAIL PROTECTED] wrote: I'm sorry but that seems correct it's a time value

[TurboGears] Re: How to disable html code reformatting by Kid?

2006-01-26 Thread Rune Hansen
On 26. jan. 2006, at 01.36, northam wrote:What I have in template.kid (notice one long string without spacesbetween html tags): div style="padding-left:2px;padding-top:7px;"a href=""target="com" title="my Weblook"imgsrc="" width="92"height="18" alt="my Weblook" style="margin-left:2px"//aahref=""

[TurboGears] Re: How to use widgets.FieldSet?

2006-01-26 Thread Jorge Godoy
Dan Jacob [EMAIL PROTECTED] writes: BTW this is actually a separate issue. If the dict data_new misses any of the fields you get the same KeyError; it should be the case that any missing values are set to None or default. This is why there's the 'data_new' dictionary to populate the second

[TurboGears] Re: How to use widgets.FieldSet?

2006-01-26 Thread Jorge Godoy
David Bernard [EMAIL PROTECTED] writes: I do a mistake, I thought the 'widgets' attribute need by Kid is for the main page, but not it seems to be need by the FieldSet kid template (as you wrote), sorry. Try to force the setting of the 'widgets' attribute of FieldSet, replace

[TurboGears] Re: How to use widgets.FieldSet?

2006-01-26 Thread Jorge Godoy
David Bernard [EMAIL PROTECTED] writes: I do a mistake, I thought the 'widgets' attribute need by Kid is for the main page, but not it seems to be need by the FieldSet kid template (as you wrote), sorry. Try to force the setting of the 'widgets' attribute of FieldSet, replace

[TurboGears] Re: How to use widgets.FieldSet?

2006-01-26 Thread David Bernard
Maybe you could try this ugly hack (non-tested) : define and use FieldGroup instead of FieldSet in your form. class FieldGroup(turbogears.widgets.FieldSet): template = div xmlns:py=http://purl.org/kid/ns#; py:strip=True span py:for=widget in widgets py:strip=True span

[TurboGears] Re: How to use widgets.FieldSet?

2006-01-26 Thread Jorge Godoy
David Bernard [EMAIL PROTECTED] writes: Maybe you could try this ugly hack (non-tested) : define and use FieldGroup instead of FieldSet in your form. class FieldGroup(turbogears.widgets.FieldSet): template = div xmlns:py=http://purl.org/kid/ns#; py:strip=True span

[TurboGears] Re: How to disable html code reformatting by Kid?

2006-01-26 Thread David Stanek
On 1/25/06, northam [EMAIL PROTECTED] wrote: What I have in template.kid (notice one long string without spacesbetween html tags):div style=padding-left:2px;padding-top:7px;a href="">target=com title=my Weblookimg src="" width=92height=18 alt=my Weblook style=margin-left:2px//aahref="" target=com

[TurboGears] Grid, DataGrid, documentation?

2006-01-26 Thread mte
Hi, What's the difference between Grid and DataGrid? From widget browser in toolbox I can't see any. What about some documentation on those widgets? On trac there are only simple widgets described - maybe it would be nice to have some quick usage instructions in the widget browser? thanks, matej

[TurboGears] Re: Problems with SVN version of TurboGears

2006-01-26 Thread Max Ischenko
There seem to be a related ticket but I cannot verify it works for me.

[TurboGears] Re: Grid, DataGrid, documentation?

2006-01-26 Thread Elvelind Grandin
I belive the Grid will be removed in favor for the DataGrid. On 1/26/06, mte [EMAIL PROTECTED] wrote: Hi, What's the difference between Grid and DataGrid? From widget browser in toolbox I can't see any. What about some documentation on those widgets? On trac there are only simple widgets

[TurboGears] Re: New to TG (take III)

2006-01-26 Thread Luc Charland
Something strange. I tried last night to replace de uri with a memory database, thinking this might be a path/access_rights problem. So I used -- 'sqlobject.dburi':sqlite:/:memory: -- in tests/test_i18n.py. I get the exact same error. And I uninstalled anything that had to do with old version of

[TurboGears] Re: How to disable html code reformatting by Kid?

2006-01-26 Thread [EMAIL PROTECTED]
David Stanek wrote: Is there any parameter which allow to disable this reformatting? Yes in Kid, but not in TurboKid. I can't remember offhand the name, but there is a property on the Kid serializer that you can set to turn off this formatting. This may be something to set automatically

[TurboGears] ANN: wsgi_filter

2006-01-26 Thread christian
*I posted this in the cherrypy-users ML but I thought some of you here might want to kick it around as well* - wsgi_filter lets you mount and run WSGI apps within your CherryPy applications. I have a neat example with a CP app hosting a web.py app. I'm

[TurboGears] Efficiency

2006-01-26 Thread [EMAIL PROTECTED]
I've been playing with TG for about a month now and I love it. I have very little programming experience (2 semester's worth of java in uni) and no web development or python experience. I'm using TG to follow up on an Idea(s), and learn a lot about python/webdev along the way. I'm amazed at

[TurboGears] AutoComplete and CalendarDatePicker patches

2006-01-26 Thread Lee McFadden
I have two patches submitted to trac, and I thought I'd announce them here to try and get them committed. :) AutoCompleteField doesn't add it's value when it is within a form widget: http://trac.turbogears.org/turbogears/ticket/470 CalendarDatePicker doesn't allow empty values:

[TurboGears] Re: How to disable html code reformatting by Kid?

2006-01-26 Thread Elvelind Grandin
On 1/26/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: David Stanek wrote: Is there any parameter which allow to disable this reformatting? Yes in Kid, but not in TurboKid. I can't remember offhand the name, but there is a property on the Kid serializer that you can set to turn off

[TurboGears] Re: New to TG (take III)

2006-01-26 Thread Luc Charland
Ok, some more tests. I get the exact same problem if I change the URI to use postgresql. So it isn't sqlite related as I first thought. 'sqlobject.dburi':postgres://[EMAIL PROTECTED]/tgtest fails too, in the exact same way. Just hope this isn't a thread related problem. I will continue to work

[TurboGears] Re: AutoComplete and CalendarDatePicker patches

2006-01-26 Thread Jorge Godoy
Lee McFadden [EMAIL PROTECTED] writes: CalendarDatePicker doesn't allow empty values: http://trac.turbogears.org/turbogears/ticket/370 I've added some comments to this one. Specially one change that I'd like to see reverted from your patch. -- Jorge Godoy [EMAIL PROTECTED]

[TurboGears] Re: 100,000 eggs

2006-01-26 Thread Florent AIDE
On 1/25/06, rick [EMAIL PROTECTED] wrote: Congratulations Kevin and everyone involved. Congrats ! be until it becomes stable. But not so with TG, I'm guessing it's a combination of presentation and an emphasis on push-button installation and usability. The quickstart feature alone makes it

[TurboGears] Re: How to disable html code reformatting by Kid?

2006-01-26 Thread Elvelind Grandin
actually. it looks like if the whole file is one line, it stays so. but if there are newlines anywhere it starts formatting it. On 1/26/06, Elvelind Grandin [EMAIL PROTECTED] wrote: On 1/26/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: David Stanek wrote: Is there any parameter which

[TurboGears] Re: How to disable html code reformatting by Kid?

2006-01-26 Thread Richard (koorb)
David Stanek wrote: there is a property on the Kid serializer that you can set to turn off this formatting. This may be something to set automatically anyway. It seem like good default behavior to not have Kid reformat the document structure. I completely agree with this, KID/TurboGears

[TurboGears] Re: AutoComplete and CalendarDatePicker patches

2006-01-26 Thread Lee McFadden
On 1/26/06, Jorge Godoy [EMAIL PROTECTED] wrote: I've added some comments to this one. Specially one change that I'd like to see reverted from your patch. I've copied this from my comment on the ticket. I don't see how it would break any implimentation for the different CSS classes on the

[TurboGears] Bad Kid

2006-01-26 Thread [EMAIL PROTECTED]
I'm trying to display an image map, but Kid complains about it not being well formed. Here is the HTML: map name=map1 area shape=poly coords=55,140,64,135,64,145,55,150 title='Enterprise @ Jan-00 = USD 50 millions' href=xystub.py?x=0xLabel=Jan-00dataSet=0dataSetName=Enterprisevalue=50 area

[TurboGears] Re: AutoComplete and CalendarDatePicker patches

2006-01-26 Thread Jorge Godoy
Lee McFadden [EMAIL PROTECTED] writes: On 1/26/06, Jorge Godoy [EMAIL PROTECTED] wrote: I've added some comments to this one. Specially one change that I'd like to see reverted from your patch. I've copied this from my comment on the ticket. I don't see how it would break any

[TurboGears] Re: TurboGears Role Based Security

2006-01-26 Thread erisian
Jeff, Does the API provide for two basic types of role-based protection? For example: 1) Declarative: some class: some method: / requires role(admin) 2) Procedural: if isInRole('jeff',admin) then do something else do something else endif and possibly: 3)

[TurboGears] Re: Bad Kid

2006-01-26 Thread Ksenia Marasanova
2006/1/26, [EMAIL PROTECTED] [EMAIL PROTECTED]: I'm trying to display an image map, but Kid complains about it not being well formed. area is not a valid XML. area/ is. I don't have control over the HTML provided in the image map. How can I tell Kid to just let it pass? That's too bad.

[TurboGears] Re: Bad Kid

2006-01-26 Thread Marcelo Alves
Replace with amp; On 1/26/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I'm trying to display an image map, but Kid complains about it not being well formed. Here is the HTML: -- :: marcelo.alves

[TurboGears] Re: How to disable html code reformatting by Kid?

2006-01-26 Thread northam
Okey, in kid/serialization.py I changed balanced_blocks = 1 to balanced_blocks = 0 And Kid stopped the reformatting and damaging html code. Definitely this option has to be turned off by default and probably be congifurable easily in config file.

[TurboGears] Re: Bad Kid

2006-01-26 Thread [EMAIL PROTECTED]
There is something else going on here. I figured I could replace the '' with '/', which I did, but I still get the ExpatError. area shape=poly coords=55,140,64,135,64,145,55,150 title='Enterprise @ Jan-00 = USD 50 millions' href=xystub.py?x=0xLabel=Jan-00dataSet=0dataSetName=Enterprisevalue=50/

[TurboGears] Re: How to disable html code reformatting by Kid?

2006-01-26 Thread [EMAIL PROTECTED]
Elvelind Grandin wrote: actually. it looks like if the whole file is one line, it stays so. but if there are newlines anywhere it starts formatting it. that's an interesting observation. here's the output from a simple load-and-serialize script (using the XML serializer in Kid 0.7.1). for

[TurboGears] Re: Bad Kid

2006-01-26 Thread Leandro Lucarella
[EMAIL PROTECTED], el jueves 26 de enero a las 18:23 me escribiste: There is something else going on here. I figured I could replace the '' with '/', which I did, but I still get the ExpatError. area shape=poly coords=55,140,64,135,64,145,55,150 title='Enterprise @ Jan-00 = USD 50

[TurboGears] Re: How to disable html code reformatting by Kid?

2006-01-26 Thread David Stanek
On 1/26/06, northam [EMAIL PROTECTED] wrote: Okey, in kid/serialization.pyI changedbalanced_blocks = 1tobalanced_blocks = 0And Kid stopped the reformatting and damaging html code. Definitelythis option has to be turned off by default and probably be congifurable easily in config file. Thats the

[TurboGears] Re: Bad Kid

2006-01-26 Thread [EMAIL PROTECTED]
Yep, that was it. Makes my code ugly, but it works now. Thanks! -Don

[TurboGears] Re: Widget Attributes

2006-01-26 Thread Randall
I see that in Widget.__init__, passing in attrs will create an instance attribute.I don't see javascript or css here.

[TurboGears] Re: Bad Kid

2006-01-26 Thread Leandro Lucarella
[EMAIL PROTECTED], el jueves 26 de enero a las 18:58 me escribiste: Yep, that was it. Makes my code ugly, but it works now. BTW, this is a XML problem, not a Kid one. -- Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/

[TurboGears] Re: Efficiency

2006-01-26 Thread David Guaraglia
Hi nospice (sorry, but I couldn't quite guess your name, only that you are not one of the Spice Girls :) If you want to know about TG performace, you should look for data on the performace of it's components, most importantly Kid and CherryPy. In fact even the Kid thing is not such a

[TurboGears] Re: .pydistutils.cfg docutils wiki20 home directory failure

2006-01-26 Thread Daniel Holth
I've found the problem. The documentation at http://www.python.org/doc/2.4.2/dist/dist.html suggests the existence of two additional directives: install_data and install_headers. The cascading style sheets, templates, and some other things in docutils are listed as data files in setup.py, and so

[TurboGears] Kid screws up special html (i.e. copy;)

2006-01-26 Thread northam
My code in template.kid: div class=cpycopy; 2006... Is shown in browser like: © 2006... when I looked in generated html source I saw: div class=cpy© 2006... I suspect premature transformation of special html like nbsp;, copy; and so on which MUST NOT be touched by Kid at all. Is there any

[TurboGears] Re: Bad Kid

2006-01-26 Thread [EMAIL PROTECTED]
Leandro Lucarella wrote: [EMAIL PROTECTED], el jueves 26 de enero a las 18:58 me escribiste: Yep, that was it. Makes my code ugly, but it works now. BTW, this is a XML problem, not a Kid one. it's HTML 101, in fact: http://www.htmlhelp.com/tools/validator/problems.html#amp

[TurboGears] Re: howto configure server start page

2006-01-26 Thread Martina Oefelein
Hi Alex, raise cherrypy.HTTPRedirect(turbogears.url('/static/index.html')) works fine, but InternalRedirect makes problems. strange. Which TG/cherrypy version are you using? ciao Martina

[TurboGears] Re: .pydistutils.cfg docutils wiki20 home directory failure

2006-01-26 Thread Ian Bicking
Daniel Holth wrote: Hi, I don't like using root to install things, largely because I can edit that source code more easily when it is in my home directory. Anyway, I've edited my ~/.pydistutils.cfg file to reflect this per turbogears advice: The ideal way of doing this is to check out the

[TurboGears] Re: Kid screws up special html (i.e. copy;)

2006-01-26 Thread northam
[EMAIL PROTECTED] wrote: why? for the browser, character references are no different from character codes. I think browser might not be involved into this problem. It's a Kid who outputs junk. BTW, output format is xhtml.

[TurboGears] Re: .pydistutils.cfg docutils wiki20 home directory failure

2006-01-26 Thread Daniel Holth
Thanks, I've enjoyed develop, plus: cd ~/src/turbogears/thirdparty for i in * ; do ( cd $i ; easy_install . ) ; done Or perhaps this would be better: for i in * ; do ( cd $i ; python -c import setuptools; execfile('setup.py') develop ) ; done to install all the subversion-grabbed

[TurboGears] Re: Kid screws up special html (i.e. copy;)

2006-01-26 Thread [EMAIL PROTECTED]
northam wrote: why? for the browser, character references are no different from character codes. I think browser might not be involved into this problem. It's a Kid who outputs junk. BTW, output format is xhtml. no, it's not junk, it's encoded characters. the browser doesn't care if

[TurboGears] Re: About sqlite 2.x 'database is locked' error [was: [TurboGears] My experience with vistor filter]

2006-01-26 Thread nerkles
I had installed 2.1.2 and downgrading back to 2.0.5 solved it.

[TurboGears] Re: Kid screws up special html (i.e. copy;)

2006-01-26 Thread northam
[EMAIL PROTECTED] wrote: no, it's not junk, it's encoded characters. the browser doesn't care if you send it character entities, character references, or encoded text. it's all the same thing. see the link I posted for more on this. Let me put it in this way: 1. Kid does not validate

[TurboGears] Re: Kid screws up special html (i.e. copy;)

2006-01-26 Thread doreilly
To perhaps clarify, you're more than likely outputting UTF-8 encoded text. Given that there are unicode characters that represent a non-breaking space, or in your example, the copyright symbol, kid optimizes. This is a very small win, in that you're saving a few bytes per character. You'll

[TurboGears] Re: Kid screws up special html (i.e. copy;)

2006-01-26 Thread Martina Oefelein
Hi northam: 2. Kid does encode an character entity (copy;), as well as numeric character reference(#x00A9) into junk (i.e. improperly encoded text), no, kid encodes this correctly in utf-8 as two-byte-sequence: C2 A9. which is not displayed right (©). this happens if your browser decodes

[TurboGears] missing catwalk?

2006-01-26 Thread JKR
Hi all, I tried to test catwalk feature, but it seems like it missing from the latest source in trunk? or maybe I was wrong, I try to also look for catwalk source in the my python site-packages turbogears directory but no success. D:\01_src\Wiki-30python start-wiki30.py Traceback (most recent

[TurboGears] Re: missing catwalk?

2006-01-26 Thread Jared Kuolt
Change from turbogears.catwalk import CatWalk to from turbogears.toolbox.catwalk import CatWalk On 1/26/06, JKR [EMAIL PROTECTED] wrote: Hi all, I tried to test catwalk feature, but it seems like it missing from the latest source in trunk? or maybe I was wrong, I try to also look for

[TurboGears] Re: missing catwalk?

2006-01-26 Thread JKR
Thanks Jared, It works now :) now exploring catwalk

[TurboGears] Re: Kid screws up special html (i.e. copy;)

2006-01-26 Thread northam
no, kid encodes this correctly in utf-8 as two-byte-sequence: C2 A9. ... this happens if your browser decodes these two bytes according to ISO-8859-1 as two characters. ... Hi Martina, Thank you very much for your advices. Yes, you guys all right. It was an untidiness in template which

[TurboGears] Re: Bus Error

2006-01-26 Thread Ksenia Marasanova
Same problem, r.584. I've tracked it down to line 119 of pkg_resources.py in setuptools: __import__(moduleOrReq) It happens when moduleOrReq is 'turbogears.fastdata.templates' When I import it in advance, and put on the first line of config.py import turbogears.fastdata.templates, the error is

[TurboGears] Re: Bad Kid

2006-01-26 Thread Leandro Lucarella
[EMAIL PROTECTED], el jueves 26 de enero a las 19:37 me escribiste: Leandro Lucarella wrote: [EMAIL PROTECTED], el jueves 26 de enero a las 18:58 me escribiste: Yep, that was it. Makes my code ugly, but it works now. BTW, this is a XML problem, not a Kid one. it's HTML 101, in

[TurboGears] Re: TurboGears Role Based Security

2006-01-26 Thread Stephen Thorne
erisian wrote: Jeff, Does the API provide for two basic types of role-based protection? For example: 1) Declarative: some class: some method: / requires role(admin) 2) Procedural: if isInRole('jeff',admin) then do something else do something else endif and

[TurboGears] Re: Bad Kid

2006-01-26 Thread Stephen Thorne
[EMAIL PROTECTED] wrote: Yep, that was it. Makes my code ugly, but it works now. An option to make it less ugly is to use ; instead of amp; /foo?bar=bazamp;arr=tee becomes: /foo?bar=baz;arr=tee -- Regards, Stephen Thorne Development Engineer Scanned by the NetBox from NetBox Blue

[TurboGears] Re: TurboGears Role Based Security

2006-01-26 Thread Jeff Watkins
The Identity API provides #1 and #2 but not #3 because that is *so* application specific. For example, you could have the following class:class MyController(controllers.Controller):   [EMAIL PROTECTED]()   [EMAIL PROTECTED]( in_group( "admin" ) )    def index( self ):        pass   [EMAIL

[TurboGears] How to prevent TurboGears update download while distributing TurboGears application?

2006-01-26 Thread northam
It seems like this command .../TurboGears-0.8.8$ python setup.py install goes online, looking for a TurboGears updates and try to download them. How to install TurboGears without the check for updates?

[TurboGears] Re: TurboGears Role Based Security

2006-01-26 Thread Jeff Watkins
Stephen, this is largely the same functionality as the permissions built into Identity. However, I suspect you have specific requirements that made using the permissions not suit your needs.I'm prototyping a permission system that would allow customised permissions based on specific objects, but

[TurboGears] Best database design

2006-01-26 Thread tweekgeek
Hello everyone. I'm trying to figure out how to better do something that I've currently got... I've got a member's table in my database... It currently has a number of boolcol fields: class Member(SQLObject): username = StringCol(length=25, alternateID=True) appearance_0 =

[TurboGears] Re: .pydistutils.cfg docutils wiki20 home directory failure

2006-01-26 Thread Phillip J. Eby
Daniel Holth wrote: Using easy_install to install anything in the system path (requiring root), for any reason, is not tasteful for me. Perhaps I am using a web host for which I do not have root. Perhaps I really need my eggs or anything else under /usr to be tracked in the system's package

[TurboGears] JSON chokes on Decimal value

2006-01-26 Thread Dan Jacob
class Member(SQLObject): name = StringCol(length=45) billing_rate = CurrencyCol() @turbogears.expose(format=json) def get_member_data(self, member_id): member = model.Member.get(member_id) return dict(member=member) Throws this error: Traceback (most recent call last):

[TurboGears] Re: JSON chokes on Decimal value

2006-01-26 Thread Bob Ippolito
On Jan 26, 2006, at 10:18 PM, Dan Jacob wrote: class Member(SQLObject): name = StringCol(length=45) billing_rate = CurrencyCol() @turbogears.expose(format=json) def get_member_data(self, member_id): member = model.Member.get(member_id) return dict(member=member)