[tg-trunk] Re: Include a widget on every request

2008-12-02 Thread [EMAIL PROTECTED]

It's totally acceptable to create the widget anywhere, and import it
into master.html in a python block.

It's all view logic so there's no reason not to do it in the
template.   And you can use TW widgets any time you want in TG2 -- the
limitation that you couldn't import them in the template  in tg1 is
removed because in tg2 the resource injection happens after the
template is rendered.

--Mark Ramm

On Nov 27, 6:59 pm, Radityo [EMAIL PROTECTED] wrote:
 I am trying to make a website using  tg2b and currently I tried to
 create a web menu system using toscawidgets.
 But there are something that I cannot understand:
 1. How to include a widget on every request without having to pass it
 through tmpl.context on every method in every controller? I could do
 in-line code without toscawidgets in master template, but some how it
 doesn't feel right.
 2. I 
 triedhttp://www.turbogears.org/2.0/docs/main/ToscaWidgets/Cookbook/Dynamic...,
 but sometimes it return empty list.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears Trunk group.
To post to this group, send email to turbogears-trunk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-trunk?hl=en
-~--~~~~--~~--~--~---



[TurboGears] OT: Travel Blog

2008-11-22 Thread [EMAIL PROTECTED]

Hi all,

Well, I finally set off on my travels, and it's turned out to be more
than I ever dreamed of. If you're interested, I'm keeping a blog here:
http://paj28.livejournal.com/

Hope all is well in the Turbogears world. Do drop me private emails if
there are tw.dynforms problems. Actually, if someone could do a PyPI
release with the latest hg tip, that'd be cool. And I have a tutorial
90% done, gonna incorporate it into the docs when I have a couple of
hours at a decent Internet cafe.

Love n hugs,

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



[TurboGears] Re: Q: Let controller choose exposure dynamically

2008-11-19 Thread [EMAIL PROTECTED]

Excellent, that hits the spot - thanks :)))
Cheers,
C

On Nov 18, 5:16 pm, Christopher Arndt [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] schrieb:

  I've changed the code to:

      @expose(fragment = True)
      def default(self, *args, **kwargs):
  [...]
          elif action == 'image':
              response.headers['Content-type'] = image/jpeg
              return product.image

  which at least has the desired effect in this case.
  It'd still be interesting to know if you could effect the expose
  decorator used from within the controller if anyone has an idea how
  that could work, 'twould be great :)))

 Just use an internal redirect and write a dedicated method to serve the
 image. See also

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

 and

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

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



[TurboGears] Q: Let controller choose exposure dynamically

2008-11-18 Thread [EMAIL PROTECTED]

Hi all,

I'm writing a RESTful app and want to expose different aspects of an
object using different methods depending on part of the URL:

/product/1/overview

should provide text/html from a kid template

/product/1/image

should provide image/jpg from binary data held as part of the model.

I read somewhere (I think in the TurboGears book) that you can return
tg_format as part of the result dictionary to do this, but its not
working for me. Here's what I have:


@expose(content_type = image/jpg, as_format = image)
@expose(fragment = True)
def default(self, *args, **kwargs):
if len(args) != 2:
raise Exception(Invalid use of product controller - must
provide ID and action. You provided %d args: %s % (len(args), str
(args)))
id, action = args
id = int(id)
product = Product.get(id)
if action == 'overview':
return dict(product = product, tg_template =
doublesweb.templates.product_overview)
elif action == 'details':
return dict(product = product, tg_template =
doublesweb.templates.product_details)
elif action == 'image':
response.body = product.image
return dict(tg_format = image)
raise Exception(Unknown action: %s for product ID: %d %
(action, id))

It returns the correct content_type when I add ?tg_format=image to the
URL obtaining the image, but IMHO it would be more elegant to let the
controller decide what kind of response it wants to give.

The other problem I'm having is that I'm not actually getting the
image data returned - but that's for another post (unless someone
spots it and can provide me that info too :)).

Thanks in advance for any help / hints / tips :D

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



[TurboGears] Re: Q: Let controller choose exposure dynamically

2008-11-18 Thread [EMAIL PROTECTED]

... scratch the very last part about the image data not being returned
- just found that in another post here :)
Just need to 'return product.image' instead of a dict :D
So simple, I was over-thinking the problem! lol

Hopefully the solution to my other problem will be just as simple :)

Cheers,
C

On Nov 18, 3:14 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hi all,

 I'm writing a RESTful app and want to expose different aspects of an
 object using different methods depending on part of the URL:

 /product/1/overview

 should provide text/html from a kid template

 /product/1/image

 should provide image/jpg from binary data held as part of the model.

 I read somewhere (I think in the TurboGears book) that you can return
 tg_format as part of the result dictionary to do this, but its not
 working for me. Here's what I have:

     @expose(content_type = image/jpg, as_format = image)
     @expose(fragment = True)
     def default(self, *args, **kwargs):
         if len(args) != 2:
             raise Exception(Invalid use of product controller - must
 provide ID and action. You provided %d args: %s % (len(args), str
 (args)))
         id, action = args
         id = int(id)
         product = Product.get(id)
         if action == 'overview':
             return dict(product = product, tg_template =
 doublesweb.templates.product_overview)
         elif action == 'details':
             return dict(product = product, tg_template =
 doublesweb.templates.product_details)
         elif action == 'image':
             response.body = product.image
             return dict(tg_format = image)
         raise Exception(Unknown action: %s for product ID: %d %
 (action, id))

 It returns the correct content_type when I add ?tg_format=image to the
 URL obtaining the image, but IMHO it would be more elegant to let the
 controller decide what kind of response it wants to give.

 The other problem I'm having is that I'm not actually getting the
 image data returned - but that's for another post (unless someone
 spots it and can provide me that info too :)).

 Thanks in advance for any help / hints / tips :D

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



[TurboGears] Re: Q: Let controller choose exposure dynamically

2008-11-18 Thread [EMAIL PROTECTED]

Hi again,

I've changed the code to:

@expose(fragment = True)
def default(self, *args, **kwargs):
if len(args) != 2:
raise Exception(Invalid use of product controller - must
provide ID and action. You provided %d args: %s % (len(args), str
(args)))
id, action = args
id = int(id)
product = Product.get(id)
if action == 'overview':
return dict(product = product, tg_template =
doublesweb.templates.product_overview)
elif action == 'details':
return dict(product = product, tg_template =
doublesweb.templates.product_details)
elif action == 'image':
response.headers['Content-type'] = image/jpeg
return product.image
raise Exception(Unknown action: %s for product ID: %d %
(action, id))

which at least has the desired effect in this case.
It'd still be interesting to know if you could effect the expose
decorator used from within the controller if anyone has an idea how
that could work, 'twould be great :)))

Cheers,
C

On Nov 18, 3:25 pm, Matt Wilson [EMAIL PROTECTED] wrote:
 For returning the image, you might need to open a file pointer to the
 image and then read the bytes and then write them out.

 Just a wild guess.

  Hopefully the solution to my other problem will be just as simple :)

  Cheers,
  C

  On Nov 18, 3:14 pm, [EMAIL PROTECTED]

  [EMAIL PROTECTED] wrote:
   Hi all,

   I'm writing a RESTful app and want to expose different aspects of an
   object using different methods depending on part of the URL:

   /product/1/overview

   should provide text/html from a kid template

   /product/1/image

   should provide image/jpg from binary data held as part of the model.

   I read somewhere (I think in the TurboGears book) that you can return
   tg_format as part of the result dictionary to do this, but its not
   working for me. Here's what I have:

       @expose(content_type = image/jpg, as_format = image)
       @expose(fragment = True)
       def default(self, *args, **kwargs):
           if len(args) != 2:
               raise Exception(Invalid use of product controller - must
   provide ID and action. You provided %d args: %s % (len(args), str
   (args)))
           id, action = args
           id = int(id)
           product = Product.get(id)
           if action == 'overview':
               return dict(product = product, tg_template =
   doublesweb.templates.product_overview)
           elif action == 'details':
               return dict(product = product, tg_template =
   doublesweb.templates.product_details)
           elif action == 'image':
               response.body = product.image
               return dict(tg_format = image)
           raise Exception(Unknown action: %s for product ID: %d %
   (action, id))

   It returns the correct content_type when I add ?tg_format=image to the
   URL obtaining the image, but IMHO it would be more elegant to let the
   controller decide what kind of response it wants to give.

   The other problem I'm having is that I'm not actually getting the
   image data returned - but that's for another post (unless someone
   spots it and can provide me that info too :)).

   Thanks in advance for any help / hints / tips :D

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



[TurboGears] How make controllers return strings can convert to *dictionarys* ?

2008-11-02 Thread [EMAIL PROTECTED]

It seems TurboGears apps always return *strings*either html or
JSON or something else.

It isn't trivial to convert these *strings* to Python *dicitonaries*.

I was wondering easiest way to do this.

(e.g. Imagine the TurboGears web app's clients are Python scripts
using urllib to grab data from a SQLObject database.)

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



[TurboGears] Re: How make controllers return strings can convert to *dictionarys* ?

2008-11-02 Thread [EMAIL PROTECTED]



On Nov 2, 11:30 am, Diez B. Roggisch [EMAIL PROTECTED] wrote:
 I don't fully get this - is there any reason not to use simplejson to
 decode JSON-output to a dictionary? That's precisely what it's for.

Thanks.  Then I shall use simplejson! :)

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



[TurboGears] Re: Automatic reload giving strange errors...

2008-11-02 Thread [EMAIL PROTECTED]

Someone must have an ideathis is still a very annoying issue for
me.  :(

On Oct 28, 5:29 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Starting my program with the standard start-projname works 100% of the
 time.

 But for some reason, today the auto-reloading (that comes standard
 with the development project when I save my changes) is having
 troubles.  It fails 100% of the time.  It has never failed before
 today.

 Often it has a different error message, just to make it more
 confusing...

 Here's the latest:

 Traceback (most recent call last):
   File ./start-xstart.py, line 37, in module
     from xstart.controllers import Root
   File /home/me/dev_branch/ws/xstart/xstart/controllers.py, line
 1220

          ^
 IndentationError: expected an indented block
 2008-10-29 01:22:07,911 cherrypy.msg INFO ENGINE: SystemExit raised:
 shutting down autoreloader

 I've also gotten:
 Traceback (most recent call last):
   File ./start-xstart.py, line 37, in module
     from xstart.controllers import Root
   File /home/me/dev_branch/ws/xstart/xstart/controllers.py, line 699

                          ^
 SyntaxError: invalid syntax
 2008-10-29 01:16:57,245 cherrypy.msg INFO ENGINE: SystemExit raised:
 shutting down autoreloader

 and a few others which I'll post if they show up again.

 I need to emphasize that immediately afterwards without changing
 anything, just running start-xstart (my projname), it always runs
 fine.  And 100% of the time it fails in the reload after changing
 something...but often with a different error message (maybe four or
 five total).

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



[TurboGears] Automatic reload giving strange errors...

2008-10-28 Thread [EMAIL PROTECTED]

Starting my program with the standard start-projname works 100% of the
time.

But for some reason, today the auto-reloading (that comes standard
with the development project when I save my changes) is having
troubles.  It fails 100% of the time.  It has never failed before
today.

Often it has a different error message, just to make it more
confusing...

Here's the latest:

Traceback (most recent call last):
  File ./start-xstart.py, line 37, in module
from xstart.controllers import Root
  File /home/me/dev_branch/ws/xstart/xstart/controllers.py, line
1220

 ^
IndentationError: expected an indented block
2008-10-29 01:22:07,911 cherrypy.msg INFO ENGINE: SystemExit raised:
shutting down autoreloader


I've also gotten:
Traceback (most recent call last):
  File ./start-xstart.py, line 37, in module
from xstart.controllers import Root
  File /home/me/dev_branch/ws/xstart/xstart/controllers.py, line 699

 ^
SyntaxError: invalid syntax
2008-10-29 01:16:57,245 cherrypy.msg INFO ENGINE: SystemExit raised:
shutting down autoreloader

and a few others which I'll post if they show up again.

I need to emphasize that immediately afterwards without changing
anything, just running start-xstart (my projname), it always runs
fine.  And 100% of the time it fails in the reload after changing
something...but often with a different error message (maybe four or
five total).

Any thoughts?

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



[TurboGears] Automatic reload giving strange errors...

2008-10-28 Thread [EMAIL PROTECTED]

Starting my program with the standard start-projname works 100% of the
time.

But for some reason, today the auto-reloading (that comes standard
with the development project when I save my changes) is having
troubles.  It fails 100% of the time.  It has never failed before
today.

Often it has a different error message, just to make it more
confusing...

Here's the latest:

Traceback (most recent call last):
  File ./start-xstart.py, line 37, in module
from xstart.controllers import Root
  File /home/me/dev_branch/ws/xstart/xstart/controllers.py, line
1220

 ^
IndentationError: expected an indented block
2008-10-29 01:22:07,911 cherrypy.msg INFO ENGINE: SystemExit raised:
shutting down autoreloader


I've also gotten:
Traceback (most recent call last):
  File ./start-xstart.py, line 37, in module
from xstart.controllers import Root
  File /home/me/dev_branch/ws/xstart/xstart/controllers.py, line 699

 ^
SyntaxError: invalid syntax
2008-10-29 01:16:57,245 cherrypy.msg INFO ENGINE: SystemExit raised:
shutting down autoreloader

and a few others which I'll post if they show up again.

I need to emphasize that immediately afterwards without changing
anything, just running start-xstart (my projname), it always runs
fine.  And 100% of the time it fails in the reload after changing
something...but often with a different error message (maybe four or
five total).

Any thoughts?

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



[TurboGears] Re: Concerned about creating/using directories if *multiple* users...

2008-10-24 Thread [EMAIL PROTECTED]



On Oct 23, 11:48 pm, Diez Roggisch [EMAIL PROTECTED] wrote:
 No, they don't block. If they did, the performance would be lousy.

So does CherryPy create a lot of threads or processes under the hood?

 There are several options you have:

  - create temp files that you then move to the destination - this will work 
 because file moving is an atomic operation

  - use a cooperative file-lock. There are recipes on activestate on how to do 
 this in a cross-platform manner.

Hmm.  This sounds interesting.  Sounds like making your own custom
semaphores.

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



[TurboGears] Concerned about creating/using directories if *multiple* users...

2008-10-23 Thread [EMAIL PROTECTED]

My web app creates, writes to and deletes a temporary directory if a
certain method is invoked.

I'm concerned about implications if multiple users call this method at
the *same time*.  They will all be trying to create/delete/write
simultaneously which will lead to problems right?

In other words, TurboGears methods don't block for each user right?
I can't assume each method is only invoked once at a time right?

(I'm aware of Python's tempfile module to create temp files/dirs.  I
was hoping to avoid it. :)

Any help greatly appreciated.

Chris



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



[TurG-es] are you ready to earn dollar inhome daily 1hour earn$50000dollarformonth

2008-10-20 Thread [EMAIL PROTECTED]

are you ready to earn dollar inhome daily 1hour earn
$5dollarformonth
log onto

http://www.kazariangpt.com/index.php?ref=sivakumar


http://www.kazariangpt.com/index.php?ref=sivakumar


http://www.kazariangpt.com/index.php?ref=sivakumar
***



--~--~-~--~~~---~--~~
Web: http://groups.google.com/group/TurboGears-es
Para desuscribirse del grupo envie un mail a [EMAIL PROTECTED]
-~--~~~~--~~--~--~---



[TurboGears] Re: Misleading error message when template being extended from has errors

2008-10-20 Thread [EMAIL PROTECTED]

Hi Christoph,

Yeah - I already use SVN like a good little boy lol - that's how I was
able to verify that it was those changes (I simply reset them) ... but
I don't think even an svn diff showed up the weird chars :(

Thanks for the kidc tip! I'll try that next time :)

Cheers,
C

On Oct 19, 8:35 pm, Christoph Zwerschke [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] schrieb:

  I just had the problem that I'd messed up my master.kid, but when I
  tried to call a page using a template which extends from that I get
  the error message that master.kid can't be found - not that it has
  errors in - is there any way of seeing the error message?

 Try the following from the command line in your templates directory:

 kidc master.kid

 This should show where the problem is.

 Generally it's also helpful to use revision control if you want to find
 where you messed something up.

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



[TurG-es] are you ready to earn dollar inhome daily 1hour earn$5000dollarformonth

2008-10-19 Thread [EMAIL PROTECTED]

are you ready to earn dollar inhome daily 1hour earn
$5000dollarformonth
log onto

http://www.kazariangpt.com/index.php?ref=sivakumar


http://www.kazariangpt.com/index.php?ref=sivakumar


http://www.kazariangpt.com/index.php?ref=sivakumar
***
--~--~-~--~~~---~--~~
Web: http://groups.google.com/group/TurboGears-es
Para desuscribirse del grupo envie un mail a [EMAIL PROTECTED]
-~--~~~~--~~--~--~---



[TurboGears] Re: toolbox in 1.0.7 doesn't work with old project?

2008-10-19 Thread [EMAIL PROTECTED]

Thanks :)
Cheers,
C

