Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2168 (closed defect: fixed)

Opened 10 years ago

Last modified 10 years ago

override_template should assume the default template engine

Reported by: droggisch Owned by: faide
Priority: high Milestone: 2.0rc1
Component: TurboGears Version:
Severity: normal Keywords:
Cc:

Description

Currently, tg.decorators.override_template expects the engine to be given, followed by a colon & the template name.

This is surprising, and additionally not documented.

If the engine is absent, it should be inferred as the standard-engine configured.

Additionally, the function needs more documentation, and potentially should be moved - "decorators" is also misleading I'd say.

Change History

comment:1 Changed 10 years ago by mramm

  • Priority changed from normal to high

comment:2 Changed 10 years ago by mramm

Also, needs a test!

comment:3 Changed 10 years ago by mramm

  • Priority changed from high to normal

comment:4 Changed 10 years ago by mramm

  • Priority changed from normal to high

comment:5 Changed 10 years ago by mramm

If this is going to be fixed before 2.0 it must be fixed this week, but now that the docs are updated, I do not view this as a blocker.

comment:6 Changed 10 years ago by percious

I move to remove this functionality entirely. I don't feel that it serves a useful purpose. Permission to deprecate hereby requested.

comment:7 Changed 10 years ago by mramm

  • Milestone changed from 2.0b6 to 2.0 RC 1

Percious: what do you propose people do if they want to dynamically overide the template in the controller?

I mean they can just render the string themselves, but that seems like a pretty big step down in "helpfulness" from the standard TG way.

comment:8 Changed 10 years ago by mramm

  • Status changed from new to closed
  • Resolution set to fixed

On the other hand, using the render method directly and returning a string is pretty easy, so override template isn't strictly necessary, so this is syntactic sugar on syntactic sugar.

Note: See TracTickets for help on using tickets.