[turbogears-commits] [2061] widgets/TGTinyMCE/tgmce/static/javascript/themes/simple/images: Copying TinyMCE's themse simple images for locale 'es'

2006-11-07 Thread dangoor
Title: [2061] widgets/TGTinyMCE/tgmce/static/javascript/themes/simple/images: Copying TinyMCE's themse simple images for locale 'es'








Revision 2061
Author alberto
Date 2006-11-07 07:54:14 -0500 (Tue, 07 Nov 2006)


Log Message
Copying TinyMCE's themse simple images for locale 'es'

Added Paths

widgets/TGTinyMCE/tgmce/static/_javascript_/themes/simple/images/bold_es.gif
widgets/TGTinyMCE/tgmce/static/_javascript_/themes/simple/images/italic_es.gif
widgets/TGTinyMCE/tgmce/static/_javascript_/themes/simple/images/underline_es.gif




Diff

Copied: widgets/TGTinyMCE/tgmce/static/_javascript_/themes/simple/images/bold_es.gif (from rev 2060, widgets/TGTinyMCE/tgmce/static/_javascript_/themes/simple/images/bold.gif)

(Binary files differ)


Copied: widgets/TGTinyMCE/tgmce/static/_javascript_/themes/simple/images/italic_es.gif (from rev 2060, widgets/TGTinyMCE/tgmce/static/_javascript_/themes/simple/images/italic.gif)

(Binary files differ)


Copied: widgets/TGTinyMCE/tgmce/static/_javascript_/themes/simple/images/underline_es.gif (from rev 2060, widgets/TGTinyMCE/tgmce/static/_javascript_/themes/simple/images/underline.gif)

(Binary files differ)




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





[tg-tickets] Re: [TurboGears] #1084: turbogears.redirect fails if the tg app is deployed behind a proxy or rewrite mechanism

2006-11-07 Thread TurboGears
#1084: turbogears.redirect fails if the tg app is deployed behind a proxy or
rewrite mechanism
--+-
 Reporter:  jtate |Owner:  anonymous 
 Type:  defect|   Status:  closed
 Priority:  highest   |Milestone:  1.0   
Component:  CherryPy  |  Version:  0.9a6 
 Severity:  normal|   Resolution:  worksforme
 Keywords:|  