On Oct 19, 12:46 pm, Christoph Zwerschke [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] schrieb:

  I tried starting the toolbox like this:
  tg-admin -c los.cfg toolbox
  and like this:
  tg-admin --config los.cfg toolbox
  But in both cases I got the 404. Only when I comment out the
  server.webpath from the dev.cfg does the toolbox work.

 I've now fixed the problem that --config was ignored in r5546 and that
 server.webpath was not reset in r5547.

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



[TurboGears] Misleading error message when template being extended from has errors

2008-10-19 Thread [EMAIL PROTECTED]

Hi all,

I just had the problem that I'd messed up my master.kid, but when I
tried to call a page using a template which extends from that I get
the error message that master.kid can't be found - not that it has
errors in - is there any way of seeing the error message?

Cheers,
C

PS: here's what I see in the console:

2008-10-19 20:11:32,258 cherrypy.msg INFO HTTP: Page handler: bound
method Root.index of doublesweb.controllers.Root object at
0x146c3b0
Traceback (most recent call last):
  File /Library/Python/2.5/site-packages/CherryPy-2.3.0-py2.5.egg/
cherrypy/_cphttptools.py, line 121, in _run
self.main()
  File /Library/Python/2.5/site-packages/CherryPy-2.3.0-py2.5.egg/
cherrypy/_cphttptools.py, line 264, in main
body = page_handler(*virtual_path, **self.params)
  File string, line 3, in index
  File /Library/Python/2.5/site-packages/TurboGears-1.0.7-py2.5.egg/
turbogears/controllers.py, line 360, in expose
*args, **kw)
  File string, line 5, in run_with_transaction
  File /Library/Python/2.5/site-packages/TurboGears-1.0.7-py2.5.egg/
turbogears/database.py, line 359, in so_rwt
retval = func(*args, **kw)
  File string, line 5, in _expose
  File /Library/Python/2.5/site-packages/TurboGears-1.0.7-py2.5.egg/
turbogears/controllers.py, line 373, in lambda
mapping, fragment, args, kw)))
  File /Library/Python/2.5/site-packages/TurboGears-1.0.7-py2.5.egg/
turbogears/controllers.py, line 423, in _execute_func
return _process_output(output, template, format, content_type,
mapping, fragment)
  File /Library/Python/2.5/site-packages/TurboGears-1.0.7-py2.5.egg/
turbogears/controllers.py, line 88, in _process_output
fragment=fragment)
  File /Library/Python/2.5/site-packages/TurboGears-1.0.7-py2.5.egg/
turbogears/view/base.py, line 161, in render
return engine.render(**kw)
  File /Library/Python/2.5/site-packages/TurboKid-1.0.4-py2.5.egg/
turbokid/kidsupport.py, line 182, in render
tclass = self.load_template(template)
  File /Library/Python/2.5/site-packages/TurboKid-1.0.4-py2.5.egg/
turbokid/kidsupport.py, line 139, in load_template
package, basename, tfile, classname)
  File /Library/Python/2.5/site-packages/TurboKid-1.0.4-py2.5.egg/
turbokid/kidsupport.py, line 16, in _compile_template
mod = kid.load_template(tfile, name=classname)
  File /Library/Python/2.5/site-packages/kid-0.9.6-py2.5.egg/kid/
__init__.py, line 160, in load_template
store=cache, ns=ns, exec_module=exec_module)
  File /Library/Python/2.5/site-packages/kid-0.9.6-py2.5.egg/kid/
importer.py, line 147, in _create_module
raise_template_error(module=name, filename=filename)
  File /Library/Python/2.5/site-packages/kid-0.9.6-py2.5.egg/kid/
importer.py, line 143, in _create_module
exec code in mod.__dict__
  File /Users/clive/projects/DoublesWeb/doublesweb/doublesweb/
templates/welcome.py, line 20, in module
  File /Library/Python/2.5/site-packages/kid-0.9.6-py2.5.egg/kid/
template_util.py, line 127, in base_class_extends
% (all_extends or extends)).lstrip())
TemplateExtendsError: Could not open '/Users/clive/projects/DoublesWeb/
doublesweb/doublesweb/templates/master.kid'
Template file 'master.kid' not found
while processing extends='master.kid'
Error location in template file '/Users/clive/projects/DoublesWeb/
doublesweb/doublesweb/templates/welcome.kid'
on line 1 after column 120:
... 
Request Headers:
  COOKIE: session_id=b48f4dd3e073f6e3e1778c2f8066bf7d5a663f50; tg-
visit=08d118486b9aab726d29d59d2059c1b4683a4abc
  Content-Length:
  USER-AGENT: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us)
AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1
  CONNECTION: keep-alive
  HOST: localhost:8080
  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: ::1
  ACCEPT-LANGUAGE: en-us
  Content-Type:
  ACCEPT-ENCODING: gzip, deflate
 - - GET / HTTP/1.1 500 3871  Mozilla/5.0 (Macintosh; U; Intel
Mac OS X 10_5_5; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/
3.1.2 Safari/525.20.1



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



[TurboGears] Re: Misleading error message when template being extended from has errors

2008-10-19 Thread [EMAIL PROTECTED]

... just found what caused the error in master.kid - there were some
funky chars which Coda had somehow added to the file ... not visible
in Coda, but I found them in ViM (I don't know why I keep trying other
editors - I should just stick with what works lol).
But the error message was misleading none the less ... maybe this is
more of a CherryPy issue, though?

Cheers,
C

On Oct 19, 8:12 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hi all,

 I just had the problem that I'd messed up my master.kid, but when I
 tried to call a page using a template which extends from that I get
 the error message that master.kid can't be found - not that it has
 errors in - is there any way of seeing the error message?

 Cheers,
 C

 PS: here's what I see in the console:

 2008-10-19 20:11:32,258 cherrypy.msg INFO HTTP: Page handler: bound
 method Root.index of doublesweb.controllers.Root object at
 0x146c3b0
 Traceback (most recent call last):
   File /Library/Python/2.5/site-packages/CherryPy-2.3.0-py2.5.egg/
 cherrypy/_cphttptools.py, line 121, in _run
     self.main()
   File /Library/Python/2.5/site-packages/CherryPy-2.3.0-py2.5.egg/
 cherrypy/_cphttptools.py, line 264, in main
     body = page_handler(*virtual_path, **self.params)
   File string, line 3, in index
   File /Library/Python/2.5/site-packages/TurboGears-1.0.7-py2.5.egg/
 turbogears/controllers.py, line 360, in expose
     *args, **kw)
   File string, line 5, in run_with_transaction
   File /Library/Python/2.5/site-packages/TurboGears-1.0.7-py2.5.egg/
 turbogears/database.py, line 359, in so_rwt
     retval = func(*args, **kw)
   File string, line 5, in _expose
   File /Library/Python/2.5/site-packages/TurboGears-1.0.7-py2.5.egg/
 turbogears/controllers.py, line 373, in lambda
     mapping, fragment, args, kw)))
   File /Library/Python/2.5/site-packages/TurboGears-1.0.7-py2.5.egg/
 turbogears/controllers.py, line 423, in _execute_func
     return _process_output(output, template, format, content_type,
 mapping, fragment)
   File /Library/Python/2.5/site-packages/TurboGears-1.0.7-py2.5.egg/
 turbogears/controllers.py, line 88, in _process_output
     fragment=fragment)
   File /Library/Python/2.5/site-packages/TurboGears-1.0.7-py2.5.egg/
 turbogears/view/base.py, line 161, in render
     return engine.render(**kw)
   File /Library/Python/2.5/site-packages/TurboKid-1.0.4-py2.5.egg/
 turbokid/kidsupport.py, line 182, in render
     tclass = self.load_template(template)
   File /Library/Python/2.5/site-packages/TurboKid-1.0.4-py2.5.egg/
 turbokid/kidsupport.py, line 139, in load_template
     package, basename, tfile, classname)
   File /Library/Python/2.5/site-packages/TurboKid-1.0.4-py2.5.egg/
 turbokid/kidsupport.py, line 16, in _compile_template
     mod = kid.load_template(tfile, name=classname)
   File /Library/Python/2.5/site-packages/kid-0.9.6-py2.5.egg/kid/
 __init__.py, line 160, in load_template
     store=cache, ns=ns, exec_module=exec_module)
   File /Library/Python/2.5/site-packages/kid-0.9.6-py2.5.egg/kid/
 importer.py, line 147, in _create_module
     raise_template_error(module=name, filename=filename)
   File /Library/Python/2.5/site-packages/kid-0.9.6-py2.5.egg/kid/
 importer.py, line 143, in _create_module
     exec code in mod.__dict__
   File /Users/clive/projects/DoublesWeb/doublesweb/doublesweb/
 templates/welcome.py, line 20, in module
   File /Library/Python/2.5/site-packages/kid-0.9.6-py2.5.egg/kid/
 template_util.py, line 127, in base_class_extends
     % (all_extends or extends)).lstrip())
 TemplateExtendsError: Could not open '/Users/clive/projects/DoublesWeb/
 doublesweb/doublesweb/templates/master.kid'
 Template file 'master.kid' not found
 while processing extends='master.kid'
 Error location in template file '/Users/clive/projects/DoublesWeb/
 doublesweb/doublesweb/templates/welcome.kid'
 on line 1 after column 120:
 ... 
 Request Headers:
   COOKIE: session_id=b48f4dd3e073f6e3e1778c2f8066bf7d5a663f50; tg-
 visit=08d118486b9aab726d29d59d2059c1b4683a4abc
   Content-Length:
   USER-AGENT: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us)
 AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1
   CONNECTION: keep-alive
   HOST: localhost:8080
   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: ::1
   ACCEPT-LANGUAGE: en-us
   Content-Type:
   ACCEPT-ENCODING: gzip, deflate
  - - GET / HTTP/1.1 500 3871  Mozilla/5.0 (Macintosh; U; Intel
 Mac OS X 10_5_5; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/
 3.1.2 Safari/525.20.1
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: toolbox in 1.0.7 doesn't work with old project?

2008-10-18 Thread [EMAIL PROTECTED]

Hi,

Unfortunately there's no error message other than the 404 ... here's a
grab of what I see:

[EMAIL PROTECTED] 11:44 ~/projects/DoublesWeb/doublesweb  tg-admin
toolbox
18/Oct/2008:11:44:34 CONFIG INFO Server parameters:
18/Oct/2008:11:44:34 CONFIG INFO   server.environment: development
18/Oct/2008:11:44:34 CONFIG INFO   server.log_to_screen: True
18/Oct/2008:11:44:34 CONFIG INFO   server.log_file:
18/Oct/2008:11:44:34 CONFIG INFO   server.log_tracebacks: True
18/Oct/2008:11:44:34 CONFIG INFO   server.log_request_headers: True
18/Oct/2008:11:44:34 CONFIG INFO   server.protocol_version: HTTP/1.0
18/Oct/2008:11:44:34 CONFIG INFO   server.socket_host:
18/Oct/2008:11:44:34 CONFIG INFO   server.socket_port: 7654
18/Oct/2008:11:44:34 CONFIG INFO   server.socket_file:
18/Oct/2008:11:44:34 CONFIG INFO   server.reverse_dns: False
18/Oct/2008:11:44:34 CONFIG INFO   server.socket_queue_size: 5
18/Oct/2008:11:44:34 CONFIG INFO   server.thread_pool: 10
2008-10-18 11:44:35,095 turbogears.visit INFO Visit Tracking starting
2008-10-18 11:44:35,096 turbogears.visit DEBUG Loading visit manager
from plugin: sqlobject
2008-10-18 11:44:35,144 turbogears.visit.sovisit INFO Succesfully
loaded doublesweb.model.Visit
Registering Service turbogears: development._http._tcp port 7654 TXT
path=/
2008-10-18 11:44:35,184 turbogears.visit INFO Visit filter initialised
2008-10-18 11:44:35,188 turbogears.identity INFO Identity starting
2008-10-18 11:44:35,189 turbogears.identity DEBUG Loading provider
from plugin: sqlobject
2008-10-18 11:44:35,247 turbogears.identity.soprovider INFO
Succesfully loaded doublesweb.model.User
2008-10-18 11:44:35,247 turbogears.identity.soprovider INFO
Succesfully loaded doublesweb.model.Group
2008-10-18 11:44:35,248 turbogears.identity.soprovider INFO
Succesfully loaded doublesweb.model.Permission
2008-10-18 11:44:35,248 turbogears.identity.soprovider INFO
Succesfully loaded doublesweb.model.VisitIdentity
2008-10-18 11:44:35,249 turbogears.identity INFO Identity visit plugin
initialised
2008-10-18 11:44:35,249 turbogears.identity DEBUG Loading provider
from plugin: sqlobject
2008-10-18 11:44:35,250 turbogears.identity.soprovider INFO
Succesfully loaded doublesweb.model.User
2008-10-18 11:44:35,250 turbogears.identity.soprovider INFO
Succesfully loaded doublesweb.model.Group
2008-10-18 11:44:35,250 turbogears.identity.soprovider INFO
Succesfully loaded doublesweb.model.Permission
2008-10-18 11:44:35,250 turbogears.identity.soprovider INFO
Succesfully loaded doublesweb.model.VisitIdentity
11:44:35.910  Got a reply for service turbogears:
development._http._tcp.local.: Name now registered and active
18/Oct/2008:11:44:36 HTTP INFO Serving HTTP on http://0.0.0.0:7654/
18/Oct/2008:11:44:37 HTTP INFO Page handler: The path '/' was not
found.
Traceback (most recent call last):
  File /Library/Python/2.5/site-packages/CherryPy-2.3.0-py2.5.egg/
cherrypy/_cphttptools.py, line 106, in _run
applyFilters('before_request_body')
  File /Library/Python/2.5/site-packages/CherryPy-2.3.0-py2.5.egg/
cherrypy/filters/__init__.py, line 151, in applyFilters
method()
  File /Library/Python/2.5/site-packages/TurboGears-1.0.7-py2.5.egg/
turbogears/startup.py, line 163, in before_request_body
raise cherrypy.NotFound(request.path)
NotFound: 404
Request Headers:
  COOKIE:
JSESSIONID=t1JpL2JQn1SltQwJ2NXYmTnfFQZMypZpZVJhvXbc5vWXw1qjGkXw!
1609003243; tg-visit=18361b30de7c391b2f4a28375e72f9ab5da10bc0
  Content-Length:
  USER-AGENT: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us)
AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1
  CONNECTION: keep-alive
  HOST: localhost:7654
  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: ::1
  ACCEPT-LANGUAGE: en-us
  Content-Type:
  ACCEPT-ENCODING: gzip, deflate
::1 - - [18/Oct/2008:11:44:37] GET / HTTP/1.1 404 1264  Mozilla/
5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us) AppleWebKit/525.18
(KHTML, like Gecko) Version/3.1.2 Safari/525.20.1

Cheers,
C

On Oct 17, 3:16 pm, Christopher Arndt [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] schrieb:

  Hi all,

  I've upgraded TG to 1.0.7, and have a project which I'd started with
  1.0.5 (IIRC). The project itself runs fine, but I can use the toolbox
  any more. It starts up without error messages, but I get a 404 in the
  browser that pops open. I've verified that the toolbox runs fine
  outside of the project.

  Does anyone have any pointers how I might get the toolbox to work for
  my old project; t'would be much appreciated ;)

 It would greatly help, if you posted the error message.

 Chris
--~--~-~--~~~---~--~~
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] Re: toolbox in 1.0.7 doesn't work with old project?

2008-10-18 Thread [EMAIL PROTECTED]

Hi Christoph,

Yup - it was the server.webpath! What's weird, though, is that I tried
it with a different config, but that didn't seem to work ... here's
what I have ...

a dev.cfg which is configured for the hosting env for development.
This has the server.webpath set.
a los.cfg which is configured for my local machine which doesn't have
the server.webpath set.

I tried starting the toolbox like this:
 tg-admin -c los.cfg toolbox
and like this:
 tg-admin --config los.cfg toolbox
But in both cases I got the 404. Only when I comment out the
server.webpath from the dev.cfg does the toolbox work.

But at least I now have an easy way of getting to the toolbox
again!! :D
Thanks for your help ;)

Cheers,
C

On Oct 18, 12:43 pm, Christoph Zwerschke [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] schrieb:

  Unfortunately there's no error message other than the 404 ... here's a
  grab of what I see:

  18/Oct/2008:11:44:37 HTTP INFO Page handler: The path '/' was not
  found.

 Do you have server.webpath set in your config or other special
 configuration options? Toolbox runs under the configuration of your
 project and with some of its settings it may not work correctly.

 Some parameters are overwritten 
 here:http://trac.turbogears.org/browser/tags/1.0.7/turbogears/command/base...

 But it seems some important parameters such as server.webpath have been
 forgotten. We need to add these in the code above.

 Let us know if it is server.webpath or if you find any other problematic
 setting that should be reset before starting the toolbox.

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



[TurboGears] toolbox in 1.0.7 doesn't work with old project?

2008-10-17 Thread [EMAIL PROTECTED]

Hi all,

I've upgraded TG to 1.0.7, and have a project which I'd started with
1.0.5 (IIRC). The project itself runs fine, but I can use the toolbox
any more. It starts up without error messages, but I get a 404 in the
browser that pops open. I've verified that the toolbox runs fine
outside of the project.

Does anyone have any pointers how I might get the toolbox to work for
my old project; t'would be much appreciated ;)

Cheers,
C

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



[TurboGears] issues with lighttpd and wsgi: tg.url weirdness. current_dir_uri bugging

2008-10-17 Thread [EMAIL PROTECTED]

i'm fairly new to turbogears so any help would be appreciated.

i am trying to run turbogears from behind a lighttpd (for better ssl
and basic http handling) and i have it somewhat working. Only a couple
of things seem broken.

First off, in dev.cfg (and prod.cfg as well) it did not recognise the %
(current_dir_uri)s command. I had to replace it with the current
working path by hand to get it to work.

secondly, it could not find wsgi.url_scheme, so the Cherrypy did not
want to start. I fixed it like this

[code]
environ = {'server.webpath':'/','current_dir_uri':'/home/davidd/
localroot/
wiki20','wsgi.url_scheme':'http','engine.autoreload_on':False}
cherrypy.config.update({'wsgi.url_scheme':'http','engine.autoreload_on':False})
environ.update({'wsgi.url_scheme':'http'})
if len(sys.argv)  1:
cherrypy.config.update(environ,file=sys.argv[1])
[/code]

after that only one bug remains, and that is with tg.url()
 even when i force server.webpath to be / somehow my controller
thingy still shows up in the returnvalue of
tg.url()
for example: when i go (firefox) to http://myhost:8080/index and i do
view source for my page i see that it tries to open /index/static/css/
style.css as stylesheet, instead of /static/css/style.css
tg.url() only works correctly for the GET / , all other things are
broken.

when searching for people with similar problems  i found
http://groups.google.com/group/turbogears/browse_thread/thread/2e6ad60c1923eeda#

like this person i can enter any random string between my hostname and
my controller pointer
http://mhost/garblegarblegarble/index will return the data that is
supposed to be returned, just the tg.url() parts are wrong then

my application is really quite similar to the wiki20 tutorial. Any
help would be greatly appreciated.

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



[TurboGears] Re: Ticket #2009: Catwalk connection polling issue

2008-10-15 Thread [EMAIL PROTECTED]

I've started getting this error only after upgrading to the latest
Turbogears 1.0 version (1.0.7)

Running FC6 on a Dell Inspiron 8500 laptop - Turbogears runs fine, but
the tg-admin toolbox command started throwing this error only after
upgrading to 1.0.7

FYI, I'm running the same version of TG on windows xp with no such
problem. . . .





On Oct 12, 1:42 am, Christopher Arndt [EMAIL PROTECTED] wrote:
 Jorge Vargas schrieb:

  On Fri, Oct 10, 2008 at 5:07 PM, Christopher Arndt [EMAIL PROTECTED] 
  wrote:
  Adele Thompson schrieb:
  #2009: Catwalk connection polling
  Why are you sending this to the main mailing list? We have a ticket
  notification list, where people can (and do) follow changes to trac 
  tickets:

  Seehttp://docs.turbogears.org/GettingHelp#mailing-lists

  My magic ball (read: IRC logs) tell me he thinks this is a security
  issue and it should be fixed ASAP. Now I'm not much of an apache guru
  to really indestand what is happening.

 How so? Would you share your logs with us? If this is critical intel,
 send it to [EMAIL PROTECTED],org, please.

 Chris

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



[TurboGears] Re: How turbogears handles sessions?

2008-10-02 Thread [EMAIL PROTECTED]



On Oct 1, 7:53 pm, Jorge Vargas [EMAIL PROTECTED] wrote:
 On Tue, Sep 30, 2008 at 7:55 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  Hello, I've been trudging through various tutorials and documentation
  trying to get TG 1.1b1 working.

 maybe you will want to try the 1.0 branch as it's well documented 1.1
 had a lot of changes and it isn't really ready for first timers.

Thanks, but I'm required to use the beta version.  The prospective
employers wanted applicants to struggle with a new app.


  None of them really give me all the
  answers I need.  The SA documentation either gives the declarative
  style (0.5) docs, or the non-declarative style(0.4) docs.  Since the
  0.5 docs don't show how to use relations in the old style,

 umm interesting. for what is worth they are identical except that in
 declarative you don't use the first argument (Class Name) that you
 will use in classical.

That's nice to know.  Thanks.


  I've had to
  learn from the 0.4 docs.  The problem is, the SA 0.4 docs constantly
  refer to various session manipulations (session.query in particular);
  but none of the turbogears docs I've come accross mention anything
  about using session objects/methods.

 Did you saw this page?http://docs.turbogears.org/1.0/SQLAlchemy

I just ran accross it before reading your post.  It does answer my
session questions, assuming 1.1 is designed the same as 1.0...


 Basically TG controllers wrap everything in a transaction which means
 you don't normally have to call anything session related.

  All I know is that when using
  the tg-admin shell, session changes are automatically queued up and
  committed when the shell is exited. or when executing
  session.comitt().  This is an undesirable, feature by the way, since I
  can't specify which new object instances to save and which to throw
  away; or at least I don't know how to do so.

 No this isn't undesirable, that is why it is a session, you may be
 confusing the term with an http session, while it is actually a db
 session.http://www.sqlalchemy.org/docs/04/session.html#unitofwork_what

 if you want to get rid of some object you created (maybe by mistake)
 you could run del obj in that python shell and it will be discarded.

I've read the above document also, but both documents are inconsistent
with what I'm seeing in tg-admin shell.  Maybe the controllers module
is handled differently than tg-admin shell?  Here's a couple examples
of what I'm talking about.  Within tg-admin shell:

In [1]: for group in Group.query.all(): print group.group_name
   ...:
admin
Blah
one

In [2]: g = Group(group_name=u'two', display_name=u'group two')

# Now I decide I don't want g to be commited to the database; but i do
want all previous modifications to be saved; so I try del

In [3]: del g

In [4]: session.commit()
---
InvalidRequestError   Traceback (most recent call
last)

/home/ce/smplab/ipython console in module()

/usr/lib64/python2.5/site-packages/SQLAlchemy-0.5.0rc1-py2.5.egg/
sqlalchemy/orm/scoping.py in do(self, *args, **kwargs)
104 def instrument(name):
105 def do(self, *args, **kwargs):
-- 106 return getattr(self.registry(), name)(*args, **kwargs)
107 return do
108 for meth in Session.public_methods:

/usr/lib64/python2.5/site-packages/SQLAlchemy-0.5.0rc1-py2.5.egg/
sqlalchemy/orm/session.py in commit(self)
665 self.begin()
666 else:
-- 667 raise sa_exc.InvalidRequestError(No
transaction is begun.)
668
669 self.transaction.commit()
No transaction is begun
InvalidRequestError: No transaction is begun.

# There's actually two problems here:  1) this No transaction is
begun error above happens no matter what I try to commit.  2) After
exiting the shell, as below, and answering yes (which I assume does
a commit), the new group still appears in the database as follows:

In [5]: Do you wish to commit your database changes? [yes]

In [1]: for group in Group.query.all(): print group.group_name
   ...:
admin
Blah
one
two

So, both del and commit don't seem to be working.

Also, even if they did work for me, why do the examples show a new
object being saved and then commited?  Doesn't commit call a flush,
which saves all objects, so that the first save is redundant?

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



[TurboGears] How turbogears handles sessions?

2008-09-30 Thread [EMAIL PROTECTED]

Hello, I've been trudging through various tutorials and documentation
trying to get TG 1.1b1 working.  None of them really give me all the
answers I need.  The SA documentation either gives the declarative
style (0.5) docs, or the non-declarative style(0.4) docs.  Since the
0.5 docs don't show how to use relations in the old style, I've had to
learn from the 0.4 docs.  The problem is, the SA 0.4 docs constantly
refer to various session manipulations (session.query in particular);
but none of the turbogears docs I've come accross mention anything
about using session objects/methods.  All I know is that when using
the tg-admin shell, session changes are automatically queued up and
committed when the shell is exited. or when executing
session.comitt().  This is an undesirable, feature by the way, since I
can't specify which new object instances to save and which to throw
away; or at least I don't know how to do so.

I've been trying to figure out if I'm supposed to use session.query
from the controller module, or the model module, or if I'm not
supposed to use it at all...  The controller module doesn't have any
import statements regarding session stuff, so if I want to create a
controller which queries anything, I don't know what should be
imported and what is handled automatically by turbogears.

I've been trying to create a quick webapp as part of a job
application, and I'm behind schedule and looking bad to the
prospective employers; so I'd really appreciate some help.  Thank you
very much for your time.

