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 #1080 (closed enhancement: fixed)

Opened 11 years ago

Last modified 10 years ago

[PATCH] Update fastdata DataController to newer api's

Reported by: wavy Owned by: anonymous
Priority: normal Milestone:
Component: FastData Version: 0.9a5
Severity: normal Keywords:
Cc:

Description (last modified by kevin) (diff)

Patch attached that updates tgfastdata.datacontroller, mostly updates to current api's, but also some very minor refactoring and enhancement.

Summary of changes: BaseDataController?:

  • [FIX] Use database.so_joins rather that sqlmeta.joins to enable use with InheritableSQLObject
  • [ENHANCE] Added _update() method to wrap calls to _filterJoins() and _updateJoins(). Used later in create() and update() in order to make subclassing and overwiting these methods simpler.

DataController:

  • [FIX] Removed old 'tg_error' based code and replaced with error_handler decorator
  • [FIX] Replaced 'raise cherrpy.HTTPRedirect' with turbogears.redirect()
  • [ENHANCE] Allowed form_widget to be passed to init and override default form creation.
  • [ENHANCE] Added new class attribute object_name which is used in flash messages. Again, for simpler customisation. Can be set in constructor.

Attachments

datacontroller.2.patch Download (4.5 KB) - added by wavy 11 years ago.
unified diff patch
datacontroller.patch Download (4.3 KB) - added by wavy 11 years ago.
updated patch

Change History

comment:1 Changed 11 years ago by wavy

Apologies for the borked formatting. How about this:

In BaseDataController?:

  • [FIX] Use database.so_joins rather that sqlmeta.joins to enable use with InheritableSQLObject
  • [ENHANCE] Added _update() method to wrap calls to _filterJoins() and _updateJoins(). Used later in create() and update() in order to make subclassing and overwiting these methods simpler.

In DataController:

  • [FIX] Removed old 'tg_error' based code and replaced with error_handler decorator
  • [FIX] Replaced 'raise cherrpy.HTTPRedirect' with turbogears.redirect()
  • [ENHANCE] Allowed form_widget to be passed to init and override default form creation.
  • [ENHANCE] Added new class attribute object_name which is used in flash messages. Again, for simpler customisation. Can be set in constructor.

Changed 11 years ago by wavy

unified diff patch

Changed 11 years ago by wavy

updated patch

comment:2 Changed 11 years ago by kevin

  • Status changed from new to closed
  • Resolution set to fixed
  • Description modified (diff)

committed in [1851]. thanks!

Note: See TracTickets for help on using tickets.