--+-
Comment (by mbevan):

 To make sure relative redirects work, ensure that Apache is redirecting to
 the correct base path.  I had mine redirecting /booking/* to
 http://localhost:8080/* which was causing lots of problems.  The correct
 path should have been http://localhost:8080/booking/*

-- 
Ticket URL: http://trac.turbogears.org/turbogears/ticket/1084
TurboGears http://www.turbogears.org/
TurboGears front-to-back web development
--~--~-~--~~~---~--~~
 You received this message because you are subscribed to the Google Groups 
TurboGears Tickets group.
To post to this group, send email to turbogears-tickets@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-tickets?hl=en
-~--~~~~--~~--~--~---



[TurboGears] Re: New Project: Turbogears or Djano?

2006-11-07 Thread iain duncan

I am in the process of learning Gears after having already done two
small commercial projects in Django. I would love to hear feedback on
some of my own ( possible way off base ) observations. I am also trying
to figure out which to use for my upcoming large project. Problem is the
first phase ( simple small cms brochure ware thingy ) will be a lot
easier if I have the Django Admin. But phase two ( the custom gift
certificate making cart and redemption app ) might be easier with Gears,
and by the looks of it phase three ( complete online reservation/booking
system with employee web app ) will no doubt be easier with gears
because there will be a LOT of ajaxy stuff.

Some thoughts of mine in response, as someone with more Django
experience:

 1. Turbogears is easier(general overview)

I does look like getting simple minimal infrastructure will be much
easier in gears. I feel more like I have to buy into a whole system with
Django. It also looks like gears config is easier. The bash script I
wrote to migrate Django blank apps to new ones on ubuntu is way more
complicated than it needs to be. A bare bones gears app has no extra
table dependencies that I don't understand.

 2. Some stuff that should be easy in DJango are not.

Like forms. Egads, simple use of forms is so complicated! Sometimes you
only need to do something really dumb and easy with a form. It should
stay dumb and easy to implement.

 3. Turbogears is easier to work with Ajax.

Yes, I'm very excited about how easy sending JSON to mochikit is,
because a damn lot of my stuff is now moving over to being implemented
in Mochikit with Dom manipulation. Client expectations are changing,
whether or not they need all that bling.

 4. Both their model systems are equaly easy(SQLObject is a little more
 buggie though)

I find many aspect of the Django model API very unintuitive however. The
documention is very good. But man I sure have to go back to it a lot.
That SQLlike syntax looks like a breath of fresh air. On the other hand,
it is well documented so getting up and running was very easy.

 5. Django template system is more...robust, and it is very simple(i
 loved that pipe thing)

Yes, it is very robust. On the other hand, there is a whole lot of
unnecessary typing for those weird tags, and a Django template is
useless without Django. It seems from the tutorials that a genshi or kid
template can just be used as is in the browser. Very nice for template
dev. Also in Django doing complex logic in the template is hideous. As a
two man operation, I like the idea that I can use python in the
templates in the normal way ( again less looking in the docs for how to
make loops, etc ). Can anyone tell me if we will be able  to add python
in genshi soon in the manner of kid?

 6. Django is faster(for now...)

Also true. But maybe a bit of a red herring. CGI scripts in C are really
really fast. Isn't coder convenience over performance the point of very
high level languages? 

 7. Turbogears likes decorators as it should be...Django doesn't

I like the way gears passes to templates way better than Django.

Some thoughts of my own, open for comment:

- I will miss the Django admin. On the other hand, extending the Django
admin is a real pain and significantly more magic goes on there then
in other cases. But for clients with simple admin needs, I will probably
still use Django, giving clients bare bones update abilities with their
logo at the top is so easy. 
- the Django url mapping is cool. The dependency on it is not. An
optional url mapping layer that sits before the gears controller passing
through the ones you want and mapping others would be the best of both
worlds IMHO.
- Django docs are very good, better right now than gears. I had some
inexcusable problems with the gears tutorials because things are out of
sync. I know Kevin said that is a major concern and is being addressed.
At the moment, I think the initial experience of trying both out is
going to favour Django. Of course the initial experience of linux vs mac
( a comparison Adrian made ) favours macs, but now that I have put in
the time to really learn linux, I much prefer the *nix interoperability
approach.
- I don't feel as optimistic about the future of Django as of TurboGears
because I personally do not get the impression that they are properly
handling the difficult task of attracting and keeping new developers. I
feel like they are more interested in being #1 with their team than
setting up a road to the future. Maybe I'm wrong, maybe this will
change. And I really really dislike their PR style and constantly
telling everyone why their way is the only way. I don't think that
attitude will attract the most talented future developers. Most of the
smart programmers I know recognize that there are many sides to every
approach and all computing is a compromise.

If there were a url mapper on CherryPy and even some decent scaffolding
aimed at the end user for both SQLObject and SQLAlchemy admin

[TurboGears] Re: Starting gears, genshi, sqlalchemy

2006-11-07 Thread Jorge Godoy

iain duncan [EMAIL PROTECTED] writes:

 Hi all, I'm just wetting my feet here but am testing gears for a site
 that will eventually get quite complicated. Wondering if I should use
 kid and sqlobject, or try to get going directly with genshi and
 sqlalchemy? Pros and cons? Will it be a lot harder to learn the ropes if
 I start with sqlalchemy? I anticipate writing a basic admin interface
 for my client so if sqlalchemy is the way of the future, maybe I should
 do it that way first?

Today for two big projects that I have ongoing I'd start with Genshi + SA.
The number one reason is that they'll become the default in a future version
of TG.

Kid + SO are very good and my needs are being taken care here -- sometimes I
have to do more stuff because of some SQL Object limitations... but I don't
mind touching the database -- but there are things that would be simpler with
SO.

Anyway, support for what we have now -- SO + Kid -- is better tested and
adapted to TG.  But you shouldn't find any shortcomings with SA + Genshi.

The biggest change here is the ORM, IMNSHO.  It will impact much more than the
template language used.

-- 
Jorge Godoy  [EMAIL PROTECTED]

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



[TurboGears] Re: knowing the size of a file using FileField

2006-11-07 Thread Jorge Godoy

Sanjay [EMAIL PROTECTED] writes:

 Being unable to know how do I get the size of a file being uploaded,
 while using FileField. Needing help.

 I am a novice in web apps, and need some suggestions on this. Should I
 go more specific, presenting the sample code, pl let me know...

Have you inspected what you get with widgets.FileField + either of
validators.FieldStorageUploadConverter or validators.FileUploadKeeper (you can
read the docs for these validators at the formencode package)?

Also take a look at cgi.FieldStorage since it is the base for all this (you
don't need to use it directly, but the docs will point you there).

I believe that *IF* the browser informs the size of the message it will be
inside some dictionary and not available as a property on its own...  But I
never used that information for anything... 

-- 
Jorge Godoy  [EMAIL PROTECTED]

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



[TurboGears] Re: I am missing REPL

2006-11-07 Thread Diez B. Roggisch

 I use REPL extensively while programming in Lisp and Python. Is there
 any way to enable REPL in TurboGears? It would be nice to be able, for
 example, to perform some queries or redefine some functions on a
 running server.

I think the concept of a event-loop (as in web-server and gui apps for 
example) doesn't fit too well with a REPL.

However, what I do is this: I put the following snipplet on a piece of code I 
want to dig into, and possibly experiment:

import pdb
pdb.set_trace()


Then you get your REPL - sort of.

HTH 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: Limitation of activemapper?

2006-11-07 Thread Mark Godfrey

Chris,

I believe ActiveMapper alone won't do this, but you can leverage the
rest of SQLAlchemy to do it.
Below is an example of how I've managed to solve the same problem in my
current project.


# create a many to many join between TestObject and TestObject
related_items_table = Table('related_items',
metadata,
Column('id', Integer, ForeignKey(test_object.id)),
Column('related_id', Integer, ForeignKey('test_object.id')))

# Our class definition
class TestObject(ActiveMapper):
## class mapping sets up the DB-Object map
class mapping:
__table__ = test_object
## id stores the unique primary key for this product
id = column(Integer, primary_key=True)
## name gives this product a name
name = column(Unicode(255))
## description gives this product a description
description = column(Unicode(512))

# Then add a relation to TestObject's mapper instance
TestObject.mapper.add_property('related', relation(TestObject,
secondary=related_items_table, uselist=True,
primaryjoin=TestObject.c.id==related_items_table.c.id,

secondaryjoin=TestObject.c.id==related_items_table.c.related_id,
foreignkey=TestObject.c.id))


This will create a relation called TestObject.related which will
contain a list of TestObject instances, which is what I think you are
after.
I hope this helps you solve your issue.

Regards,

Mark.

On Nov 6, 2:33 pm, percious [EMAIL PROTECTED] wrote:
 Maybe this post wasn't clear.  Basically I have two foreign keys in a
 table which point to the same *other* table.  Active mapper does not
 seem to support this.  Anyone have an idea how I can get around the
 problem?
 
 -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: New Project: Turbogears or Djano?

2006-11-07 Thread Lee McFadden

On 11/6/06, iain duncan [EMAIL PROTECTED] wrote:

 Some thoughts of my own, open for comment:

8 *snip* 8

 - Django docs are very good, better right now than gears. I had some
 inexcusable problems with the gears tutorials because things are out of
 sync. I know Kevin said that is a major concern and is being addressed.
 At the moment, I think the initial experience of trying both out is
 going to favour Django. Of course the initial experience of linux vs mac
 ( a comparison Adrian made ) favours macs, but now that I have put in
 the time to really learn linux, I much prefer the *nix interoperability
 approach.

Documentation is definately where we are lagging and there is a lot of
work going into making the docs better.  There is a lot of work to do,
but we will get there in the end.  Doc sprints are in the works and
anyone in the community can also contribute their own documentation
and comments at http://docs.turbogears.org/


 If there were a url mapper on CherryPy and even some decent scaffolding
 aimed at the end user for both SQLObject and SQLAlchemy admin
 interfaces, I think I would do all my work in gears. Anyone know if
 these are in the works?


CherryPy 3 has the ability to use arbitary url mappers (or
'dispatchers') which should be available in TG 1.1 making the use of
Routes et al a breeze.  In fact, there's already a RoutesDispatcher
included with CP3 :)

Using CP2's `default` method you can build your own mappers or use
something like Routes[1].  Granted, it's a little more difficult than
it should be at times to get everything in Routes working with CP2
(since I last used it...  please correct me if this is no longer the
case), but it is possible with a little work.

With regards to the scaffolding for SO and SA - FastData (currently in
Alpha and also due in 1.1 i believe) will be the scaffolding that
you're talking about.  So, once 1.1 is out you should have everything
you need and wish for in TG. :)

[1]: http://routes.groovie.org/

Hope this helps,

Lee

-- 
Lee McFadden

blog: http://www.splee.co.uk
work: http://fireflisystems.com

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



[TurboGears] Re: Doing threading 'properly'

2006-11-07 Thread Ben Sizer

Bob Ippolito wrote:
 On 11/5/06, Ben Sizer [EMAIL PROTECTED] wrote:
  If you know which methods are synchronised and which ones aren't, then
  it's possible to prove whether it will always work or not.
  Unfortunately I don't have this sort of information and I was hoping
  someone here would.

 Audit the source then. See what kind of locking it tries to do.

I'm not exactly well-qualified to understand all that code though. And
between the various subprojects, there is certainly a lot of code.

 The safest thing to do of course is to only send immutable objects
 across threads, or deep copies of mutable objects (message passing).
 Pretty hard to screw that up.

Sure, but obviously when you use a framework like TurboGears, a lot
takes place under the hood. And I think it's important to document
these things.

For example, I was concerned that if 2 threads each created an
SQLObject-derived instance that referred to the same underlying data,
would there be some sort of clash? I found in the SQLObject
documentation that it ensures you get the same object in both threads,
which is at least some help, though it is still a little vague. (If
you ask for a person by a particular ID more than once, you'll get back
the same instance. This way you can be sure of a certain amount of
consistency if you have multiple threads accessing the same data
(though of course across processes there can be no sharing of an
instance). This isn't true if you're using transactions, which are
necessarily isolated.)

I expect that the above guarantee will be enough for my limited use of
threaded database access, but others may have more complex questions
which I hope someone can answer later.

-- 
Ben Sizer


--~--~-~--~~~---~--~~
 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: knowing the size of a file using FileField

2006-11-07 Thread Lee McFadden

On 11/7/06, Sanjay [EMAIL PROTECTED] wrote:


  Being unable to know how do I get the size of a file being uploaded,
  while using FileField. Needing help.

 I am a novice in web apps, and need some suggestions on this. Should I
 go more specific, presenting the sample code, pl let me know...


Let's say, for example, your file upload field on your form is called
'upload'.  Your controller method should have an `upload` parameter
which is, due to the wonders of CherryPy, a cgi.FieldStorage object.

[code]
filename = upload.filename
mime_type = upload.type
file_handle = upload.file

import os
file_size = os.path.getsize(upload.file.name)
[/code]

This will give you `file_size` which will be the size of the file in
bytes.  Divide by the appropriate power of 1024 to get it into Kb, Mb,
etc.

Lee
-- 
Lee McFadden

blog: http://www.splee.co.uk
work: http://fireflisystems.com

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



[TurboGears] Re: SQLObject limitations

2006-11-07 Thread Ben Sizer

On Nov 6, 4:52 pm, Diez B. Roggisch [EMAIL PROTECTED]
wrote:
 I don't get the near-desperate attempts to avoid SQL under all circumstances
 that some people seem to fall in love to the very moment the start using a
 ORM tool. The solution is easily expressed in a single query - why do you
 strive for a different way to do it? Especially, when you know that in the
 end, SQL will be the result anyway - after all, you are using an ORM mapper.

To be fair, I think the original poster was just trying to find a
solution to a problem, and both the ORM tool and the use it in the way
it was intended type of replies tend to channel you down that sort of
route. Obviously your first instinct is to try and see if the tool
provides a clean and native way to do what you want, since you don't
need an explicit select for most other uses.

Personally I sometimes appreciate the benefits something like SQLObject
gives me, and other times curse the obfuscation it causes. The very
first join I tried to do with my latest TurboGears project failed with
a cryptic error because the User table actually uses the identifier
tg_user and therefore the default join condition fails spectacularly.
So you inevitably just end up digging through the database to work out
what on earth the mapper actually did in the first place! :)

-- 
Ben Sizer


--~--~-~--~~~---~--~~
 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: I am missing REPL

2006-11-07 Thread Ben Sizer

On Nov 7, 8:56 am, Anton V. Belyaev [EMAIL PROTECTED] wrote:
 I use REPL extensively while programming in Lisp and Python. Is there
 any way to enable REPL in TurboGears? It would be nice to be able, for
 example, to perform some queries or redefine some functions on a
 running server.

Perhaps you could make a controller than receives a form's textarea
field, and calls eval() on the whole thing? Maybe redirect the standard
output to the browser for the duration of that call as well. It would
be pretty horrific code, but it might let you perform some of the tasks
you want.

-- 
Ben Sizer


--~--~-~--~~~---~--~~
 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: Limitation of activemapper?

2006-11-07 Thread percious

Thanks very much mark.  I came up with a similar solution that does not
involve a secondary join.  I do appreciate the feedback.  I have
figured out that sqlalchemy and active mapper defines can play together
which is a good thing.  I'm not really a fan of AM any more.  Maybe
something better will arrive in the near future...

-percious


--~--~-~--~~~---~--~~
 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: I am missing REPL

2006-11-07 Thread Alberto Valverde


On Nov 7, 2006, at 9:56 AM, Anton V. Belyaev wrote:


 Hello,

 I use REPL extensively while programming in Lisp and Python. Is there
 any way to enable REPL in TurboGears? It would be nice to be able, for
 example, to perform some queries or redefine some functions on a
 running server.

 Thanks.

There's a REPL tool for CherryPy which you can easily integrate in  
TurboGears:
http://projects.amor.org/misc/browser/httprepl.py
and
http://projects.amor.org/misc/browser/httprepl.html

HTH,
Alberto

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



[TurboGears] Star Rating widget?

2006-11-07 Thread Anthony Batchelor

Hi,
  I was wondering if there is a star rating widget that will create
something similar to
http://www.masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/
or
http://komodomedia.com/blog/index.php/2006/01/09/css-star-rating-part-deux/
I'm working on a project that needs this.  If it already exists, where
is it? If not, I guess I will have to make it myself.

Cheers,
  Tony


--~--~-~--~~~---~--~~
 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: I am missing REPL

2006-11-07 Thread Christian

Diez B. Roggisch wrote:
  I use REPL extensively while programming in Lisp and Python. Is there
  any way to enable REPL in TurboGears? It would be nice to be able, for
  example, to perform some queries or redefine some functions on a
  running server.

 I think the concept of a event-loop (as in web-server and gui apps for
 example) doesn't fit too well with a REPL.

Actually, it can work quite well.  There are a number of ways to
accomplish this with CherryPy (and thus TurboGears, I imagine).

 what I do is this: I put the following snipplet on a piece of code I
 want to dig into, and possibly experiment:

 import pdb
 pdb.set_trace()

Here are some other options:

HTTPREPL - http://projects.amor.org/misc/wiki/HTTPREPL
Probably your best option.  In browser REPL to let you interactively
poke around in your running app.  There is no built in security, so
don't just make this available on your public app ;-)

Using the interpreter directly -
http://blog.dowski.com/2006/03/05/cherrypy-and-the-interactive-interpreter/
This is a handy way to get inside of your app if you don't want to do
it through the web.  Plus, it doesn't require any additional packages
to install - just CherryPy/TurboGears and the good ol' interactive
interpreter.

Also, as Kevin mentioned in the comments of my blog posting on the
interactive interpreter, it sounds like TurboGears has some sort of
built in interpreter in the toolbox.

Hope this helps!

Christian
http://www.dowski.com


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



[TurboGears] Re: I am missing REPL

2006-11-07 Thread Vircom

I'm using WebConsole widgit from toolbox.shell. For providing local
scope i changed a little new_console function like:
def new_console(self):
locs =
dict(__name__='tg-admin',__doc__=None,reload_console=self.new_console)
insertedlocs.update(self.locs)
mod = turbogears.util.get_model()
if mod:
locs.update(mod.__dict__)
self.console = InteractiveConsole(locals=locs)

So it's easy to attach into necessory place by making console.locs =
locals().


--~--~-~--~~~---~--~~
 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: I am missing REPL

2006-11-07 Thread Diez B. Roggisch

On Tuesday 07 November 2006 14:14, Christian wrote:
 Diez B. Roggisch wrote:
   I use REPL extensively while programming in Lisp and Python. Is there
   any way to enable REPL in TurboGears? It would be nice to be able, for
   example, to perform some queries or redefine some functions on a
   running server.
 
  I think the concept of a event-loop (as in web-server and gui apps for
  example) doesn't fit too well with a REPL.

 Actually, it can work quite well.  There are a number of ways to
 accomplish this with CherryPy (and thus TurboGears, I imagine).

  what I do is this: I put the following snipplet on a piece of code I
  want to dig into, and possibly experiment:
 
  import pdb
  pdb.set_trace()

 Here are some other options:

 HTTPREPL - http://projects.amor.org/misc/wiki/HTTPREPL
 Probably your best option.  In browser REPL to let you interactively
 poke around in your running app.  There is no built in security, so
 don't just make this available on your public app ;-)

 Using the interpreter directly -
 http://blog.dowski.com/2006/03/05/cherrypy-and-the-interactive-interpreter/
 This is a handy way to get inside of your app if you don't want to do
 it through the web.  Plus, it doesn't require any additional packages
 to install - just CherryPy/TurboGears and the good ol' interactive
 interpreter.

 Also, as Kevin mentioned in the comments of my blog posting on the
 interactive interpreter, it sounds like TurboGears has some sort of
 built in interpreter in the toolbox.

ah, one never stops learning. Thanks for the suggestions. I still like my 
approach to debug errornous code when the full request/response context is 
available. But that doesn't make the real repl useless. Thanks,

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: Starting gears, genshi, sqlalchemy

2006-11-07 Thread percious

For what it's worth, I recommend starting with SQLAlchemy and Kid.
Right now there is not stellar support for Genshi, especially with
respect to the templates used in TG Widgets (I know this is changing)
The good news is that if you write your templates using Kid they will
be most likely Genshi compliant.

We went down the SO road because that's all that was available back
then.  The limitations of SO became apparent in the last few weeks, and
I am spending over 2 weeks getting our stuff converted over to SA.  SA
is TONS more versatile and does exactly what I want out of an
database-object mapper, so I recommend using that.  Activemapper or
TurboEntity will get you quickly up and running, and both should work
with brute-force SA tables/mappers.

-percious


--~--~-~--~~~---~--~~
 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: form inside a tabber howto

2006-11-07 Thread Aaron Bostick

Jose,

That sounds more complicated than what I did, but hey, if it works for
you, go for it! :)

I had the same question about the tabbertab defaults and I looked it up
on google.  You can set an additional div class called
tabbertabdefault which will cause a certain div to display first.

I did something like this in my kid template:

div class=tabbertab ${tab_default}

and then I return from the controller the tab_default value set to
either None or tabbertabdefault.  Works for me!

jose wrote:
 I followed what Adam Jones suggested me:
 ...If you are looking for a quick hack you can do editForm.render(data, 
 action=myaction)
 Where data is the 'data' you are using to fill in the form, and 
 'myaction' is the
 controller method the form should post data to.
 and it works fine.
 Now, the only problem is the default div.
 Thank any way, Aaron
 jo
 
 
 Aaron Bostick wrote:
 
 Jose,

 Have you tried just a simple widget.display() in the kid template within
 the tabber div?  I am doing this now and it seems to work fine.

 Just create your widget in the controller and pass it to the template
 like normal as part of the return dict()...

 jose wrote:
  

 Hi all,
 I would like to insert a form into a Tabber widget.
 Using the code above I can insert it successful,
 but I don't know how to set the editForm.fields.name with data.
 Using editForm.render() the widgets are displyed empty
 I tried editForm.display() but it doesn't work.
 Is there a demo about how to use it?
 ---
 editForm = widgets.TableForm(
fields = [
widgets.HiddenField(name='id'),
widgets.TextField(name='cliente',label='codice utente'),
widgets.SubmitButton(name='Save',label='',default='salva'),
] )

 class Controller:
@expose(template=kid:sicer.templates.config.edit)
def index(self, tg_errors=None, **data):
qry = session.query(Config)
context = qry.get_by(id=1)

template=
  div class=tabber
div class=tabbertabh2Amministratore/h2   /div
div class=tabbertabh2Anagrafica/h2 /div
div class=tabbertabh2Fatturazione/h2
%s /div
  /div
   % editForm.render()
tabForm = widgets.Tabber(template=template)
return dict(tabForm=tabForm, context=context)
 --
 jo
  




 Regards,
 Aaron

  

 
 
  
Regards,
Aaron

--~--~-~--~~~---~--~~
 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: Star Rating widget?

2006-11-07 Thread gasolin

There's no Star Rating widget already exists,
It seems not a hard thing to implement it while you already have
sufficient information for it :-)


--
Fred



Anthony Batchelor wrote:
 Hi,
   I was wondering if there is a star rating widget that will create
 something similar to
 http://www.masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/
 or
 http://komodomedia.com/blog/index.php/2006/01/09/css-star-rating-part-deux/
 I'm working on a project that needs this.  If it already exists, where
 is it? If not, I guess I will have to make it myself.
 
 Cheers,
   Tony


--~--~-~--~~~---~--~~
 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: Starting gears, genshi, sqlalchemy

2006-11-07 Thread Diez B. Roggisch

 We went down the SO road because that's all that was available back
 then.  The limitations of SO became apparent in the last few weeks, and
 I am spending over 2 weeks getting our stuff converted over to SA.  SA
 is TONS more versatile and does exactly what I want out of an
 database-object mapper, so I recommend using that.  Activemapper or
 TurboEntity will get you quickly up and running, and both should work
 with brute-force SA tables/mappers.

Out of curiosity: what are these limitations of SO? So far, it suited my 
(simple) needs, and no SA experience on this side of the monitor.

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: Starting gears, genshi, sqlalchemy

2006-11-07 Thread iain duncan


 Anyway, support for what we have now -- SO + Kid -- is better tested and
 adapted to TG.  But you shouldn't find any shortcomings with SA + Genshi.

Ok. I'll stick with kid for now.

 The biggest change here is the ORM, IMNSHO.  It will impact much more than the
 template language used.

One worry I have is that I really look forward to the gears book. Anyone
know how much of that I will be hucking out by going the SA route?

Iain



--~--~-~--~~~---~--~~
 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: Starting gears, genshi, sqlalchemy

2006-11-07 Thread iain duncan

On Tue, 2006-07-11 at 07:04 -0800, percious wrote:
 For what it's worth, I recommend starting with SQLAlchemy and Kid.
 Right now there is not stellar support for Genshi, especially with
 respect to the templates used in TG Widgets (I know this is changing)
 The good news is that if you write your templates using Kid they will
 be most likely Genshi compliant.
 
 We went down the SO road because that's all that was available back
 then.  The limitations of SO became apparent in the last few weeks, and
 I am spending over 2 weeks getting our stuff converted over to SA.  SA
 is TONS more versatile and does exactly what I want out of an
 database-object mapper, so I recommend using that.  Activemapper or
 TurboEntity will get you quickly up and running, and both should work
 with brute-force SA tables/mappers.

Thanks for the tips. The pros of SO that I can see is simplicity and
documentation. But this projects third phase has me seriously expecting
to hit walls with any kind of simple database, one of my main reasons
for looking here. I was thinking of Django with SA, and then started to
wonder why I would want Django at all if I was going with SA. ( The
answer is that admin. but for this client, I think the hard stuff that
will be easier with SA is going to outweigh the ease of the django
admin ).

Iain



--~--~-~--~~~---~--~~
 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: Starting gears, genshi, sqlalchemy

2006-11-07 Thread Diez B. Roggisch

 The biggest is the single column primary key. If you're working on
 legacy databases, multi-column primary keys are fairly common. Other
 limitations can be worked around with _get_ and _set_ hacking (though
 it's ugly) but this cannot.

Ok, I'm a friend of single-column primary keys anyway, but of course one 
_might_ come into a situation this isn't avoidable.

 If you don't mind reading, I believe that most items in the advanced
 datamapping[1] section of the SA docs are difficult to do. It's
 getting hard to remember the details, I've been switched over since
 February (due to the primary key issue).

 [1] http://www.sqlalchemy.org/docs/adv_datamapping.myt

 One particular SA feature that I'm happy about is the associationproxy
 extension[2], which Michael just put in SVN (because I was harassing
 him about it ;]). It's a bit strange to get your head around, but it
 allows you to implement typed relationships (I use them for user
 roles) between two tables without having to manage the association
 objects yourself.

 [2] http://www.sqlalchemy.org/docs/plugins.myt#plugins_associationproxy

Thanks for the pointers, and of course I'm willing to read :)

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: New Project: Turbogears or Djano?

2006-11-07 Thread Bob Ippolito

On 11/7/06, Lee McFadden [EMAIL PROTECTED] wrote:

 On 11/6/06, iain duncan [EMAIL PROTECTED] wrote:
 
  Some thoughts of my own, open for comment:
 
 8 *snip* 8

  - Django docs are very good, better right now than gears. I had some
  inexcusable problems with the gears tutorials because things are out of
  sync. I know Kevin said that is a major concern and is being addressed.
  At the moment, I think the initial experience of trying both out is
  going to favour Django. Of course the initial experience of linux vs mac
  ( a comparison Adrian made ) favours macs, but now that I have put in
  the time to really learn linux, I much prefer the *nix interoperability
  approach.

 Documentation is definately where we are lagging and there is a lot of
 work going into making the docs better.  There is a lot of work to do,
 but we will get there in the end.  Doc sprints are in the works and
 anyone in the community can also contribute their own documentation
 and comments at http://docs.turbogears.org/

 
  If there were a url mapper on CherryPy and even some decent scaffolding
  aimed at the end user for both SQLObject and SQLAlchemy admin
  interfaces, I think I would do all my work in gears. Anyone know if
  these are in the works?
 

 CherryPy 3 has the ability to use arbitary url mappers (or
 'dispatchers') which should be available in TG 1.1 making the use of
 Routes et al a breeze.  In fact, there's already a RoutesDispatcher
 included with CP3 :)

 Using CP2's `default` method you can build your own mappers or use
 something like Routes[1].  Granted, it's a little more difficult than
 it should be at times to get everything in Routes working with CP2
 (since I last used it...  please correct me if this is no longer the
 case), but it is possible with a little work.

 With regards to the scaffolding for SO and SA - FastData (currently in
 Alpha and also due in 1.1 i believe) will be the scaffolding that
 you're talking about.  So, once 1.1 is out you should have everything
 you need and wish for in TG. :)

 [1]: http://routes.groovie.org/

If you don't want to use CherryPy crap you might as well pick
something like Pylons. I recently converted a SQLAlchemy+Genshi+TG
project to SQLAlchemy+Genshi+Pylons and it actually ended up being a
bit less code.

-bob

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



[TurboGears] Re: Star Rating widget?

2006-11-07 Thread Adam Jones


gasolin wrote:
 There's no Star Rating widget already exists,
 It seems not a hard thing to implement it while you already have
 sufficient information for it :-)

It might be worth the trouble to examine the licenses for either of
those to see if you could use the code from it in your project. Writing
a backend for it to work with isn't too hard.

-Adam



 --
 Fred



 Anthony Batchelor wrote:
  Hi,
I was wondering if there is a star rating widget that will create
  something similar to
  http://www.masugadesign.com/the-lab/scripts/unobtrusive-ajax-star-rating-bar/
  or
  http://komodomedia.com/blog/index.php/2006/01/09/css-star-rating-part-deux/
  I'm working on a project that needs this.  If it already exists, where
  is it? If not, I guess I will have to make it myself.
  
  Cheers,
Tony


--~--~-~--~~~---~--~~
 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: form inside a tabber howto

2006-11-07 Thread Adam Jones


Aaron Bostick wrote:
 Jose,

 Have you tried just a simple widget.display() in the kid template within
 the tabber div?  I am doing this now and it seems to work fine.

Yes, that should work. Your template would look something like this:

div class=tabber
div class=tabbertabh2atitle/h2
${mywidget.display(data)}
/div
...
/div


 Just create your widget in the controller and pass it to the template
 like normal as part of the return dict()...

 jose wrote:
  Hi all,
  I would like to insert a form into a Tabber widget.
  Using the code above I can insert it successful,
  but I don't know how to set the editForm.fields.name with data.
  Using editForm.render() the widgets are displyed empty
  I tried editForm.display() but it doesn't work.
  Is there a demo about how to use it?
  ---
  editForm = widgets.TableForm(
  fields = [
  widgets.HiddenField(name='id'),
  widgets.TextField(name='cliente',label='codice utente'),
  widgets.SubmitButton(name='Save',label='',default='salva'),
  ] )
 
  class Controller:
  @expose(template=kid:sicer.templates.config.edit)
  def index(self, tg_errors=None, **data):
  qry = session.query(Config)
  context = qry.get_by(id=1)
 
  template=
div class=tabber
  div class=tabbertabh2Amministratore/h2   /div
  div class=tabbertabh2Anagrafica/h2 /div
  div class=tabbertabh2Fatturazione/h2
  %s /div
/div
 % editForm.render()
  tabForm = widgets.Tabber(template=template)
  return dict(tabForm=tabForm, context=context)
  --
  jo

  
  
   
 Regards,
 Aaron


--~--~-~--~~~---~--~~
 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: form inside a tabber howto

2006-11-07 Thread Adam Jones

If you are in a situation where you need to change the default tab a
lot, or are creating a lot of similar tabbed items, you may want to
look into packaging the functionality as a widget instead of redoing it
in the template each time.

-Adam


--~--~-~--~~~---~--~~
 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: Starting gears, genshi, sqlalchemy

2006-11-07 Thread percious


Diez B. Roggisch wrote:
  We went down the SO road because that's all that was available back
  then.  The limitations of SO became apparent in the last few weeks, and
  I am spending over 2 weeks getting our stuff converted over to SA.  SA
  is TONS more versatile and does exactly what I want out of an
  database-object mapper, so I recommend using that.  Activemapper or
  TurboEntity will get you quickly up and running, and both should work
  with brute-force SA tables/mappers.

 Out of curiosity: what are these limitations of SO? So far, it suited my
 (simple) needs, and no SA experience on this side of the monitor.

 Diez

Limitations include:

An *easy* way to build complex select queries

Multiple Inserts with one sql query.

Lack of future support by TG...

The list goes on

I also find that sqlalchemy's documentation is considerably better than
that of SQLObject.  Do do some of the things I did with SO I had to dig
into the source code.  I've only looked at the source for ActiveMapper
since converting over.

-percious


--~--~-~--~~~---~--~~
 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: Starting gears, genshi, sqlalchemy

2006-11-07 Thread Bob Ippolito

On 11/7/06, iain duncan [EMAIL PROTECTED] wrote:


  Anyway, support for what we have now -- SO + Kid -- is better tested and
  adapted to TG.  But you shouldn't find any shortcomings with SA + Genshi.

 Ok. I'll stick with kid for now.

Migrating from Kid to Genshi is trivial anyway. You pretty much just
change the filename and the namespace declaration and you're done.
Genshi is just a better implementation of the same thing (and then
some).

-bob

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



[TurboGears] Re: Starting gears, genshi, sqlalchemy

2006-11-07 Thread gasolin

iain :

I suggest you to take TurboEntity a try. TurboEntity is build upon SA
and provide SO's simplicity. It's pretty cool to save lots of coding
effort of plain SA.

It's website provide an turbogears identity example that worked fine
with TurboGears  SA support.

At this time kid is still a good choice. Genshi is good because it's
error report messages are more meaningful than kid(and genshi is
faster, they said), the module also provide the text-based template
with very similar syntax as the xhtml-based one. To migrate form kid to
genshi did not take too much effort though.

---
Fred h


--~--~-~--~~~---~--~~
 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: Starting gears, genshi, sqlalchemy

2006-11-07 Thread Karl Guertin

On 11/7/06, Bob Ippolito [EMAIL PROTECTED] wrote:
 Migrating from Kid to Genshi is trivial anyway. You pretty much just
 change the filename and the namespace declaration and you're done.
 Genshi is just a better implementation of the same thing (and then
 some).

The issues are a TG limitation rather than a Genshi one, there's a
number of places where it's assumed that Kid is the templating library
in use. Most of these are in the widgets code, so if you're not using
widgets, there's no reason to not use Genshi.

--~--~-~--~~~---~--~~
 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: Starting gears, genshi, sqlalchemy

2006-11-07 Thread iain duncan

On Tue, 2006-07-11 at 15:03 -0500, Karl Guertin wrote:
 On 11/7/06, Bob Ippolito [EMAIL PROTECTED] wrote:
  Migrating from Kid to Genshi is trivial anyway. You pretty much just
  change the filename and the namespace declaration and you're done.
  Genshi is just a better implementation of the same thing (and then
  some).
 
 The issues are a TG limitation rather than a Genshi one, there's a
 number of places where it's assumed that Kid is the templating library
 in use. Most of these are in the widgets code, so if you're not using
 widgets, there's no reason to not use Genshi.

Is the widget thing something that is likely to change in the next few
months? I anticipate needing widgets a lot for phase 3, but I don't
think that will be an issue for some time.

Thanks for all the tips folks
Iain


--~--~-~--~~~---~--~~
 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: New Project: Turbogears or Djano?

2006-11-07 Thread iain duncan

 Documentation is definately where we are lagging and there is a lot of
 work going into making the docs better.  There is a lot of work to do,
 but we will get there in the end.  Doc sprints are in the works and
 anyone in the community can also contribute their own documentation
 and comments at http://docs.turbogears.org/

I'll check that out. 

 With regards to the scaffolding for SO and SA - FastData (currently in
 Alpha and also due in 1.1 i believe) will be the scaffolding that
 you're talking about.  So, once 1.1 is out you should have everything
 you need and wish for in TG. :)

What do you think the projected timeline on a beta is for that? ( I ask
knowing full well how elastic that will be ... )

After doing a project where the Django admin was sufficient, and another
where hacking on the Django admin was needed, and now this one coming, I
think budget for the admin will be a major deciding factor. If the
budget is not there, I will use likely Django and change some colors. If
it, I'd way rather customize on scaffolding than try to take apart the
whole house in order to rebuild it. ;)

Now I know nobody likes to be accused of vaporware, but maybe a more
prominent mention of what's coming up would be good on the gears site? I
think I would have got here a lot faster had I known that these were in
the works.

Thanks everyone
Iain


--~--~-~--~~~---~--~~
 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: New Project: Turbogears or Djano?

2006-11-07 Thread iain duncan


 With regards to the scaffolding for SO and SA - FastData (currently in
 Alpha and also due in 1.1 i believe) will be the scaffolding that
 you're talking about.  So, once 1.1 is out you should have everything
 you need and wish for in TG. :)

I googled for this and couldn't find much. Any links?

thanks
Iain


--~--~-~--~~~---~--~~
 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] JSON and SQLObject

2006-11-07 Thread chiangf

I have a page that requests for JSON output from controller, which
returns a list of selectresults from an SQLObject.  My table looks
something like this:

class myTable(SQLObject):
name = UnicodeCol()
date = DateTimeCol()
myfk = ForeignKey('SecondTable')

class secondTable(SQLObject):
secondname = UnicodeCol()

I have no problem displaying the variables 'name' and 'date' but I
can't seem to get myfk.  In python code, I'm able to access
myfk.secondname and I want to do something similar in the javascript
code.  I understand that myfk is kind of like a pointer to the other
table object and perhaps javascript doesn't understand this.

My question is whether there is any way to access myfk.secondname from
javascript?


Thanks so much,
Frank


--~--~-~--~~~---~--~~
 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: Starting gears, genshi, sqlalchemy

2006-11-07 Thread Jorge Godoy

iain duncan [EMAIL PROTECTED] writes:

 On Tue, 2006-07-11 at 15:03 -0500, Karl Guertin wrote:
 On 11/7/06, Bob Ippolito [EMAIL PROTECTED] wrote:
  Migrating from Kid to Genshi is trivial anyway. You pretty much just
  change the filename and the namespace declaration and you're done.
  Genshi is just a better implementation of the same thing (and then
  some).
 
 The issues are a TG limitation rather than a Genshi one, there's a
 number of places where it's assumed that Kid is the templating library
 in use. Most of these are in the widgets code, so if you're not using
 widgets, there's no reason to not use Genshi.

 Is the widget thing something that is likely to change in the next few
 months? I anticipate needing widgets a lot for phase 3, but I don't
 think that will be an issue for some time.

Widgets *already* support alternative templates and engines in the trunk, so
this is something that *will* surely be in 1.1.  This implementation is not
available in the 1.0 branch because of some backward compatibilities
problems.

I believe that we can still discuss what are the drawbacks of bringing those
changes back to 1.0 branch and how troublesome would them be (but the first
decision was to avoid then on the stable branch...).

-- 
Jorge Godoy  [EMAIL PROTECTED]

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



[TurboGears] Re: turbogears.redirect ignores base_url_filter and server.webpath when using relative URLs.

2006-11-07 Thread fumanchu

Matthew Bevan wrote:
 In my logs, I see that in my production code behind an Apache
 mod_rewrite proxy, the following request is being made:

 127.0.0.1 - - POST /administration/organization/3/edit HTTP/1.1 302
 177 http://www.DOMAIN.tld/tgroot/administration/organization/3/edit;
 Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.7) Gecko/
 20060911 Camino/1.0.3

 The DOMAIN.tld version is correct, the POST version is not, and
 relative redirects (to, say, './' or '../') drop the approot/
 base_url.  This is most likely a CherryPy problem, but it makes using
 relative paths for flexibility and webpath/base_url_filter is
 pointless if redirects refuse to work.  The cherrypy.HTTPRedirect
 exception is not cherrypy.request.app_root/base_url aware.

 Specifically, line 81 of _cperror.py in CherryPy states:

 url = urlparse.urljoin(cherrypy.request.browser_url, url)

 Should this not use cherrypy.request.app_root somewhere?  Or should
 TG fudge browser_url to be the correct version, as the DOMAIN.tld
 version in the above log.

browser_url is generated from request.base, which should include your
app root. If it does not, use baseurlfilter to correct request.base.
What version of TG/CP are you using? To my knowledge, there's never
been a request.app_root in CherryPy, so it's hard to tell exactly
what you're saying. A small, complete test case or demo would help
immensely.

 I look forward to hearing that this is fixed!  (As this is a bit of a
 breaker for my administration area.  ;^)

This has been fixed (and made much simpler) in CherryPy 3 via
tools.proxy and cherrypy.url. There aren't any fixes planned for the
2.x line in this area; you need to work around it either with some TG
facility (tg.url?) or pass an absolute path to HTTPRedirect.


Robert Brewer
System Architect
Amor Ministries
[EMAIL PROTECTED]


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



[TurboGears] Re: Starting gears, genshi, sqlalchemy

2006-11-07 Thread Jorge Godoy

percious [EMAIL PROTECTED] writes:

 Lack of future support by TG...

I don't believe there will be lack of support.  It won't be the default ORM
but it doesn't mean that it will go unsupported.  Surely new things will
appear first on SA and people will provide third party modules based on it,
but nothing will prevent anyone willing to use SO to do that.  The freedom
will remain the same and for the core both will be supported.


-- 
Jorge Godoy  [EMAIL PROTECTED]

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



[TurboGears] Re: Starting gears, genshi, sqlalchemy

2006-11-07 Thread Jorge Godoy

gasolin [EMAIL PROTECTED] writes:

 At this time kid is still a good choice. Genshi is good because it's
 error report messages are more meaningful than kid(and genshi is
 faster, they said), the module also provide the text-based template
 with very similar syntax as the xhtml-based one. To migrate form kid to
 genshi did not take too much effort though.

Wasn't there a roadmap to convert from Kid to Genshi somewhere?  If he has
access to the procedure he might see if it will be or not worth the effort in
the future... 

-- 
Jorge Godoy  [EMAIL PROTECTED]

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



[TurboGears] Re: form inside a tabber howto

2006-11-07 Thread Jorge Godoy

Adam Jones [EMAIL PROTECTED] writes:

 Yes, that should work. Your template would look something like this:

 div class=tabber
 div class=tabbertabh2atitle/h2
 ${mywidget.display(data)}
 /div
 ...
 /div

It would be interesting if there was some widget we could insert in a form
just to mark the place for a new div.  This would allow coding multiple
forms in an easy way...

Hmmm...  Creating one shouldn't be all that hard and since I'm willing to use
this on a project of mine I might give it a try tonight (I mean, later
tonight). 

Any suggestions on the name of that widget?  ;-)  I thought about something
like widgets.TabberTab to mimic the class name. 

My needs should be rendered like this:

form
  !--! Common part to all tabs --
  div class=tabbertabh2Tab1/h2
   !-- Widgets inside the first tab --
  /div
  div class=tabbertabh2Tab2/h2
   !-- Widgets inside the first tab --
  /div
  div class=tabbertabh2Tab3/h2
   !-- Widgets inside the first tab --
  /div
  input type=submit
/form

Where I'd have probably a TableForm for the form, some widgets for the common
part, containers (widgets.TabberTab) and their contents.  

Using multiple forms is already possible today with minimum effort so I won't
worry with that...

Anyone needing something more elaborated than that and willing me to take a
look at it for a new widget? 


Be seeing you,
-- 
Jorge Godoy  [EMAIL PROTECTED]

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



[TurboGears] Re: JSON and SQLObject

2006-11-07 Thread Jorge Godoy

chiangf [EMAIL PROTECTED] writes:

 My question is whether there is any way to access myfk.secondname from
 javascript?

No.  All you have is what you give as the output of your JSON exposed method.
You can pass the decoded result that you're willing to have there.

If this information will be needed only in some cases, it might be worth going
to the database again with the ID you already have and fetching it. 

It all depends on your design and how many hits you'll end up with on your
database. 

-- 
Jorge Godoy  [EMAIL PROTECTED]

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



[TurboGears] Re: Starting gears, genshi, sqlalchemy

2006-11-07 Thread iain duncan

On Tue, 2006-07-11 at 19:25 -0200, Jorge Godoy wrote:
 percious [EMAIL PROTECTED] writes:
 
  Lack of future support by TG...
 
 I don't believe there will be lack of support.  It won't be the default ORM
 but it doesn't mean that it will go unsupported.  Surely new things will
 appear first on SA and people will provide third party modules based on it,
 but nothing will prevent anyone willing to use SO to do that.  The freedom
 will remain the same and for the core both will be supported.

I think that is very wise. I am getting much more of right tool for the
right job feel from Gears than I do from Django, and keeping the option
of light and simple or heavier and powerful for an ORM is a very
attractive feature. Sometimes our clients need complex models, and
sometimes they don't! =)

Iain



--~--~-~--~~~---~--~~
 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: Starting gears, genshi, sqlalchemy

2006-11-07 Thread iain duncan

On Tue, 2006-07-11 at 19:27 -0200, Jorge Godoy wrote:
 gasolin [EMAIL PROTECTED] writes:
 
  At this time kid is still a good choice. Genshi is good because it's
  error report messages are more meaningful than kid(and genshi is
  faster, they said), the module also provide the text-based template
  with very similar syntax as the xhtml-based one. To migrate form kid to
  genshi did not take too much effort though.
 
 Wasn't there a roadmap to convert from Kid to Genshi somewhere?  If he has
 access to the procedure he might see if it will be or not worth the effort in
 the future... 

The one complaint I have is that I like the ability in kid to execute
arbitrary python code. It's not what I'll do for production, but it sure
is handy for development prototyping. The Genshi guys made some noises
about adding that though didn't they?

And as to 1.1, I feel bad even asking, but what is the goal calendar
wise for 1.1beta anyway?

Thanks
iain


--~--~-~--~~~---~--~~
 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] Documentation thought

2006-11-07 Thread iain duncan

The IBM intro article is currently a much better first walk through than
the text version of the 20minute wiki. I had a number of problems with
the 20 minute wiki and question it's current role as the start here
point.

Iain


--~--~-~--~~~---~--~~
 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 breadcumbing and kid

2006-11-07 Thread Lord Galrion

Hi,

I would like to know if there is a breadcrumbing example using
TurboGears? I see there is a link on the site, but it is empty.

Thanks,

Nevyn

--~--~-~--~~~---~--~~
 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 Book and Ultimate DVD

2006-11-07 Thread Lord Galrion

I have downloaded the TG book from Safari and have to say that there
is a lot of good stuff in it and it has helped a lot. However, I am
pretty much new to TG and web design and come from a PHP background. I
know python relatively well but find TG confusing. The book parts that
I really didn't like so much was the fact that the advanced TG
tutorial comes way before the introduction to kid and SQLObject. The
bookmark example was fairly good, but there were a lot a times were it
became vague. It left me with a feeling that I did not understand how
things work.

If wanted, I can write a more specific feedback to the chapters I have
read and don't understand, if that helps. Being that I am not an
expert, and I feel that I am a step or two away from being a Newb, I
figure I would be the prime target for this book.

I'm sorry guys, I don't want to be negative but I want to be honest. I
have purchased the TG Ultimate video and was very excited, but again
there really was not much in the 5hrs to help a newb. Kevin is very
smart and goes through things so fast assuming that everybody  has his
knowlege and expertise. A lot of the people who want to enjoy and use
TG are not at Kevin's expert level. Just a suggestion.. Forget about
the 20 minute wiki, slow down... explain things for the newb.

Another note, which I think is very important!!!

The only book on the market for TG is going to focuse on SQLObject and
kid! Yet, SQLAlchemy and Genshi are going to be default in the next
version of TG, and I am guessing by the time the book comes out. Don't
you feel that is unfair? Or kinda silly?

Also, I do have a request and would be willing to help. TG docs seem
to be very unorganized on the website. Some are in the documantation,
some are in Trac and If there was one page to sum that all up, or at
least point people to trac etc.. what about the fact that there is
planet.turbogears.com? I didn't know that until I google'd for
something and saw it.

anyhow, maybe it's just me. Still thanks for an awesome product!

Nevyn

--~--~-~--~~~---~--~~
 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: Starting gears, genshi, sqlalchemy

2006-11-07 Thread Jorge Godoy

iain duncan [EMAIL PROTECTED] writes:

 The one complaint I have is that I like the ability in kid to execute
 arbitrary python code. It's not what I'll do for production, but it sure
 is handy for development prototyping. The Genshi guys made some noises
 about adding that though didn't they?

I heard something like that too...  You'd better see on their list or website
if they have something.

 And as to 1.1, I feel bad even asking, but what is the goal calendar
 wise for 1.1beta anyway?

The more people test and help debugging the trunk the sooner it will get
there.  I'm unable to go back doing this for a while, but as soon as I can,
I'll restart using it to help with the process. 

-- 
Jorge Godoy  [EMAIL PROTECTED]

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



[TurboGears] Re: Starting gears, genshi, sqlalchemy

2006-11-07 Thread Karl Guertin

On 11/7/06, iain duncan [EMAIL PROTECTED] wrote:
 The one complaint I have is that I like the ability in kid to execute
 arbitrary python code. It's not what I'll do for production, but it sure
 is handy for development prototyping. The Genshi guys made some noises
 about adding that though didn't they?

Christopher has mentioned that he'd like to get ?python ? blocks in
for 0.4. I'm sure they'll get in at some point.

 And as to 1.1, I feel bad even asking, but what is the goal calendar
 wise for 1.1beta anyway?

The goal was for 1.0 to be released in February. ;]

--~--~-~--~~~---~--~~
 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: Documentation thought

2006-11-07 Thread Karl Guertin

On 11/7/06, iain duncan [EMAIL PROTECTED] wrote:

 The IBM intro article is currently a much better first walk through than
 the text version of the 20minute wiki. I had a number of problems with
 the 20 minute wiki and question it's current role as the start here
 point.

Known issue. I was going to rewrite it this past weekend but I wrote
javascript instead. :[

--~--~-~--~~~---~--~~
 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: New Project: Turbogears or Djano?

2006-11-07 Thread Karl Guertin

On 11/7/06, iain duncan [EMAIL PROTECTED] wrote:
 I googled for this and couldn't find much. Any links?

There won't be much. It's been cooking in SVN and I remember the
reason being a Kid issue. It's been a while though. You'll see a few
posts on the mailing list about it but it's never been documented. The
idea, however, is to select TG widgets based on your DB schema.

--~--~-~--~~~---~--~~
 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: Documentation thought

2006-11-07 Thread iain duncan

On Tue, 2006-07-11 at 19:17 -0500, Karl Guertin wrote:
 On 11/7/06, iain duncan [EMAIL PROTECTED] wrote:
 
  The IBM intro article is currently a much better first walk through than
  the text version of the 20minute wiki. I had a number of problems with
  the 20 minute wiki and question it's current role as the start here
  point.
 
 Known issue. I was going to rewrite it this past weekend but I wrote
 javascript instead. :[

Cool. I spoke too soon anyway, turned out the IBM had problems and typos
later. 

One suggestion would be to have downloadable code for the wiki doc. I
got hung up on formatting in a couple of spots where I copied the
examples into the wrong place, thus wrong level of indent. 

Iain



--~--~-~--~~~---~--~~
 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 conditionally choose template inside my controller?

2006-11-07 Thread Matt Wilson

For controller foo, I want a foo returns success template, and a foo
returns failure template.

Pretend that when foo returns s=1, I want the background to be blue,
and when foo returns s=0, I want a red background

I want to avoid putting conditional logic in my kid file.  I'd rather
just have two separate kid files.

I can't figure out how to do this, because I think I have to choose the
kid file in the decorator of my controller method.

Any advice welcome.


--~--~-~--~~~---~--~~
 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 conditionally choose template inside my controller?

2006-11-07 Thread Julio Oña
Do this:@expose()def foo(self): ... if s==1: template = '.templates.success' else: template = '.templates.failure' return dict(tg_template=template,)regards.
On 11/7/06, Matt Wilson [EMAIL PROTECTED] wrote:
For controller foo, I want a foo returns success template, and a fooreturns failure template.Pretend that when foo returns s=1, I want the background to be blue,and when foo returns s=0, I want a red background
I want to avoid putting conditional logic in my kid file.I'd ratherjust have two separate kid files.I can't figure out how to do this, because I think I have to choose thekid file in the decorator of my controller method.
Any advice welcome.-- Julio

--~--~-~--~~~---~--~~
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 conditionally choose template inside my controller?

2006-11-07 Thread Matt Wilson

Fantastic.  Even prettier than I hoped.


--~--~-~--~~~---~--~~
 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, what do I lose?

2006-11-07 Thread iain duncan

I'm not quite clear. If I use SA, does Catwalk still work? 

And when Fast Data becomes a reality, will it support both SO and SA
right away or SO first?

Thanks
Iain


--~--~-~--~~~---~--~~
 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, what do I lose?

2006-11-07 Thread Karl Guertin

On 11/7/06, iain duncan [EMAIL PROTECTED] wrote:
 I'm not quite clear. If I use SA, does Catwalk still work?

No.

 And when Fast Data becomes a reality, will it support both SO and SA
 right away or SO first?

Probably. It was written for SO but it is part of the 1.1 push, so I'd
expect it to grow SA support. It shouldn't be that hard, it's just
converting the SO column type checks to SO or SA column type checks.
Not that I'm interested in being the one to do it... ;]

--~--~-~--~~~---~--~~
 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, what do I lose?

2006-11-07 Thread iain duncan

On Tue, 2006-07-11 at 21:37 -0500, Karl Guertin wrote:
 On 11/7/06, iain duncan [EMAIL PROTECTED] wrote:
  I'm not quite clear. If I use SA, does Catwalk still work?
 
 No.

Is Catwalk expected to later support SA or will it in effect be replaced
by the functionality of fast data?

Sorry for all the pestery questions, I'm trying really hard not to start
this project off on the wrong foot! Can't really figure out right now if
I should just stick to SO or dive in to SA.

Iain



--~--~-~--~~~---~--~~
 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, what do I lose?

2006-11-07 Thread Karl Guertin

On 11/7/06, iain duncan [EMAIL PROTECTED] wrote:
 Is Catwalk expected to later support SA or will it in effect be replaced
 by the functionality of fast data?

The theory is that the functionality will be replaced. This area is in flux.

 Sorry for all the pestery questions, I'm trying really hard not to start
 this project off on the wrong foot! Can't really figure out right now if
 I should just stick to SO or dive in to SA.

SO gives you more terse model syntax and catwalk. SA handles the hard
cases better.

--~--~-~--~~~---~--~~
 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, what do I lose?

2006-11-07 Thread iain duncan

On Tue, 2006-07-11 at 22:55 -0500, Karl Guertin wrote:
 On 11/7/06, iain duncan [EMAIL PROTECTED] wrote:
  Is Catwalk expected to later support SA or will it in effect be replaced
  by the functionality of fast data?
 
 The theory is that the functionality will be replaced. This area is in flux.
 
  Sorry for all the pestery questions, I'm trying really hard not to start
  this project off on the wrong foot! Can't really figure out right now if
  I should just stick to SO or dive in to SA.
 
 SO gives you more terse model syntax and catwalk. SA handles the hard
 cases better.

Could anyone give examples ( perhaps these could be saved for docs ) of
where they feel the switch point is in terms of db cases? IE specific
instances of what you might need to be doing to justify the extra
overhead of SA?

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: SQLAlchemy, what do I lose?

2006-11-07 Thread iain duncan

 
  SO gives you more terse model syntax and catwalk. SA handles the hard
  cases better.
 
 Could anyone give examples ( perhaps these could be saved for docs ) of
 where they feel the switch point is in terms of db cases? IE specific
 instances of what you might need to be doing to justify the extra
 overhead of SA?

For example, I have established that I will at least be using some
Many-To-Many tables where the primary key is a combination of foreign
keys, and that I'll need joins between that and some other tables. I
would think this would not be too much for SO would it? 

I may later even want to integrate with a nasty old Filemaker database
on windows machines using ODBC, but that is optional. Would probably add
value to the contract though, if I decide I want to go there. :\

Thanks
Iain



--~--~-~--~~~---~--~~
 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, what do I lose?

2006-11-07 Thread Karl Guertin

On 11/7/06, iain duncan [EMAIL PROTECTED] wrote:
 Could anyone give examples ( perhaps these could be saved for docs ) of
 where they feel the switch point is in terms of db cases? IE specific
 instances of what you might need to be doing to justify the extra
 overhead of SA?

I mentioned it in another thread today, but I switched way back in
February because I needed multi-column primary keys. Now I just use it
on everything because I know that it can handle whatever screwy
database scheme I come up with. I hate getting to the point where what
you want to do is not possible with the ORM. Every time that's
happened with SA, I've gotten excellent suggestions from Michael and
most of the time a patch or two. I really don't know how he can code
so much.

--~--~-~--~~~---~--~~
 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 breadcumbing and kid

2006-11-07 Thread Adam Jones

Dunno what happened to the link on the trac, here is the correct page:

http://trac.turbogears.org/turbogears/wiki/BreadCrumbNaviation


--~--~-~--~~~---~--~~
 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, what do I lose?

2006-11-07 Thread Jorge Vargas

On 11/8/06, iain duncan [EMAIL PROTECTED] wrote:

 On Tue, 2006-07-11 at 22:55 -0500, Karl Guertin wrote:
  On 11/7/06, iain duncan [EMAIL PROTECTED] wrote:
   Is Catwalk expected to later support SA or will it in effect be replaced
   by the functionality of fast data?
 
  The theory is that the functionality will be replaced. This area is in flux.
 
   Sorry for all the pestery questions, I'm trying really hard not to start
   this project off on the wrong foot! Can't really figure out right now if
   I should just stick to SO or dive in to SA.
 
  SO gives you more terse model syntax and catwalk. SA handles the hard
  cases better.

 Could anyone give examples ( perhaps these could be saved for docs ) of
 where they feel the switch point is in terms of db cases? IE specific
 instances of what you might need to be doing to justify the extra
 overhead of SA?

Ask and you shall receive
http://docs.turbogears.org/1.0/RoughDocs/SQLObjectVrSQLAlchemy

I hacked this up as a guideline so people can build it up :)

 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: How to conditionally choose template inside my controller?

2006-11-07 Thread Jorge Vargas

On 11/7/06, Matt Wilson [EMAIL PROTECTED] wrote:

 For controller foo, I want a foo returns success template, and a foo
 returns failure template.

 Pretend that when foo returns s=1, I want the background to be blue,
 and when foo returns s=0, I want a red background

 I want to avoid putting conditional logic in my kid file.  I'd rather
 just have two separate kid files.

 I can't figure out how to do this, because I think I have to choose the
 kid file in the decorator of my controller method.

 Any advice welcome.

you can also do

@expose(template=templates.ok)
def foo(self):
if (not s):
   return(tg_template=templates.notOK,other=bar
return(other=bar)

if tg_templates is defined it will use that if not it will fallback to
whatever is in exposed.


 


--~--~-~--~~~---~--~~
 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: default() got multiple values for keyword argument

2006-11-07 Thread Jorge Vargas

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

 Jorge Vargas wrote:
  yes indeed I just tried it and it's weird even if you leave it as
 
  def default(self,proj='New',sect='Edit',*args):
 
  it says invalid keyword argument which is weird, need to see what the
  CP folks say about this

 It's not invalid CP code in any way. My guess is it's a bug in the
 expose decorator's decoration-decorating decorators. ;) They use
by they I assume you mean TG-people :D

 getargspec to copy the argspec from the original function to the
 wrappers, and should be easy to unit test to see if they're the
 culprit..

ok so this seems like a TG bug kerinin can you please post it and
assign to 1.0b3


 Robert Brewer
 System Architect
 Amor Ministries
 [EMAIL PROTECTED]


 


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



[TurboGears] Re: Choosing default div for tabber widget?

2006-11-07 Thread Jorge Vargas

On 11/6/06, Aaron Bostick [EMAIL PROTECTED] wrote:

 FYI, I googled the tabber project.  You can set an additional class on
 the div, tabbertabdefault, to make that div the default div for a
 particular page load.

Can you please open an enhancement ticket for that

 Maybe something useful to put on the widget browser...

in case you want to take a look the code is at
http://trac.turbogears.org/turbogears/browser/trunk/turbogears/widgets/links.py

it should be trivial to add it since tabber_options goes to the JS file.


 Aaron Bostick wrote:
  I am using and loving the tabber widget in a project.  One thing I would
  like to know however is whether you can specify which div to display on
  the page load.
 
  By default the first div always shows, but using a query string or
  something, can I specify a different div to show first at different
  time?  For instance, if one of my divs contains a form, and I want to
  post right back to the same page and have that same div show the post
  results?
 
  That would be so cool! :)
 
  Regards,
  Aaron
 
  

 --
 Thank you,
 Aaron Bostick
 DS Ltd.
 512-735-0230

 


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



[TurboGears] Re: TG Newbie Wants to Create a Dynamic Form

2006-11-07 Thread Jorge Vargas

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

 Hello,

 I'm currently looking to design an application in Turbogears but am
 getting hung up on one specific challenge - that's updating form fields
 conditionally based upon the selection of another form field.  For
 instance:

 In a form, you have two select fields, one for state and one for city.
 I want the city field to be populated with city names that are ONLY in
 the state selected, which would (presumably) be pulled from a database.
  I'd like to do it asynchronously versus posting the entire form and
 dealing with the whole page reloading.

Ian and/or Jose could you guys clean up your example and post it as a
tutorial? In fact having both approaches will be great to show up how
flexible TG is :)

 Thanks,

 DS


 


--~--~-~--~~~---~--~~
 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: Star Rating widget?

2006-11-07 Thread Jorge Vargas

On 11/7/06, Anthony Batchelor [EMAIL PROTECTED] wrote:

 http://komodomedia.com/blog/index.php/2006/01/09/css-star-rating-part-deux/
this one seems that could be wrap in a CSSLink , maybe a subclass?


 I guess I will have to make it myself.
or apply the first item at http://docs.turbogears.org/1.0/Philosophy
and send him an email

tg-admin quickstart widget :D


 Cheers,
   Tony


 


--~--~-~--~~~---~--~~
 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: JSON and SQLObject

2006-11-07 Thread Jorge Vargas

On 11/7/06, chiangf [EMAIL PROTECTED] wrote:


 My question is whether there is any way to access myfk.secondname from
 javascript?

you could also write a jsonify rule (see json.py) that will make your
myTable objects fetch this info but be aware of what your doing
because you may be pulling out half your db if there is a big join

--~--~-~--~~~---~--~~
 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 Book and Ultimate DVD

2006-11-07 Thread Jorge Vargas

On 11/7/06, Lord Galrion [EMAIL PROTECTED] wrote:


 The only book on the market for TG is going to focuse on SQLObject and
 kid! Yet, SQLAlchemy and Genshi are going to be default in the next
 version of TG, and I am guessing by the time the book comes out. Don't
 you feel that is unfair? Or kinda silly?

in their defence went the book was plan neither SO or kid was going to
be replaced. I'm not sure if they are plans to add extra chapters. as
for kid to genshi they are totally equal (in the interface of course)
with the exception of only 2 functions.

 Also, I do have a request and would be willing to help. TG docs seem
 to be very unorganized on the website. Some are in the documantation,
 some are in Trac and If there was one page to sum that all up, or at
 least point people to trac
I believe your refering to docs.turbogears.org vrs
trac.turbogears/wiki, if you take a look the wiki is closed and on the
front page it tells you to go to docs site. if you find anything on
trac that's interesting, please contribute migrating it to
http://docs.turbogears.org/1.0/RoughDocs except for outdated docs most
stuff should be already duplicated on the docs site.

also you may want to register to turbogears-docs@googlegroups.com

 etc.. what about the fact that there is
 planet.turbogears.com?
http://planet.turbogears.org/ :)

 I didn't know that until I google'd for
 something and saw it.

umm I never though of that I just went to http://www.turbogears.org/
and there is this tiny link near the mailing lists.

maybe you miss it or someone upgraded the site to make you look bad :D

--~--~-~--~~~---~--~~
 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: JSON and SQLObject

2006-11-07 Thread iain duncan

On Wed, 2006-08-11 at 02:43 -0400, Jorge Vargas wrote:
 On 11/7/06, chiangf [EMAIL PROTECTED] wrote:
 
 
  My question is whether there is any way to access myfk.secondname from
  javascript?
 
 you could also write a jsonify rule (see json.py) that will make your
 myTable objects fetch this info but be aware of what your doing
 because you may be pulling out half your db if there is a big join

Could one use mochikits logging facilities to check on how much is being
passed via JSON?

I love that logger Bob! =)

Iain



--~--~-~--~~~---~--~~
 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: knowing the size of a file using FileField

2006-11-07 Thread Sanjay

Thanks a lot for the guidences.

While trying file_size = os.path.getsize(upload.file.name), I get
Exception: StringIO instance has no attribute 'name'.

Seeing that upload has an attribute length, I tried that too, but got
-1.

The code below worked, but I don't know whether it is the best way:

data = upload.file.read()
file_size = len(data)

sanjay


--~--~-~--~~~---~--~~
 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: Starting gears, genshi, sqlalchemy

2006-11-07 Thread Jorge Vargas

On 11/7/06, Jorge Godoy [EMAIL PROTECTED] wrote:

 gasolin [EMAIL PROTECTED] writes:

  At this time kid is still a good choice. Genshi is good because it's
  error report messages are more meaningful than kid(and genshi is
  faster, they said), the module also provide the text-based template
  with very similar syntax as the xhtml-based one. To migrate form kid to
  genshi did not take too much effort though.

 Wasn't there a roadmap to convert from Kid to Genshi somewhere?  If he has
 access to the procedure he might see if it will be or not worth the effort in
 the future...


http://genshi.edgewall.org/wiki/GenshiVsKid
and the last two at
http://genshi.edgewall.org/wiki/GenshiRecipes

that's all you need if you don't use ?python  blocks migrating will
take 30min with testing and deployment :)

 --
 Jorge Godoy  [EMAIL PROTECTED]

 


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



[TurboGears] Re: turbogears breadcumbing and kid

2006-11-07 Thread Jorge Vargas

On 11/8/06, Adam Jones [EMAIL PROTECTED] wrote:

 Dunno what happened to the link on the trac, here is the correct page:

 http://trac.turbogears.org/turbogears/wiki/BreadCrumbNaviation

maybe the typo on the name?

I added it to http://docs.turbogears.org/1.0/RoughDocs/DocumentationWishList

 


--~--~-~--~~~---~--~~
 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] Calling a form function outside the main controller!

2006-11-07 Thread hamilton ganesan
Hi,

I am working on a group project. In order to neaten up and modulerize
the code I would like to place certain functions called by forms
outside of the main controller! I would typically like to hold those
functions within the current turbogears project but outside the main
controller.

How would I go about doing this!

Regards,

--~--~-~--~~~---~--~~
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] Solved: turbogears.redirect ignores base_url_filter and server.webpath when using relative URLs.

2006-11-07 Thread Matthew Bevan

To make sure relative redirects work, ensure that Apache is  
redirecting to the correct base path.  I had mine redirecting / 
booking/* to http://localhost:8080/* which was causing lots of  
problems.  The correct path should have been http://localhost:8080/ 
booking/*

--~--~-~--~~~---~--~~
 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
-~--~~~~--~~--~--~---