BTW, until a few days ago i didn't know such software packages as TG
even existed, but they sure do make web development a hundred times
faster, better and more enjoyable.  Keep up the good work TG team!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] sqlalchemy mappings clobber each other

2008-09-29 Thread [EMAIL PROTECTED]

I'm experiencing a strange problem with my model module after just
installing Plissken, TG 1.1b1 with SQLAlchemy-0.5.0rc1.  I have the
standard identity model definitions included by default after
generating a project skeleton with tg-admin --identity --sqlalchemy,
and they work just fine when I don't add any other mappings to the
model file.  However, when I added a simple table experiments_table
and an object Experiments and mapped them together, the tg-admin
shell tells me my Experiments object has only one __init__ argument,
yet I clearly defined 3 arguments:

experiments_table = Table('experiments', metadata,
   Column('name', Unicode(30), primary_key=True),
   Column('desc', Text)
)

class Experiment(object):
   def __init__(self, name, desc):
  self.name = name
  self.desc = desc

mapper(Experiment, experiments_table)

Experiment(u'1', 'one')
---
TypeError Traceback (most recent call
last)

/home/ce/smplab/ipython console in module()

TypeError: __init__() takes exactly 1 argument (3 given)


Also, If I remove all the identity definitions and use the same
Experiment object above, it works just fine.  Or If i simply put the
mapper statement for the Experiment before the identity mapper
statements, then the Experiment objects work and the identity one's
don't.   I only have this problem when both the identity objects/
tables and Experiment object/table are mapped simultaneously.  Does
anyone have a clue what's happening?  I'd greatly appreciate any
help.  Thank you for your time.

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



[TurboGears] Re: sqlalchemy mappings clobber each other

2008-09-29 Thread [EMAIL PROTECTED]

 Now this is something I haven't seen, as long as there isn't any name
 collisions, which doesn't seem to be this should never happen. Could
 you make sure some extra files aren't been added, say an old .pyc or a
 copy made by an ide (or a backup) defining several times the same
 models? did you try running it outside ipython, maybe something is
 doing a strange thing there.

I've been removing all .pyc files in the project directory
(recursively) before every change I make.  I tried tg-admin shell
again without ipython and get the same results.  If you wanted me to
try without using tg-admin shell, I don't know what all imports and
sqlalchemy commands (which are handled by tg-admin shell) I would need
to manually execute.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: sqlalchemy mappings clobber each other

2008-09-29 Thread [EMAIL PROTECTED]

Ah; that works.  So, when the stack trace says init wants only one
argument, that argument is a dictionary; hence the **kwargs in
__call__ ?

Apparently, the documentation is wrong:
http://www.sqlalchemy.org/docs/05/ormtutorial.html#datamapping_adding

Thank you Gaetan and Jorge!

On Sep 29, 11:06 am, Gaetan de Menten [EMAIL PROTECTED] wrote:
 On Mon, Sep 29, 2008 at 6:17 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  Now this is something I haven't seen, as long as there isn't any name
  collisions, which doesn't seem to be this should never happen. Could
  you make sure some extra files aren't been added, say an old .pyc or a
  copy made by an ide (or a backup) defining several times the same
  models? did you try running it outside ipython, maybe something is
  doing a strange thing there.

  Even worse, I just tried creating another project using elixir and
  creating the same simple object and nothing else (no identity stuff):

  class Experiment(Entity):
name = Field(Unicode(30), primary_key=True)
desc = Field(UnicodeText)

  and this is the result:

  Experiment(u'1', u'one')
  Traceback (most recent call last):
   File console, line 1, in module
   File /usr/lib64/python2.5/site-packages/Elixir-0.6.1-py2.5.egg/
  elixir/entity.py, line 718, in __call__
 return type.__call__(cls, *args, **kwargs)
  TypeError: __init__() takes exactly 1 argument (3 given)

 The default __init__ method provided by Entity in Elixir accepts
 keyword arguments for field names, not plain arguments...
 Try:
 Experiment(name=u'1', desc=u'one')

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



[TurboGears] Re: sqlalchemy mappings clobber each other

2008-09-29 Thread [EMAIL PROTECTED]

But I had the same problem without elixir; and using the keyword
format fixed it also...

On Sep 29, 11:30 am, Jorge Vargas [EMAIL PROTECTED] wrote:
 On Mon, Sep 29, 2008 at 12:25 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  Ah; that works.  So, when the stack trace says init wants only one
  argument, that argument is a dictionary; hence the **kwargs in
  __call__ ?

 ahh see, it was an Elixir thing.

  Apparently, the documentation is wrong:
 http://www.sqlalchemy.org/docs/05/ormtutorial.html#datamapping_adding

 no not at all, remember that elixir is an independent package that
 builds on top of SA. and one of the things you get by extending that
 Entity class is the constructor Gaetan suggested which is the one
 giving the error.

  Thank you Gaetan and Jorge!

  On Sep 29, 11:06 am, Gaetan de Menten [EMAIL PROTECTED] wrote:
  On Mon, Sep 29, 2008 at 6:17 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] 
  wrote:

   Now this is something I haven't seen, as long as there isn't any name
   collisions, which doesn't seem to be this should never happen. Could
   you make sure some extra files aren't been added, say an old .pyc or a
   copy made by an ide (or a backup) defining several times the same
   models? did you try running it outside ipython, maybe something is
   doing a strange thing there.

   Even worse, I just tried creating another project using elixir and
   creating the same simple object and nothing else (no identity stuff):

   class Experiment(Entity):
 name = Field(Unicode(30), primary_key=True)
 desc = Field(UnicodeText)

   and this is the result:

   Experiment(u'1', u'one')
   Traceback (most recent call last):
File console, line 1, in module
File /usr/lib64/python2.5/site-packages/Elixir-0.6.1-py2.5.egg/
   elixir/entity.py, line 718, in __call__
  return type.__call__(cls, *args, **kwargs)
   TypeError: __init__() takes exactly 1 argument (3 given)

  The default __init__ method provided by Entity in Elixir accepts
  keyword arguments for field names, not plain arguments...
  Try:
  Experiment(name=u'1', desc=u'one')

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



[TurboGears] Re: sqlalchemy mappings clobber each other

2008-09-29 Thread [EMAIL PROTECTED]

That's strange, since my first post shows I clearly defined __init__
with 3 args and it would't work unless I pass a dictionary.  How's
that work?

On Sep 29, 11:33 am, Gaetan de Menten [EMAIL PROTECTED] wrote:
 On Mon, Sep 29, 2008 at 8:25 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  Ah; that works.  So, when the stack trace says init wants only one
  argument, that argument is a dictionary; hence the **kwargs in
  __call__ ?

  Apparently, the documentation is wrong:
 http://www.sqlalchemy.org/docs/05/ormtutorial.html#datamapping_adding

 No, it's not wrong... In doc example, it provides a specific __init__
 method which accepts args...





  Thank you Gaetan and Jorge!

  On Sep 29, 11:06 am, Gaetan de Menten [EMAIL PROTECTED] wrote:
  On Mon, Sep 29, 2008 at 6:17 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] 
  wrote:

   Now this is something I haven't seen, as long as there isn't any name
   collisions, which doesn't seem to be this should never happen. Could
   you make sure some extra files aren't been added, say an old .pyc or a
   copy made by an ide (or a backup) defining several times the same
   models? did you try running it outside ipython, maybe something is
   doing a strange thing there.

   Even worse, I just tried creating another project using elixir and
   creating the same simple object and nothing else (no identity stuff):

   class Experiment(Entity):
 name = Field(Unicode(30), primary_key=True)
 desc = Field(UnicodeText)

   and this is the result:

   Experiment(u'1', u'one')
   Traceback (most recent call last):
File console, line 1, in module
File /usr/lib64/python2.5/site-packages/Elixir-0.6.1-py2.5.egg/
   elixir/entity.py, line 718, in __call__
  return type.__call__(cls, *args, **kwargs)
   TypeError: __init__() takes exactly 1 argument (3 given)

  The default __init__ method provided by Entity in Elixir accepts
  keyword arguments for field names, not plain arguments...
  Try:
  Experiment(name=u'1', desc=u'one')

  --
  Gaëtan de Mentenhttp://openhex.org

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



[TurboGears] Catching IntegrityError in SqlObject...

2008-09-26 Thread [EMAIL PROTECTED]

Well after an hour or so of mucking around, I finally found out how to
catch an IntegrityError.

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

No wonder I couldn't catch it.

Has anyone figured out something more elegant?

Is this in fact, for sure, a bug in SQLObject and not TG?  If so, I'll
take it the SQLObject mailing list, and hopefully get it fixed.

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?hl=en
-~--~~~~--~~--~--~---



[TurboGears] sqlalchemy / elixir - truncate table

2008-09-23 Thread [EMAIL PROTECTED]

Hello,
is there any other way to truncate table besides using

session.execute(truncate my_table)
session.commit()


i tried to improvise and but it didnt work:

myt = my_table.query
my_table.delete(myt)

myt.delete()


i could Iterate over my_table.query.all() but thats just looks wrong.

Thanks in advance,
Timor A.

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



[TurboGears] xi:include, widget, or something else?

2008-09-21 Thread [EMAIL PROTECTED]

I have some static code that I want to include in a few different
pages.  The code basically sets up a modal window to display
information, which is fetched by ajax all using jquery.

Here's the xhtml part:

 div class=jqmWindow id=rinfo
Please wait... img src=inc/busy.gif alt=loading /
 /div

Notice there are no variables or anything in the xhtml part.

And here's the part from the header...

 script src=http://www.google.com/jsapi; /
   scriptgoogle.load(jquery, 1.2);/script
   script src=/static/javascript/o/jqModal.js /
   link rel=StyleSheet href=/static/css/o/jqModal.css type=text/
css /
   script
  $().ready(function() {
 $('#rinfo').jqm({ajax: '@href', trigger: 'a.rinfo_link'});
  });
   /script

Now I'm wondering whether I'm better off:

a) cut and pasting this into the pages I want to use this
b) making a TurboGears widget
c) using one or more xi:includes
d) something else

This is complicated by the fact that some of the pages will be using
jquery (loaded by the Google js api) for other stuff, and some won't.
Obviously I don't want to load anything twicebut maybe the Google
js api is smart enough not too...)

Also some pages will have some other stuff that needs to go into the $
().ready part.

I'm obviously not (yet) a javascript expert... :(

Any thoughts?

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?hl=en
-~--~~~~--~~--~--~---



[TurboGears] PaginateDataGrid and sorting on big table.

2008-09-20 Thread [EMAIL PROTECTED]

Hello,
i am using TG 1.06 with SQLAchemy and Elixir.
i have a method that looks like this:

class Stocksview(controllers.Controller):
import turbogears as tg
from turbogears import controllers, expose, flash, validate,
validators,paginate,url
from turbogears.widgets import
PaginateDataGrid,DataGrid,SingleSelectField,TextField
from turbogears import identity, redirect
from cherrypy import request, response
from cccorder.model.stock import *
from cccorder.model.user import *
from cccorder.model.lib.struct import *
from cccorder.model.lib.config import *

@expose(template=cccorder.templates.backoffice.stocksview.list)
@paginate('data' , limit=25, default_order='code')
def index(self,search=None,search_by=None):


if search_by =='code' and search:
 data = Stocks.query.filter(Stocks.code.like(search
+'%')).all()
elif search_by =='group' and search:
data = Stocks.query.filter(Stocks.group == search).all()
elif search_by =='name' and search:
 data = Stocks.query.filter(Stocks.name.like('%' + search
+'%')).all()
else:
data=Stocks.query.all()


grid = PaginateDataGrid(
fields=[
DataGrid.Column('code','code','Code',
options=dict(sortable=True)),
DataGrid.Column('group','group' , 'Group' ,
options=dict(sortable=True)),
DataGrid.Column('name','name' , 'Name' ,
options=dict(sortable=True)),
DataGrid.Column('stock','stock' , 'Stock' ,
options=dict(sortable=True)),
DataGrid.Column('v_price','v_price' , 'Price' ,
options=dict(sortable=True)),
]
)

search_by_o=[
('code','Code'),
('group','Group'),
('name','Name')
]

 
Wsearch_by=SingleSelectField('search_by',options=search_by_o,default=search_by)
Wsearch=TextField(search,default=search)


return
dict(data=data,grid=grid,Wsearch=Wsearch,Wsearch_by=Wsearch_by)


Here is the interesting part, if a search is applied and returns less
then 1000 rows the sorting is working.
data=Stocks.query.all() returns around 2000 rows and the sorting is
not working.
Any ideas why its happing and how i can fix it?

Thanks,
Timor A.



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



[TurboGears] Re: PaginateDataGrid and sorting on big table.

2008-09-20 Thread [EMAIL PROTECTED]

Thanks,
i guess i missed that part in the tutorial.

Timor A.

On Sep 20, 5:34 pm, Florent Aide [EMAIL PROTECTED] wrote:
 On Sat, Sep 20, 2008 at 5:03 PM, [EMAIL PROTECTED]

 [EMAIL PROTECTED] wrote:

  Hello,
  i am using TG 1.06 with SQLAchemy and Elixir.
  i have a method that looks like this:
  Here is the interesting part, if a search is applied and returns less
  then 1000 rows the sorting is working.
  data=Stocks.query.all() returns around 2000 rows and the sorting is
  not working.
  Any ideas why its happing and how i can fix it?

 not sure it will change anything in your case but really you should
 not return query.all() in your dict but just query. The paginate code
 will handle the query object way better that the list resulting from
 your query.all() _and_ doing .all() defeats the whole purpose of the
 pagination anyway...

 The only reason why I sometimes use query.all() is when I'm working on
 MS SQL2000 because sql2k does not support offsets, appart from this I
 always work with query objects and result proxies from SA, never full
 result lists.

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



[TurboGears] weird tg.url behavior - does not return absolute path

2008-09-18 Thread [EMAIL PROTECTED]

Hello,
i have the following structure:

controllers
controllers/root.py
controllers/backoffice/backoffice.py
controllers/backoffice/backorder.py

in root.py:
from backoffice.backoffice import Backoffice

class Root(controllers.RootController):

backoffice=Backoffice()


in controllers/backoffice/backoffice.py
from backorder import *

class Backoffice(controllers.RootController):
backorder=Backorder()
@expose('')
def index(self):
return dict(x=tg.url('/'))


the result is {tg_flash: null, x: /backoffice/}

isn't should be / ?
or do i miss something here ?


another thing; paginate with datagrid in  /backoffice/backorde/indexr
creates the following urls:
/backoffice/backorder/backoffice/backorder/?..
but only with the '' and '' links,  the urls in page numbers are
fine...

anyone have an idea what i'm doing wrong?


in config/app.cfg
server.webpath = /

* TurboGears 1.0.6
* TurboKid 1.0.4
* TurboJson 1.1.4
* TurboCheetah 1.0
* simplejson 1.9.2
* setuptools 0.6c8
* RuleDispatch 0.5a1.dev-r2506
* PasteScript 1.6.3
* FormEncode 1.0.1
* DecoratorTools 1.7
* configobj 4.5.2
* CherryPy 2.3.0
* Cheetah 2.0.1
* PasteDeploy 1.3.2
* Paste 1.7.1


Thank you in advance,
Timor A.







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



[TurboGears] Re: weird tg.url behavior - does not return absolute path

2008-09-18 Thread [EMAIL PROTECTED]

ohh emm.. i am speechless and red... :)

but thanks a lot that was the problem!

Timor A.

On Sep 18, 3:30 pm, Florent Aide [EMAIL PROTECTED] wrote:
 On 9/18/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:



   Hello,
   i have the following structure:

   controllers
   controllers/root.py
   controllers/backoffice/backoffice.py
   controllers/backoffice/backorder.py

   in root.py:
   from backoffice.backoffice import Backoffice

   class Root(controllers.RootController):

      backoffice=Backoffice()

 This is you root controller and you are mounting Backoffice at the
 backoffice mountpoint at the moment you instanciate the Backoffice
 controller



   in controllers/backoffice/backoffice.py
   from backorder import *

   class Backoffice(controllers.RootController):
      backorder=Backorder()
      @expose('')
      def index(self):
          return dict(x=tg.url('/'))

 tg.url('/') is fooled because you declared Backoffice as a
 RootController... but it is not really a root controller since you
 mounted it under another root controller...

 So you should declare Backoffice as a simple controllers.Controller
 and tg.url will be able to really see the Truth :)

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



[TurboGears] Re: Kudos to Mark Ramm...

2008-09-17 Thread [EMAIL PROTECTED]

On Sep 16, 9:39 pm, Jorge Vargas [EMAIL PROTECTED] wrote:
 But back to the subject, nice talk. I saw a little hostility from the
 first question :) Other than that it turned out really good.

Who was the guy that asked the first question? One of the lead
developers of Django I assume?

Mark, how did they know to ask you?  I mean it was a great choice---
but a weird one.  Or did you volunteer?

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



[TurboGears] Re: mochikit and jquery unhappiness

2008-09-16 Thread [EMAIL PROTECTED]

On Sep 16, 2:27 am, scarypants [EMAIL PROTECTED] wrote:
 Obviously
 not a good thing for the sake of compatibility and maintainability
 with future releases.

Future releases of mochikit? ;)

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



[TurboGears] Kudos to Mark Ramm...

2008-09-16 Thread [EMAIL PROTECTED]

I spent last night watching Mark's keynote at Djangocon.

http://www.youtube.com/watch?v=fipFKyW2FA4feature=PlayListp=D415FAF806EC47A1index=12

I thought it was a great speech!  It really nailed my frustration at
the lost opportunity of Zope---and my fears about Django.

It also made me feel much better about the path Turbogears is taking.
Hopefully the speech will lead to Django decoupling some of its
elements, making Python web development better for everyone.

Mark was engaging throughout.  He really represented the Turbogears
community well.  I recommend everyone watch it.

Are there any other speeches from Djangocon that would be interesting
to me as a Turbogears developer?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Mingling sqlalchemy and sqlobject...

2008-09-05 Thread [EMAIL PROTECTED]

So yesterday I finally took the plunge and converted a stand alone
utility used to support my site to sqlalchemy.

Today I'd like to use sqlalchemy for a new feature I'm writing in my
core controller.

Is this something I can do while continuing to use sqlobject at the
same time?

Obviously I'll try to avoid intermingling writing to the same row from
both at the same time.

But other than that am I likely to run into caching issues?  Or what
issues might I run into? How can I minimize them?

My program is little complex to switch from sqlalchemy to sqlobject
all in one fell swoop.  So if I could use both for a while, and slowly
refactor the code to sqlalchemy that would be nice.

(Side note:  I'm very impressed by the level of support Michael Bayer
pays to the sqlalchemy mailing list.)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: Gebruiken van Eclipse

2008-09-05 Thread [EMAIL PROTECTED]

If you haven't looked at Komodo Edit, you might want to.  It's pretty
awesome, and it's free.

-Sam

On Sep 5, 8:13 am, Cecil Westerhof [EMAIL PROTECTED] wrote:
 I was told it was a good idea to use Eclipse as enviroment to develop
 applications. I have not used it yet. Has anyone experience with using
 Eclipse to develop Python applications for TG with it? Is it a good
 idea to work with it?
 The idea is that Eclipse is used in a lot of companies and that when I
 use it for developing Python applications, it is easy to use it when
 you need to use it for Java or C(++) programs. But when it is hard to
 use, then it is not so good an idea. ;-}
 At the moment I use Kate/Kdevelop.

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



[TurboGears] Seeing the same page my user sees...

2008-09-05 Thread [EMAIL PROTECTED]

I'm generating some pretty complex pages out of my database.

I've gone ahead and added a suggestion box at the bottom of each
generated page.  The box is a simple text field where the user can
type in a suggestion or problem they are having with the current page.

If they fill the suggestion box out then the suggestion gets sent to
me and recorded in the database.

I'd like to be able to see the exact page that they are seeing.
Because of the dynamic nature of the database/application---just
recording the url of the page won't be enough.

Any suggestions as to how to do this?  Can I somehow grab the
generated genshi code and save it to disk?  (Purging the pages later
where no one used the suggestion box?)

Or should I put the important part of the page in a div?  And have
jquery grab the div and send it back to me?

Any suggestions welcome.

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?hl=en
-~--~~~~--~~--~--~---



[tg-trunk] Re: Mercurial for TG2 discussion

2008-09-03 Thread [EMAIL PROTECTED]

 Does anyone have a migration plan?  I mean, a series of commands and
 configurations that would be run to migrate our repository?

Not yet.   I brought up the question before comming up with a detailed
plan because I didn't want to waste time on a detailed plan if we
weren't really going to make a change.

 I did the change on one project here, but I had to use hgimportsvn to be able
 to get everything and the initial process seemed to be really slow (this
 project only had 2700 revisions).

Yea, that is my experience too, it's pulling every changeset, and
creating a new repository.   But at least it only has to be done
once.  And it supports pulling just one section of the svn tree out
into it's own repository, with just the history for that branch.

 Also, for how long will we keep a read-only SVN repository (hgpullsvn can help
 keeping it up to date)?  Because if we have branches and work being done on
 SVN (and don't have the same plan that TG followed on the main repository)
 we don't necessarily need / can / want to commit before the move.  Having the
 read-only repository would help creating patches to apply over a new checkout
 using mercurial, when the time constraint allows the developer / company /
 team / whatever to do that (i.e., if I am in the middle of a certification /
 validation process I can't change the repository immediately).

I'm not 100% sure I follow you here.   What is your suggestion?   I
think it makes sense to maintain a svn repository that has reasonably
current code for several months at least.   The question is how often
to merge changes over to that repository, and how fine-grained the
history of that repository needs to be.   Would it be good enough to
just do a svn checkin nightly from the current mercurial tip? --
perferably only if all the tests pass.  ;)

Or should we try to automate it so every changeset is pushed over
separately?

 I know all this sounds too corporate, but that's the kind of planning I do
 everyday for a bank and for companies in the human health market...

 Can we get the migration done using a batch?  I mean, one big script that woul
 dbe run to migrate our official repository, including users and etc.?  If it
 is too hard, maybe part automated and part explaining how to change commands
 to accomplish the whole change.

Well the user bit would be the hardest, and I don't think it's too
bad, even if we have to do some manual bits there.  It's not like we
have hundreds of active commiters.

 This would allow the change for personal repositories to follow the same
 process in the future...  (Also extremely useful to document things and for
 widget authors that will want to migrate.)

Yea, we should definitely document how the conversion is done, and how
people can move their TG related projects to our new hg+trac system
when they want to make that change.

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



[tg-trunk] Re: ToscaWidgets Tutorial Project Code

2008-09-03 Thread [EMAIL PROTECTED]

Thanks Sanjiv!

Worked for me too.

On Sep 3, 12:43 pm, Sanjiv [EMAIL PROTECTED] wrote:
 The ToscaWidgets FormsTutorial under project_code has now been changed
 work with tg2a4 and it works fine for me. Can someone else confirm too
 please?

 Regards
 Sanjiv

 On Sep 3, 5:30 am, Ademan [EMAIL PROTECTED] wrote:

  The project code provided doesn't work with alpha 4.  A little bit of
  googling made it pretty evident that tg.middleware had been first
  deprecated, then removed altogether, and that was the culprit.  So
  what needs to be done for the tutorial, is have it setup on top of a
  new quickstart, this should be fairly trivial, and I'll do it myself
  and post a ticket if that indeed fixes *everything* but i have my
  suspicions there could be more lurking around...

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



[tg-trunk] Re: Getting a TG2 Development Environment

2008-09-02 Thread [EMAIL PROTECTED]

 My problem is I've found 3 different sets of instructions:

 1)http://turbogears.org/2.0/docs/main/DownloadInstall.html#installing-t...
 2)http://turbogears.org/2.0/docs/main/Contributing.html
 3) The INSTALL.txt and README.txt files in trunk/

 My feeling is that #1 is the most current/correct approach.  Is this
 true?

Yea, that's the newest, though I think that the development version
install instructions should be moved to Contributing as the new
canonical location, and it along with INSTALL and README shoudl point
to the Contributing doc.

 I followed #1 and discovered in docs/README.txt that I needed to
 install Sphinx.  After I did that, my attempt to `make html` failed
 looking for pysvn.

Yea, pysvn is require for the wiki20 doc, which pulls source code out
of a project repository in svn.

It's not technically a requirement for the development of TurboGears,
but it is a requirement for building the docs.

 I found that extension and got it installed, and
 now the docs build fails on a memcache exception from Beaker (sorry,
 the traceback is on my OS/X machine at home - I'll add it to the
 thread later if anyone thinks it's important).  So, I'm wondering if
 I'm on the right track at all?

I think they may have fixed that traceback in Beaker now, but you can
avoid it by removing the autodoc of Beaker from your doc build, or by
patching Beaker to avoid that import (which is what I've done
locally).   I think that sphinx trunk may have fixed this problem, but
I have not tested it yet.

 If I can get this sorted out, I'll happily submit patches to
 whichever of the docs above need to be changed to bring things into
 sync with reality.  Or in the spirit of DRY, make them all point to a
 canonical spot in the docs.

Thanks.   If there's anything more I can do to help, let me know.

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



[tg-trunk] Re: TurboGears-1.5 and transactions

2008-08-29 Thread [EMAIL PROTECTED]



On Aug 24, 3:41 pm, dbrattli [EMAIL PROTECTED] wrote:
 Hi, i had an accident in a bike race yesterday, and cannot help out
 for some days/weeks. But tools are good since they don't affect the
 whole app as wsgi!?

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



[tg-trunk] Re: tg.authorization for TG2?

2008-08-29 Thread [EMAIL PROTECTED]


 I agree, so I think we should leave tg.ext.repoze.who for TG 1.9.x (also
 leaving it in maintenance mode) and start working on tg.authorize for it to
 work in TG2 final. Does this sound sensible?

Well, I'd love it if we could have a stable API for authentication/
authorizaiton stuff sooner rather than later, but if the timeline for
getting this done is such that we can't get this done in the next week
or two, I think this is what we have to do.

--Mark Ramm

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



[TurboGears] Javascript less than in a genshi template revisited...

2008-08-19 Thread [EMAIL PROTECTED]

This thread is closed:
http://groups.google.com/group/turbogears/browse_thread/thread/5bcd00c5402e2bb0/dd3ec6914f3f23bb

But the basic issue is that genshi won't allow a less than in
javascript.

Has anyone figured out how to solve this without resorting to a static
javscript file?

(I need to do variable substitution in my javascript code.)

I tried CDATA---no dice.  It doesn't pass anything along in the cdata
section.  It seems to behave the same as !--! would.

And I tired lt; --- but as the original thread states it sends that
straight through and javascript sees it as a lt;

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



[TurboGears] cannot display string with new line (\n) on my webpage

2008-08-18 Thread [EMAIL PROTECTED]

if I have a string such as:

menu = 
Welcome to Network Assistant

1)Connect
2)Show clock
3)Show ip int brief
4)Exit



I cannot seem to find out how to display this on my website with the
new lines, this is how it will display (all on the one line):

Welcome to AAPT Network Assistant  1)Connect
2)Show clock 3)Show ip int brief 4)Exit 

'
My controller file has:

@expose(template=networkassistant.templates.test)
def test(self):
#content = publish_parts(mytelnet.getDetails(),
writer_name=html)['html_body']
content = mytelnet.getDetails()
return dict(message=content)

How can I get the webpage to display with the lines as shown at the
top?

Any help would be greatly appreciated.

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



[tg-trunk] Re: repoze.who configuration

2008-07-21 Thread [EMAIL PROTECTED]

Diez, could you take a look at what's in TG2's config object now.  I
think it do a better job of providing the hooks you need.   And where
it doesn't it should be easy enough to overide the methods on the
config object that setup authorization stuff.

On Jul 10, 5:38 am, Diez B. Roggisch [EMAIL PROTECTED] wrote:
 On Wednesday 09 July 2008 17:06:56 percious wrote:

  They can be found here:
 http://svn.turbogears.org/projects/tg.devtools/trunk/devtools/templat...
 bogears/+package+/config/app_cfg.py_tmpl

  I can add the hooks for the elements you desire.  Can you open a
  ticket trac for this?

 http://trac.turbogears.org/ticket/1897

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



[TurboGears] Re: Turbo Gears or Django?

2008-07-17 Thread [EMAIL PROTECTED]

I second that this would be useful from an evangelisation point of
view.  To be really meaningful (believable) it would need to have a
specific date attached.  I.e. the turbogears leadership is committed
to supporting TG1 until at least July 1, 2011.

On Jul 16, 11:33 pm, Felix Schwarz [EMAIL PROTECTED] wrote:
 PS: I think we should prepare a formal announcement/policy on that so that
 potential users must not be afraid of starting with TG1 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?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Best practices for logging visits/hits/etc.

2008-07-17 Thread [EMAIL PROTECTED]

I'm about to start implementing logging for visits.  I'll be logging
the usual:  What people are doing, when they do it, etc.

Any thoughts on the best way to do this?  I'm torn betwen doing
logging in the database or using the python logger.  Also I understand
that I can use apache for logging.  And cherrypy has its own logger as
well?

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?hl=en
-~--~~~~--~~--~--~---



[tg-trunk] Re: Config rewrite again

2008-07-15 Thread [EMAIL PROTECTED]

Oh, I will mention that this is intended to be backwards compatible,
with the old middleware.py and environment.py functions in tg, and
those will be depricated in preiview 2 and removed in preview 3 or 4.
Moving from the preview1 system to this one should just be a matter of
a couple of one line changes in middleware.py

--Mark Ramm

On Jul 15, 6:47 pm, Mark Ramm [EMAIL PROTECTED] wrote:
 I had a little bout of embarrassment driven development this evening
 when trying to document the config system of tg2, and the TG2
 configuration system has been largely revamped.

 I was trying to document the interactions between the envinronment and
 middleware factories, the base_config object and the .ini files and I
 reallized that I don't want to have to expain anything that
 complicated.   And at the same time a couple of the people who are
 actually using TG2 in real projects ran up against limitations of the
 existing system that were not so nice to work around.

 There are several constraints that we have to work within:

 1) We need to be compatable with pylons, so all the pylons tools like
 paster shell still work
 2) We need to work with entry points and the standard paster wsgi system
 3) We need have something that allows for one TG2 app to live inside of 
 another

 I think the new system fullfils these goals, and is reasonably easy to
 use and understand.   I'm hoping to finalize it and write a few docs
 this evening, but basically rather than having config stuff spread our
 across three modules inside of tg, everything is now encased in an
 AppConfig class, which stores declarative data about the
 configuration, sets up sane defaults where possible, and provides
 factories for the two key pylons functions load_environment and
 make_app.

 Both load_environment and make_app are broken into pieces which can be
 overridden at config object instantiation time, or subclassed (for
 people who are instantiating lots of similar TG apps).

 I'm not totally happy with it (AppConfig is a bigger class than I'd
 like) but I think that it's a pretty good comprimize between
 flexibility and ease of use, and I'm not embarased to document it any
 more.

 Anyway, feel free to take a look and let me know what you think:

 http://paste.turbogears.org/paste/3221

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



[tg-trunk] Re: tg2 source installation

2008-07-14 Thread [EMAIL PROTECTED]

Hi,

I add the dependency before I saw this post.

I met similar problem as Helio Pereira reported while setup.py
develop the current tg2 trunk.

So I have to add these dependencies to make the install behavior
exactly the same as the doc said.

I'm all for get rid of these dependencies,
but I've to checked in [4950] to keep the trunk installation work
smoothly at present stage.

Maybe wrap(by try..except) the genshi/toscawidget import in tg2 trunk
could eliminate these dependencies?

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



[TurboGears] Python 2.6/3.0 support for the 1.0 series...

2008-07-12 Thread [EMAIL PROTECTED]

With the betas out for both of these new versions, I thought I'd raise
the question of which will be supported with TG 1.0.x.

I assume there will at least be support for python 2.6, right?  :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Python 2.6/3.0 support for the 1.0 series...

2008-07-12 Thread [EMAIL PROTECTED]

With the betas out for both of these new versions, I thought I'd raise
the question of which will be supported with TG 1.0.x.

I assume there will at least be support for python 2.6, right?  :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[tg-trunk] How to configure mysql database in dev.cfg

2008-07-09 Thread [EMAIL PROTECTED]

Hi there,
  May i get some help on configuring the MYSQL database in dev.cfg. i
finding hard time to configure it as i don't understand the things
such as

-username password
-hostname
-port
-databasename

can someone please show me a step by step.

how am i able to find the host name and the port as well as the
database name.

Best Regards
Joseph

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



[TurboGears] How to configure mysql database in dev.cfg

2008-07-09 Thread [EMAIL PROTECTED]

Hi there,
  May i get some help on configuring the MYSQL database in dev.cfg. i
finding hard time to configure it as i don't understand the things
such as

-username password
-hostname
-port
-databasename

can someone please show me a step by step.

how am i able to find the host name and the port as well as the
database name.

Best Regards
Joseph

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



[TurboGears] Re: My new redirect...

2008-07-09 Thread [EMAIL PROTECTED]

I haven't tried mod_wsgi either.  Right now this is working fine, and
I have about two hundred hours of coding in front of me with only 100
hours to do them.  :)

Here's an interesting point that might be behind this, sorry for not
volunteering earlier, but I just thought of it.

I reach my server using a name that I defined in /etc/hosts of the
local machine.  I don't reach it based on a canonical name coming from
dns.  I haven't yet bought a domain name for the site.  I suspect that
this might have something to do with it.  If someone wants, maybe they
could try this out.

But again, for now I'm fine.  I'm not recommending that you guys patch
turbogears or anything, especially if I'm the only one having this
problem.  I'm just sharing it because people asked, and someone some
day might have the same problem.

Thanks for all the suggestions on monkeypatching.  I've basically
already done something similar:  renamed the file, copied it to my
local directory, and only import the one function, redirect.
Everything else I import from the official file.

Thanks again...

On Jul 9, 3:15 pm, Jorge Godoy [EMAIL PROTECTED] wrote:
 On Wednesday 09 July 2008 11:45:34 Lukasz Szybalski wrote:



  Does this redirection problem for https happens on both setups?
  ProxyPassReservers and mod_Wsgi?

 I don't have this problem here.  I haven't tried mod_wsgi so far...  So it
 must be something related to his setup.

 We had problems with old versions of TG and they were solved a long time ago
 (almost two years ago).

 --
 Jorge Godoy      [EMAIL PROTECTED]

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



[TurboGears] Re: Why two controllers.py files?

2008-07-09 Thread [EMAIL PROTECTED]

On Jul 9, 3:47 am, Marco Mariani [EMAIL PROTECTED] wrote:
  I could swear that the first line of the quickstarted controllers.py is:
  from turbogears import controllers, expose, flash

 Yes, the quickstarted controllers.py should not import another module
 named controllers. This may be a bit confusing, if it does.

Yep.  That's the point I was trying to make.  :)




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



[tg-trunk] Re: tgcrud vs TurboGears 1.5dev

2008-07-08 Thread [EMAIL PROTECTED]

Mmm, I'll release 1.0.2 soon to fix that :)

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



[TurboGears] Why two controllers.py files?

2008-07-08 Thread [EMAIL PROTECTED]

Is there a good reason that we reuse this filename?  It seems
needlessly confusing.  And today I wanted to make some changes to
TurboGears controllers.py.  And I didn't want to:

a) have to be root to do so or
b) go through the hassle of renaming it

I just wanted to copy it over to my local directory, and edit it
there.  (Perhaps adjusting an import statement or two).

Sure having two files (this one and the one created by tg-admin
quickstart) with the same name isn't tremendously confusing.  But we
should do whatever we can to reduce confusion.

So, is there a good reason for this?

If not, can I suggest that we rename the turbogears controllers.py
something like tg_controllers.py in the future?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: Why two controllers.py files?

2008-07-08 Thread [EMAIL PROTECTED]

Yes.  TurboGears controllers.py and the controllers.py made by the
quickstart.

On Jul 8, 2:45 am, Diez B. Roggisch [EMAIL PROTECTED] wrote:
 On Tuesday 08 July 2008 09:06:27 [EMAIL PROTECTED] wrote:



  Is there a good reason that we reuse this filename?  It seems
  needlessly confusing.  And today I wanted to make some changes to
  TurboGears controllers.py.  And I didn't want to:

  a) have to be root to do so or
  b) go through the hassle of renaming it

  I just wanted to copy it over to my local directory, and edit it
  there.  (Perhaps adjusting an import statement or two).

  Sure having two files (this one and the one created by tg-admin
  quickstart) with the same name isn't tremendously confusing.  But we
  should do whatever we can to reduce confusion.

  So, is there a good reason for this?

  If not, can I suggest that we rename the turbogears controllers.py
  something like tg_controllers.py in the future?

 What controllers.py are you talking about? turbogears.controllers?

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



[TurboGears] Re: Identity Management With IP address

2008-07-08 Thread [EMAIL PROTECTED]


  I need to restrict the users in a local network based on their IP
 address.
 The TurboGears identity provides identity.from_host('ip address')
 method for this.

 But,  cannot hard code all the IP addresses within the from_host()
 function.

 I am storing all the allowed IP addresses inside a look up table. So,
 I need to provide dynamic data within the from_host() function like
 from_host(ipaddresslist)

You can use the

identity.from_any_host()

function.

Cheers,

Christopher

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



[TurboGears] Re: Why two controllers.py files?

2008-07-08 Thread [EMAIL PROTECTED]

Well by posting the code that I'm changing in this thread, we risk
mixing two different conversations.

Anyway, it's not the largest deal in the whole world I admit.

But since no one has come up with a good reason for having files with
the same name (not the same namespace, just the same name),  I standy-
by my original assertion that it's an unnecessary confusion.

It's an unnecessary confusion for many reasons.  Including many
editors showing only controllers.py on each tab.  And it makes
quickly glancing at stack traces more difficult.  Oh, there's a
problem in controllers.py...wait no, that's not my controllers.py,
that's turbogears!

But in the name of incremental improvement, I strongly suggest that in
1.5 or more likely 2.0, one of the files be renamed.

Thanks!

On Jul 8, 3:57 am, Jorge Godoy [EMAIL PROTECTED] wrote:
 On Tuesday 08 July 2008 07:40:56 [EMAIL PROTECTED] wrote:

  Yes.  TurboGears controllers.py and the controllers.py made by the
  quickstart.

 Why are you willing to modify turbogears.controllers?  You can monkeypatch
 it...

 And, just to add to your confusion, you don't need a controllers.py inside
 your project.  You need a controllers module and it can be one directory with
 a __init__.py in it.  In fact, the tg-big template already creates it as a
 directory.

 --
 Jorge Godoy      [EMAIL PROTECTED]

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



[TurboGears] Re: Why two controllers.py files?

2008-07-08 Thread [EMAIL PROTECTED]

I don't...I never do a from anything import *.

Heck, I don't even like importing individual functions with from.
Although I do it because that's the way the quickstart was setup.  But
for my own coding I always do everything explicitly.

On Jul 8, 8:20 am, Dean Landolt [EMAIL PROTECTED] wrote:
  turbogears/controllers.py and youpackage/controller.py are two
  independent modules in different Python packages and have a completely
  different purpose. Having modules with the same basename in different
  packages is general practice in Python.

 This sounds like it might be some confusion do to a from turbogears import *

 If this is the case, then just don't import * and you'll have a lot less
 problems with modules in different packages having the same name.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] My new redirect...

2008-07-08 Thread [EMAIL PROTECTED]

Well in another thread people were interested in what I had to change
in TurboGears controllers.py

I'm posting it under this thread, so that the issues can remain
separate.

After spending countless hours trying to get Apache configured
properly so that it wouldn't drop from https:// to http:// on
redirects, I found that I could solve this problem this way instead.

(And yes, I have ProxyPassReverse setup as recommended here and on the
TG website...no joy!  :)

I was sort of going to wait a few more days before posting this to
make sure it really worked perfectly, but it seems to work.  Now when
I'm in https and there's a redirect it stays in https...

def redirect(redirect_path, redirect_params=None, **kw):
front_part = None
if redirect_path.find('://') == -1 and not
redirect_path.startswith('/'):
front_part = re.compile('r(.*?://.*/)')
elif redirect_path.find('://') == -1:
front_part = re.compile(r'(.*?://.*?/)')
if front_part:
m = front_part.match(request.headers.get(Referer, /))
redirect_path = m.group(1) + redirect_path
raise cherrypy.HTTPRedirect(
url(tgpath=redirect_path,
tgparams=redirect_params, **kw))
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: Why two controllers.py files?

2008-07-08 Thread [EMAIL PROTECTED]

On Jul 8, 4:41 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:

 Stacktraces put out the whole path. How do you happen to confuse

 turbogears/controllers.py

 with

 myproject/controllers.py

 ?

If I wanted to spend 40 seconds reading the stack trace I wouldn't.

But, hey I don't...I want spend ten seconds glancing at it.

This isn't about __init__.py

This is about being friendly and causing less confusion to other
Turbogears users in this one particular case.  Not developers, not
experts.  Realize that you as a TG developer can't easily understand
what confuses your users.

I realize we are verging off into yellow bike shed territory, but this
isn't about two python modules having the same name.

This is about a project giving the same name to a quickstarted created
file and one of its core files.  And not a magic name, like
__init__.py

You can't tell me this is normal.  I bet you can't find any other
python project where it creates a python file for the user to edit
with the same name as one of the core files used by the
project.  :)

Let's say that they already had two different names.  What would you
argue if you wanted them to be the same?




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



[TurboGears] Re: My new redirect...

2008-07-08 Thread [EMAIL PROTECTED]

Yeah...I believe you.

But I still can't get it to work.

And this seems to.  :)

I'd rather spend my time modifying python code, then trying to debug
apache.


On Jul 8, 5:47 pm, Jorge Godoy [EMAIL PROTECTED] wrote:
 On Tuesday 08 July 2008 18:36:06 [EMAIL PROTECTED] wrote:



  After spending countless hours trying to get Apache configured
  properly so that it wouldn't drop from https:// to http:// on
  redirects, I found that I could solve this problem this way instead.

  (And yes, I have ProxyPassReverse setup as recommended here and on the
  TG website...no joy!  :)

 That does the trick for all my projects.  Apache 2.2 + latest released TG from
 1.0 branch.

 I never had to change anything on TG's code to have this working.  From TG's
 perspective there is no trick and for Apache I just use the standard mod_proxy
 configuration.

 --
 Jorge Godoy      [EMAIL PROTECTED]

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



[tg-trunk] Re: Controller differences between tg1 and 2

2008-07-07 Thread [EMAIL PROTECTED]

On Jul 7, 11:05 am, Christoph Zwerschke [EMAIL PROTECTED] wrote:
 Well, it's still one name, one value. Only that the value is a list.
 I think multiple select or checkbox lists are not that seldom and it's
 most obvious to send a list in such cases.

+= 1

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



[TurboGears] Re: using Widgets textfield

2008-07-06 Thread [EMAIL PROTECTED]

i had tried to write the code. Below is the links of my code.
http://paste.turbogears.org/paste/3079

There is something i need to ask:
1. Where should i write the sum formula

the problem is i don't know how can i total the value of  num + num 2
and display it in a message box. Most of the code i i learn from the
remote form widget example. if you can help me out will be good. As i
need to submit my task tomorrow

On Jul 4, 11:33 pm, Christopher Arndt [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] schrieb:

  Hi, i am newbie to Turbogears. I has tried to read up the tutorial on
  Widgets but i have no idea how to implement it. below is the coding
  that i wrote for the controller.

 ??? I see no code in you mail. Anyway, it's better to paste you code 
 athttp://paste.turbogears.org/and post the URL here.

  the thing that i confuse is how am i
  going to write, for examples i have controller, model, app, and etc

 Then I suggest you go through the tutorial here first:

 http://docs.turbogears.org/1.0/Wiki20/Page1

 and then check out the widgets form tutorial:

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

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



[TurboGears] How to create a form that do the sum of two integer input

2008-07-06 Thread [EMAIL PROTECTED]


Hi all,
  I need help on how am i able to create a from that accept two input
in a textfield and sum the two inputs and then display the output in a
message box. I has write the code but i don't know where should i
write the sum formula, whether is it in the controller or in the
templates.
Some of my coding, i use from the remote form widget example. Here is
the links to my code.

http://paste.turbogears.org/paste/3079

Thank for teaching me.

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



[TurboGears] where should i put the sum formula?

2008-07-06 Thread [EMAIL PROTECTED]

Hi all,
  I need help on how am i able to create a from that accept two input
in a textfield and sum the two inputs and then display the output in a
message box. I has write the code but i don't know where should i
write the sum formula, whether is it in the controller or in the
templates.
Some of my coding, i use from the remote form widget example. Here is
the links to my code.

http://paste.turbogears.org/paste/3079

i has try to put the sum formula in controller but there is errors
saying that num1 or num2 is not define.  Please help me out

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



[TurboGears] how to create a form that do the sum of two input using widget.remote form

2008-07-06 Thread [EMAIL PROTECTED]

Hi all,
  I need help on how am i able to create a from that accept two input
in a textfield and sum the two inputs and then display the output in a
message box. I has write the code but i don't know where should i
write the sum formula, whether is it in the controller or in the
templates.
Some of my coding, i use from the remote form widget example. Here is
the links to my code.

http://paste.turbogears.org/paste/3079

i has try to put the sum formula in controller but there is errors
saying that num1 or num2 is not define.  Please help me out

Thank for teaching me.

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



[TurboGears] Re: How to create a form that do the sum of two integer input

2008-07-06 Thread [EMAIL PROTECTED]

what do you mean by  i should called them num and num2? mind to
elaborate. Thank
do you mind to show me the code. please

best regards,
Joseph

On Jul 7, 1:04 am, Christoph Zwerschke [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] schrieb:

  can you tell me where should i write the sum in the controller then.
  Please. i try to write sum = num1+num2 but it say that num1 and num2
  was not declare.please help me as tomorrow is my deadline

 Have a look at how you declared your input parameters. They should be
 called num1 and num2 if you want to address them with these names.

 Also, you should add a validate decorator converting them to integers.
 Have a look athttp://docs.turbogears.org/1.0/ValidateDecorator

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



[TurboGears] Re: How to create a form that do the sum of two integer input

2008-07-06 Thread [EMAIL PROTECTED]

i wrote num1= textfield()
   num2 = textfield()

is there a problem?

On Jul 7, 1:18 am, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 what do you mean by  i should called them num and num2? mind to
 elaborate. Thank
 do you mind to show me the code. please

 best regards,
 Joseph

 On Jul 7, 1:04 am, Christoph Zwerschke [EMAIL PROTECTED] wrote:

  [EMAIL PROTECTED] schrieb:

   can you tell me where should i write the sum in the controller then.
   Please. i try to write sum = num1+num2 but it say that num1 and num2
   was not declare.please help me as tomorrow is my deadline

  Have a look at how you declared your input parameters. They should be
  called num1 and num2 if you want to address them with these names.

  Also, you should add a validate decorator converting them to integers.
  Have a look athttp://docs.turbogears.org/1.0/ValidateDecorator

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



[TurboGears] Re: How to create a form that do the sum of two integer input

2008-07-06 Thread [EMAIL PROTECTED]

sir,
 do you mean the sum = num1 = num2 should be put at the def_do_total
line there

On Jul 7, 1:40 am, Christoph Zwerschke [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] schrieb:

  i wrote num1= textfield()
             num2 = textfield()

  is there a problem?

 No, this is ok, but these are not the input parameters of your
 controller. Have a look at the line starting with def do_total.

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



[TurboGears] Re: How to create a form that do the sum of two integer input

2008-07-06 Thread [EMAIL PROTECTED]

i have no idea which line should i wrote the formula in.

On Jul 7, 1:40 am, Christoph Zwerschke [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] schrieb:

  i wrote num1= textfield()
             num2 = textfield()

  is there a problem?

 No, this is ok, but these are not the input parameters of your
 controller. Have a look at the line starting with def do_total.

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



[TurboGears] Re: How to create a form that do the sum of two integer input

2008-07-06 Thread [EMAIL PROTECTED]

i don't understand what does the def do_total(self, kw**) do. i copy
this code from the widget browser code example. do you mind to explain
to me. What should i need to do just to make the sum work. Thank for
your guidance

On Jul 7, 1:40 am, Christoph Zwerschke [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] schrieb:

  i wrote num1= textfield()
             num2 = textfield()

  is there a problem?

 No, this is ok, but these are not the input parameters of your
 controller. Have a look at the line starting with def do_total.

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



[TurboGears] using Widgets textfield

2008-07-04 Thread [EMAIL PROTECTED]

create a simple web site that has a form,
the form contain 2 textboxes, and allow the user to key in 2 values to
get the sum of them.
The sum value of these 2 values are show up (messagebox) after you
click a button SUM. (you need to use javascript to do that).

Hi, i am newbie to Turbogears. I has tried to read up the tutorial on
Widgets but i have no idea how to implement it. below is the coding
that i wrote for the controller. the thing that i confuse is how am i
going to write, for examples i have controller, model, app, and etc

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



[TurboGears] Prepending a dollar sign to a variable in genshi.

2008-06-30 Thread [EMAIL PROTECTED]

I'd like to prepend a dollar sign to a variable in genshi.  (I used to
just add the $ sign to the price in python, but I've eliminated the
loop that goes through the data taken from the database in order to
speed things up).

The variable is ${a['price']} in genshi.  I tried the obvious $$
{a['price']} but no love.

Thanks!

P.S. I sort of remember once reading a solution to this, but I can't
find it anywhere.  One of the most annoying thigns about google is you
can't search characters like $ well.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] TG2 wiki20 tutorial mistake

2008-06-22 Thread [EMAIL PROTECTED]

I'm a newbie to python and TG

I followed the wiki20 tutorial, but error prompted during initializing
table. After some struggle, I found that in the Page class definition
it should be:
codedef __init__(self, pagename, data):/code
instead of
codedef __init__(pagename, data):/code

and in the initializeDB.py it should state:
codePage(Front Page, Initial data)
instead of
code
   page=Page()
   page.pagename=Front Page
   page.data=Initial data
/code

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



[TurboGears] Re: After logout if we press back button the pages are displaying

2008-06-22 Thread [EMAIL PROTECTED]

Hi
I think the problem is like this:
1)A user logged into the web site
2)User fills a Form in a web page
3)User logs out
4)User clicks the Back button of the browser
5)He sees the previous form with filled values!!!
6)If he refresh the page, it will redirect to a login page

If this is the problem, it must be due to browser caching, as said in
the earlier posts

PHP have solution like this:
[...preceding code...]

header( Expires: Mon, 20 Dec 1998 01:00:00 GMT );
header( Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT );
header( Cache-Control: no-cache, must-revalidate );
header( Pragma: no-cache );

?

html
[]

ASP.NET handles it like this:
Response.Cache.SetCacheability(HttpCacheability.NoCache)

I also looks for a solution in turbogears like this

I tried META HTTP-EQUIV=Pragma CONTENT=no-cache in the header
section of a kid template file.
But not sure about the output in every browsers.

DO ANYONE HAVE A SOLUTION?

On Jun 22, 10:27 pm, Christopher Arndt [EMAIL PROTECTED] wrote:
 lekshmi schrieb:

  How to disable caching from browser in turbogears or html??Because
  after log out i dont want my browser to display the pages used
  earlier.Please give me some code..

 The browser cache can not be controlled reliably from the server side.
 That's a fact of life for web programming.

 Ok, and here's some code:

 Vs lbh pna ernq guvf lbh'er fznegre guna V gubhtug.

 ;-) ;-)

 Chris

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



[TurboGears] Genshi 0.5 is out...

2008-06-19 Thread [EMAIL PROTECTED]

as of June 9th.

Here's the changelog:  http://genshi.edgewall.org/browser/tags/0.5.0/ChangeLog

Will we see this integrated into TurboGears 1.x soon?

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?hl=en
-~--~~~~--~~--~--~---



[TurboGears] PlotKit doubts (mouseover, line chart, label)

2008-06-18 Thread [EMAIL PROTECTED]

Hi All,
I am using Turbogears plotkit widget for drawing graph. But i am
facing some problem.

1. I want to display the value corresponding to each bar in a bar
 chart on mouseover. How can I do this. (In Plotkit_packed.js I found
 some functions corresponding to onmouseover and all, so I guess it is
 supported.).

 2. In Line chart how can I display a line only (I want to remove the
 shadow part appearing below the line)

 3. I want to display year wise data as a bar chart. For example,
years
 2008, 2009 as labels in the x axis and months inside the year 2008 as
 small markings(like that in a measuring scale) on the x-axis. I want
 the markings corresponding to months to intersect the x-axis and
 should be a bit above than that of years 2008, etc.

Regards,
sanjeet

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



[TurboGears] Turbogears plotkit widget doubts(mouseover,line,shouldFill)

2008-06-18 Thread [EMAIL PROTECTED]

Hi all,

I am using Turbogears plotkit widget for drawing graph. But i am
facing some problems in using the widget.

1. I want to display the value corresponding to each bar in a bar
chart on mouseover. How can I do this. (In Plotkit_packed.js I found
some functions corresponding to onmouseover and all, so I guess it is
supported.).

 2. In Line chart how can I display a line only (I want to remove the
shadow part appearing below the line)

 3. I want to display year wise data as a bar chart. For example,
years  2008, 2009 as labels in the x axis and months inside the year
2008 as small markings(like that in a measuring scale) on the x-axis.
I want the markings corresponding to months to intersect the x-axis
and
 should be a bit above than that of years 2008, etc.

4. I trying to use {shouldFill : false} but it is not working. So plz
tell me how can i this..

Regards,
sanjeet

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



[TurboGears] PlotKit doubts (mouseover, line chart, label)

2008-06-17 Thread [EMAIL PROTECTED]

Hi All,

1. I want to display the value corresponding to each bar in a bar
chart on mouseover. How can I do this. (In Plotkit_packed.js I found
some functions corresponding to onmouseover and all, so I guess it is
supported.).

2. In Line chart how can I display a line only (I want to remove the
shadow part appearing below the line)

3. I want to display year wise data as a bar chart. For example, years
2008, 2009 as labels in the x axis and months inside the year 2008 as
small markings(like that in a measuring scale) on the x-axis. I want
the markings corresponding to months to intersect the x-axis and
should be a bit above than that of years 2008, etc.

Regards
Sanjeet

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



[TurboGears] Subprocess keeps open my port so I can't restart my app.

2008-06-13 Thread [EMAIL PROTECTED]

There are a few things that the administrative part of my web site
needs to do.  One of them involves starting a completely separate
python program.  This separate program needs to run for 24 hours or
so.  But once this program is started it's completely independent.  It
never reports back to my Turbogears application.

Here's how I start it:

 subprocess.Popen(command_line, shell=True, stdout=fd,
stderr=subprocess.STDOUT)

where command_line is the name of the program and a few command line
parameters.

Now this works pretty well.  The subprocess continues after Turbogears
restarts itself (because I make a change in the code, or because I
restart it, etc.).

The problem is somehow or other the subprocess keeps the port open
that Turbogears was using.  So I get this message:

  File /usr/lib/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/
cherrypy/_cpwsgiserver.py, line 370, in start
raise socket.error, msg
error: (98, 'Address already in use')

How can I start a process, and let it run after Turbogears has stopped
without it blocking the port Turbogears was using?  The subprocess has
no reason to block said port.  It does nothing with it.

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?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: Turbogears Application do not respond or exit without any error

2008-06-13 Thread [EMAIL PROTECTED]

First given  the amount of data cherryp likes to spew on the console,
I'd skip the  when starting my app.

But to your real problemyou need to install Myghty.  Are you using
it with your sample app?  If not, it's weird that it wants it.  But
try this in either case:

sudo easy_install -i Myghty

If that doesn't work try playing with the parameters to easy_install,
or just install Myghty from scratch.

Good luck!

On Jun 13, 9:12 am, Babu [EMAIL PROTECTED] wrote:
 I installed turbogears on and started a sample test project.  After I
 started the application I am getting the following message and the
 application exits

 python start-hello.py
 Babu:hello babu$ 2008-06-14 00:55:23,841 cherrypy.msg INFO CONFIG:
 Server parameters:
 2008-06-14 00:55:23,842 cherrypy.msg INFO CONFIG:
 server.environment: development
 2008-06-14 00:55:23,842 cherrypy.msg INFO CONFIG:
 server.log_to_screen: True
 2008-06-14 00:55:23,842 cherrypy.msg INFO CONFIG:   server.log_file:
 2008-06-14 00:55:23,842 cherrypy.msg INFO CONFIG:
 server.log_tracebacks: True
 2008-06-14 00:55:23,843 cherrypy.msg INFO CONFIG:
 server.log_request_headers: True
 2008-06-14 00:55:23,843 cherrypy.msg INFO CONFIG:
 server.protocol_version: HTTP/1.0
 2008-06-14 00:55:23,843 cherrypy.msg INFO CONFIG:
 server.socket_host:
 2008-06-14 00:55:23,843 cherrypy.msg INFO CONFIG:
 server.socket_port: 3000
 2008-06-14 00:55:23,844 cherrypy.msg INFO CONFIG:
 server.socket_file:
 2008-06-14 00:55:23,844 cherrypy.msg INFO CONFIG:
 server.reverse_dns: False
 2008-06-14 00:55:23,844 cherrypy.msg INFO CONFIG:
 server.socket_queue_size: 5
 2008-06-14 00:55:23,844 cherrypy.msg INFO CONFIG:
 server.thread_pool: 10
 Unhandled exception in thread started by bound method Server._start
 of cherrypy._cpserver.Server object at 0xc0c410
 Traceback (most recent call last):
   File /Library/Frameworks/Python.framework/Versions/2.5/lib/
 python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/cherrypy/
 _cpserver.py, line 78, in _start
     Engine._start(self)
   File /Library/Frameworks/Python.framework/Versions/2.5/lib/
 python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/cherrypy/
 _cpengine.py, line 110, in _start
     func()
   File /Library/Frameworks/Python.framework/Versions/2.5/lib/
 python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg/turbogears/
 startup.py, line 182, in startTurboGears
     view.load_engines()
   File /Library/Frameworks/Python.framework/Versions/2.5/lib/
 python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg/turbogears/view/
 base.py, line 371, in load_engines
     engine = entrypoint.load()
   File /Library/Frameworks/Python.framework/Versions/2.5/lib/
 python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py,
 line 1911, in load
   File /Library/Frameworks/Python.framework/Versions/2.5/lib/
 python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py,
 line 1924, in require
   File /Library/Frameworks/Python.framework/Versions/2.5/lib/
 python2.5/site-packages/setuptools-0.6c8-py2.5.egg/pkg_resources.py,
 line 524, in resolve
 pkg_resources.DistributionNotFound: Myghty=1.1
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
TurboGears group.
To post to this group, send email to turbogears@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: sql relatedjoint

2008-06-13 Thread [EMAIL PROTECTED]

You're almost there.  Just:

${datas.commenti.email} will give you the email field.


On Jun 13, 12:06 pm, luca72 [EMAIL PROTECTED] wrote:
 Hello

 I have this model:
 class Messaggi(SQLObject):
     import time
     now = time.ctime()
     messaggio = StringCol()
     utente = StringCol()
     data = StringCol(default=now)
     titolo = StringCol()
     commenti = RelatedJoin('Risposta')

 class Risposta(SQLObject):
     import time
     now = time.ctime()
     risposte=StringCol()
     email=StringCol()
     data=StringCol(default=now)
     nome=StringCol()
     tot = RelatedJoin('Messaggi')

 the controllers is this:

 @expose(template=blog.templates.welcome)
     def index(self):
         import time
         flash(hello)
         b = Messaggi.select()
         return dict(b=b)

 and in the kid template i have this

 div id=commenti

     span py:for=datas in b

           p class=Titolo${datas.titolo}/p

           p class=Data    Postato il ${datas.data} Dall'Utente: $
 {datas.utente}/p

           p class=Commento ${datas.messaggio}/p

           p class=Commenti ${datas.commenti}/p

           a href=/inserisci_commento?ID=${datas.id} Inserisci Un
 Commento/a

 the page in the ${datas.commenti} report this:

  Risposta 1 risposte='frefer' email='frefer' data='Fri Jun 13
 16:52...' nome='ferfre'

 my question how i can access to the single field of the datas.commenti
 to put it separately in the kid template

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



[TurboGears] Re: https dropped on (at least) one type of redirect...

2008-06-09 Thread [EMAIL PROTECTED]

Florent...

Thank you so much for the help.  I took the app.cfg from a recent
project and put it in this project.

I set identity.force_external_redirect to True...but no love.

I'm not sure what an identity redirect rule is ...did you mean
identity.failure_url?

I tried setting that to https://login ...it also didn't help.

But honestly I don't think this is an identity issue.  I'm already
logged in

Christoph...

I did the grep you suggested and found nothing...


Thanks

On Jun 8, 3:09 am, Florent Aide [EMAIL PROTECTED] wrote:
 This is a limitation of identity. There is a new configuration
 directive (app.cfg) that you can use. Here is the changelog entry for
 it:

 Added a new config option (app.cfg) which controls the kind of
 redirection the framework will raise in case of identity errors. By
 default TG used an internal CherryPy? redirect in such cases. But the
 problem was that if you tried to use a failure url such 
 ashttps://somewherethen CP raised a 404 error and that was all. Using
 this new system, you can activate _external_ redirects for identity
 errors by using the identity.force_external_redirect in app.cfg. This
 will permit redirecting your clients to any HTTPS url that is managed
 by an external apache or nginx rewrite rule.

 Mix this with an identity redirect url in https and you're done.

 There are some limitations to this scheme though, it uses GET to
 redirect the browser and thus if the identity exception occurs on a
 big form with a file upload or such, then the data will be to big for
 the GET and will fail. Appart from this limitation it works well.

 Cheers,
 Florent.

 On Sun, Jun 8, 2008 at 10:54 AM, Christoph Zwerschke [EMAIL PROTECTED] 
 wrote:

  [EMAIL PROTECTED] schrieb:
  Except for this one:
 https://www.example.com/admin --- this url redirects to
 http://www.example.com/admin/
  (notice the missing s for http and the added / on the end of the url)

  You should grep for admin in the complete httpd config, maybe there's
  an admin alias somewhere outside the virtualhost for https.

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



[TurboGears] Unicode is kicking my ass...

2008-06-09 Thread [EMAIL PROTECTED]

Really...and it ain't fun...

Here's the error message:
500 Internal error

The server encountered an unexpected condition which prevented it from
fulfilling the request.

Page handler: bound method Root.search of xstart.controllers.Root
object at 0x171add0
Traceback (most recent call last):
  File /usr/lib/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/
cherrypy/_cphttptools.py, line 121, in _run
self.main()
  File /usr/lib/python2.5/site-packages/CherryPy-2.3.0-py2.5.egg/
cherrypy/_cphttptools.py, line 264, in main
body = page_handler(*virtual_path, **self.params)
  File string, line 3, in search
  File /usr/lib/python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg/
turbogears/controllers.py, line 365, in expose
*args, **kw)
  File string, line 5, in run_with_transaction
  File /usr/lib/python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg/
turbogears/database.py, line 356, in so_rwt
retval = func(*args, **kw)
  File string, line 5, in _expose
  File /usr/lib/python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg/
turbogears/controllers.py, line 380, in lambda
mapping, fragment, args, kw)))
  File /usr/lib/python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg/
turbogears/controllers.py, line 421, in _execute_func
return _process_output(output, template, format, content_type,
mapping, fragment)
  File /usr/lib/python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg/
turbogears/controllers.py, line 87, in _process_output
fragment=fragment)
  File /usr/lib/python2.5/site-packages/TurboGears-1.0.4.4-py2.5.egg/
turbogears/view/base.py, line 129, in render
return engine.render(**kw)
  File /usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/
template/plugin.py, line 104, in render
return self.transform(info, template).render(**kwargs)
  File /usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/
core.py, line 154, in render
return encode(generator, method=method, encoding=encoding)
  File /usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/
output.py, line 45, in encode
output = u''.join(list(iterator))
  File /usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/
output.py, line 369, in __call__
for kind, data, pos in stream:
  File /usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/
output.py, line 618, in __call__
for kind, data, pos in stream:
  File /usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/
output.py, line 691, in __call__
text = escape(pop_text(), quotes=False)
  File /usr/lib/python2.5/site-packages/Genshi-0.4.4-py2.5.egg/genshi/
core.py, line 405, in escape
text = unicode(text).replace('', 'amp;') \
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
23: ordinal not in range(128)

I can't even tell from this message where the problem
is...unfortunately the url is supposed to show a 4000 line table, the
elements of which come from a postgresql database that is hopefully in
utf-8.

Please help!

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



[TurboGears] https dropped on (at least) one type of redirect...

2008-06-07 Thread [EMAIL PROTECTED]

So I have ssl/https working under Apache.  Finally.  :)

Everything appears to work great.

Except I've split my app into separate controllers.

One of which is attached as admin.

Every page I've tried to go to so far works great under https.

Except for this one:
https://www.example.com/admin  --- this url redirects to
http://www.example.com/admin/
(notice the missing s for http and the added / on the end of the url)

But if I type in:  https://www.example.com/admin/ it takes me to the
url as typed.

Both of these are just synonyms for https://www.example.com/admin/index
which also works perfectly.

I've read the thread here:
http://groups.google.com/group/turbogears/browse_thread/thread/1fe3a63439ba1166/2e4535821a24ca67?lnk=gstq=ssl+redirect#2e4535821a24ca67

and tried things like commenting out  #ProxyPreserveHost On
but to no avail.

Here's what the relevant ssl part of my config looks like:

NameVirtualHost *:443
VirtualHost *:443
ServerName core
#ServerAdmin [EMAIL PROTECTED]
#DocumentRoot /srv/www/vhosts/mytgapp
Errorlog /var/log/apache2/xstart-secure-error_log
Customlog /var/log/apache2/xstart-secure-access_log common
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
UseCanonicalName Off
ServerSignature Off
AddDefaultCharset utf-8
#ProxyPreserveHost On
ProxyRequests Off
ProxyPass /error/ !
ProxyPass /icons/ !
ProxyPass /favicon.ico !
#ProxyPass /static/ !
ProxyPass /phppgadmin !
ProxyPass / http://127.0.0.1:8095/
ProxyPassReverse / http://127.0.0.1:8095/
/VirtualHost

(Oh...obviously www.example.com is just an example domain)

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?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Comments and comment spam in the docs...

2008-06-05 Thread [EMAIL PROTECTED]

Hi...

I must have been m.i.a. when there was a massive comment spam problem.

I'm not sure what was tried and what wasn'tbut I do think that in
general allowing comments on website docs makes is one of the easiest
and best things any software project can do for its users.

Is there something new we can try?

If we implemented a system where each comment had to be approved by a
moderator, I would be willing to spend time  reviewing and approving
comments.   (Assuming someone builds an easy to use web interface to
do so).

I'm sure that with two or three other volunteers we could do a good
job.

Of course if we could solve the problem without moderation even
better.  I assume we tried gothas---to no avail?

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?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: Making widgets that aren't one big list?

2008-06-04 Thread [EMAIL PROTECTED]

Jorge...

Thanks for the advice.

I've managed to implement it two ways:

One is deriving from widgets.Widget:
class SamSeperatorWidget(widgets.Widget):
template = p Fun  /p
validator = None
label = 
field_id = 
help_text = 

The other is deriving from widgets.Formfield:
class SamTwo(widgets.FormField):
template = p${label}/p

With formfield I figured out how to reuse a passed in label (in which
case I get it twice)... but not how to pass in my own custom fields.

Furthermore I'd like to really have the option of having a column span
of 2...i.e. not broken up between two columns:  the first one of which
is a label.

Am I on the right track?  What should I try next?

Thanks


On Jun 3, 6:05 pm, Jorge Godoy [EMAIL PROTECTED] wrote:
 Em Tuesday 03 June 2008 21:37:41 [EMAIL PROTECTED] escreveu:



  I've tried breaking things up into two different widgets.  But that
  gives me two forms with two submit buttons---not what I want.

  How can I have one form, with one submit button---yet have textfields
  occasionally broken by paragraphs? Is there perhaps a widget for the
  p element?

 Make a custom template for that.

 You can even pass text as a parameter to the new widget, making it more
 generic.

 --
 Jorge Godoy      [EMAIL PROTECTED]

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



[TurboGears] Providing data to my widget...

2008-06-03 Thread [EMAIL PROTECTED]

I have a form that uses a widget made up of textfields.  These
textfileds map to an sqlobiect class.  I can take the sqlobject class
and provide it as such:

return dict(data=mysqlobiectclassinstance,


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



[TurboGears] Re: Providing data to my widget...

2008-06-03 Thread [EMAIL PROTECTED]

Okay...so my memory is fading.  Turns out I did know the answer, it
just took a while to resurface (of course...part of the problem is
that it's not in splobject's docs...)

To convert an object (e.g. contacts)  to a dict in sqlobiect:
contacts.sqlmeta.asDict()

On Jun 2, 11:29 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 My apologiessomehow this got sent too soon.

 To recap:

  I have a form that uses a widget made up of textfields.  These
  textfileds map to an sqlobiect class.  I can take the sqlobject class
  and provide it as such:

 return dict(data=sqlobiectclassinstance, form=contact_form)

 This interestingly enough works, even though sqlobiectclassinstance is
 not a dictionary.  But the problem is that I want to add a field to
 it.  But I can't figure out how --because it's a class, not a
 dictionary.

 Advice?

 Thanks.

 On Jun 2, 11:22 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  I have a form that uses a widget made up of textfields.  These
  textfileds map to an sqlobiect class.  I can take the sqlobject class
  and provide it as such:

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



[TurboGears] Re: Providing data to my widget...

2008-06-03 Thread [EMAIL PROTECTED]

My apologiessomehow this got sent too soon.

To recap:

 I have a form that uses a widget made up of textfields.  These
 textfileds map to an sqlobiect class.  I can take the sqlobject class
 and provide it as such:

return dict(data=sqlobiectclassinstance, form=contact_form)

This interestingly enough works, even though sqlobiectclassinstance is
not a dictionary.  But the problem is that I want to add a field to
it.  But I can't figure out how --because it's a class, not a
dictionary.

Advice?

Thanks.



On Jun 2, 11:22 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I have a form that uses a widget made up of textfields.  These
 textfileds map to an sqlobiect class.  I can take the sqlobject class
 and provide it as such:

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



  1   2   3   4   5   6   7   8   9   10   >