Changeset 3525
- Timestamp:
- 10/19/07 15:14:07 (1 year ago)
- Files:
-
- branches/1.0/CHANGELOG.txt (modified) (21 diffs)
- branches/1.0/turbogears/paginate.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/CHANGELOG.txt
r3510 r3525 8 8 *Features* 9 9 * "tg-admin sql" is now more powerful for SQLAlchemy. Ticket #1418 10 * Paginate allows ordering by attributes from related objects (SQLAlchemy 11 Query objects only). Ticket #1582. 10 12 11 13 *Fixes* 12 14 * Ticket #1185: rollback SA transaction if a controller method fails, and it 13 15 has an exception_handler. 14 * sa_rwt (SQLAlchemy run with transaction) refactored to fix some corner 16 * sa_rwt (SQLAlchemy run with transaction) refactored to fix some corner 15 17 cases. 16 * Ticket #1508: fixed internal pagination ordering, avoiding a potential 18 * Ticket #1508: fixed internal pagination ordering, avoiding a potential 17 19 error when paginating Query objects (sqlalchemy) and ordering by 4 or more 18 20 columns. 21 * Ticket #1434: Fixed pagination of Query objects (SQLAlchemy). The first 22 patch assumed that Query objects have a _query attribute which holds the 23 query object, which is only true for SelectResults objects. 19 24 20 25 *Contributors* 21 26 22 Paul Johnston, R oger Demetrescu27 Paul Johnston, Remi Jolin, Jonathan Hitchcock, Roger Demetrescu 23 28 24 29 … … 74 79 * ticket #1434. Now handles SA Query in addition of SelectResults 75 80 which will be deprecated in the near future. 76 81 77 82 * ticket #1325 Fix visit entries created more than once in the 78 83 database. … … 123 128 * make 'flash' block dynamic in quickstart 124 129 * session setting is moved to config/app.cfg 125 * command/toolbox info could list the toolbox plugins 130 * command/toolbox info could list the toolbox plugins 126 131 * Enhancement SQLAlchemy default model, use 'assign' to avoid repeatedly writing, thanks cito 127 132 * Able to specify a default doctype in genshi, thanks Alastair Houghton … … 140 145 * Fixed bug in tg-admin that caused it not to operate properly on projects deployed as eggs. Patch 141 146 from #1361 by Christoph Zwerschke. 142 * SA auto-commiting fixed in some rare circumstances where sa_rwt was not being called. Patch from 147 * SA auto-commiting fixed in some rare circumstances where sa_rwt was not being called. Patch from 143 148 #1267 by Paul Johnston. 144 * CatWalk now handles customized addRemoveName in SO. #911 by Joost 149 * CatWalk now handles customized addRemoveName in SO. #911 by Joost 145 150 * using base64.decodestring in visitor.py for 2.3 compatibility. #1279 by Paul Fisher. 146 151 * Config file in quickstarted app now has config option to load identity classes. Thanks to Felix 147 152 Schwarz #1255. 148 153 * Identity now supports encrypted passwords with unicode characters. Thanks to Felix Schwarz and 149 Patrick Lewis #1281 154 Patrick Lewis #1281 150 155 * minor changes to template so they work properly when server.webpath != / thanks to "nludban" #1213 151 156 * fix quickstart project tests, thanks to Christoph Zwerschke #1289, Jeff Kowalczyk #1219 … … 163 168 * FormEncode version to i18n aware 0.7.1 164 169 * RuleDispatch to 0.5a0.dev-r2303 for Python 2.5 support. 165 * Added requirement of DecoratorTools due to upgrade of PyProtocols which 170 * Added requirement of DecoratorTools due to upgrade of PyProtocols which 166 171 deprecates functions used in decorator.py. 167 172 … … 178 183 * paginate decorator now supports SA, improves sorting and fixes problems 179 184 with CompoundWidget. Thanks to randall@tnr.cc and sbr77. #2404 180 * Catwalk now supports SQLMultipleJoin/SQLRelatedJoins. Thanks to Chris Arndt 185 * Catwalk now supports SQLMultipleJoin/SQLRelatedJoins. Thanks to Chris Arndt 181 186 #2382 182 187 * more docstring for widgets package #2355 … … 187 192 * Identity logout now works properly when using ``set_identity_user`` #1245. 188 193 Thanks to Felix Schwarz 189 * set right default encoding 'utf-8' instead of 'utf8' which broke 194 * set right default encoding 'utf-8' instead of 'utf8' which broke 190 195 XmlHttpRequest in IE. Thanks Simon King #2408 191 196 * workaround for MySQLdb imcompatibilty with MySQL 4.1. Thanks to Felix Schwarz … … 196 201 * fixes for FR locale in JavaScript for CalendarPicker. Thanks to Florent Aide 197 202 #2370 198 * various test case fixes. Thanks to Christoph Zwerschke, Felix Schwarz 203 * various test case fixes. Thanks to Christoph Zwerschke, Felix Schwarz 199 204 #2366 #2374 #2376 200 * adapt tests to changes in Kid 0.9.4. Thanks to Jeff Hinrichs and 205 * adapt tests to changes in Kid 0.9.4. Thanks to Jeff Hinrichs and 201 206 Christoph Zwerschke #2364 202 207 * reverted #2256 which caused a RuntimeError #2340 … … 217 222 * now possible to pass any option (besides dburi and echo) to sqlalchemy 218 223 engine. Thanks to elftherios and Lee McFadden #2318 #2320 219 * now possible to place test specific configuration in "test.cfg". Thanks to 224 * now possible to place test specific configuration in "test.cfg". Thanks to 220 225 Tim Freund #2263 221 226 * support testing the code that uses identity. Thanks to Max Ischenko and … … 225 230 *Features* 226 231 227 * now possible to add variables to the root template namespace via 232 * now possible to add variables to the root template namespace via 228 233 turbogears.view.root_variable_providers. Thanks Arnar Birgisson #2261 229 234 * turbogears.database.run_with_transaction is now a MultiorderGenericFunction to … … 236 241 * Fix implicit transactions for SQLAlchemy. Thanks to Lee McFadden #2322 237 242 * Various CSS fixes for DataGrid. Thanks Florent Aide #2316 238 * FeedController is now a Controller so tg.url works properly and fixed missing 243 * FeedController is now a Controller so tg.url works properly and fixed missing 239 244 import in feed.py .Thanks Florent Aide #2310 #2312 240 245 * Looser Enum implementation taht works better with ToscaWidgets #2303 … … 244 249 * throwing an identity.IdentityException inside a controller method is now 245 250 caught by identity.SecureResource #2250 246 * various test case fixes. Thanks to Felix Schwarz, Joost Moesker, 251 * various test case fixes. Thanks to Felix Schwarz, Joost Moesker, 247 252 Jeff Kowalczyk #2247 #2266 #2268 #2314 248 253 * 'logout' method in SQLObjectIdentity was setting read-only property. Does not … … 383 388 * Former LocalizableJSLink is now CalendarLangFile. New LocalizableJSLink is 384 389 simpler but backwards-incompatible. 385 * Catwalk no longer accepts an allowHost argument. 390 * Catwalk no longer accepts an allowHost argument. 386 391 To restrict access to it use Identity.SecureObject instead. 387 392 388 393 *Deprecations* 389 394 390 395 * Use of "entrys" is now deprecated in the FeedController. You should use 391 396 "entries" instead. 392 397 393 398 *Features* 394 399 … … 405 410 * `tg-admin shell` now asks if it should commit changes to the database on exit. 406 411 * Widgets can be listed at the `tg.include_widgets` config. list to send them to 407 every template (a la `tg.mochikit_all`). 412 every template (a la `tg.mochikit_all`). 408 413 * `DBTest` now drops tables after each test so they don't interfere with others. 409 414 * Toolbox is now secured using Identity … … 420 425 * `DateTimeConverter` now handles dates < 1900. 421 426 * Catwalk now handles gracefully UnicodeCols. 422 * QUICKSTART: `start-project.py` now detects correct python binary's path in 427 * QUICKSTART: `start-project.py` now detects correct python binary's path in 423 428 the system. 424 429 * Kid's base templates are now (re)loaded properly. … … 442 447 (My apologies if your name belongs here and is not!) 443 448 444 Roger Demetrescu, Elvelind Grandin, Rune Hansen, Sean De La Torre, 445 Alberto Valverde, Max Ischenko, Joseph Tate, Elvelind Grandin, 449 Roger Demetrescu, Elvelind Grandin, Rune Hansen, Sean De La Torre, 450 Alberto Valverde, Max Ischenko, Joseph Tate, Elvelind Grandin, 446 451 Charles Duffy, Matt Good, Ksenia Marasanova. 447 452 … … 459 464 * In widgets, if you were using a dictionary as a params be aware that now 460 465 the dictionary is not updated at construction or display/render time but 461 simply replaced with the new one. 462 If you were using it to provide default attributes for your widget, take a 466 simply replaced with the new one. 467 If you were using it to provide default attributes for your widget, take a 463 468 look at how the TableForm does that. 464 469 … … 470 475 precision.) 471 476 * tg-admin info shows which eggs require TurboGears 472 * In widgets, SelectionField now supports grouped options, 477 * In widgets, SelectionField now supports grouped options, 473 478 SingleSelectField and MultipleSelectField widgets take advantage of this 474 479 to provide an optgroup tag. The format of a grouped options list is like 475 480 the following: 476 481 477 482 options = [(None, [(1, "a"), (2, "b")]), ("Others", [(3, "c"), (4, "d")])] 478 483 … … 491 496 * Package name is used instead of `your_project` in the quickstart 492 497 logging config. 493 498 494 499 *Fixes* 495 500 … … 528 533 Max Ischenko, Claudio Martinez, Matt Good, Rune Hansen, Michele Cella, 529 534 Jorge Godoy, Alberto Valverde González, Simon Belak, Jeroen Dekkers, 530 Mark Ramm-Christensen, Ronald Jaramillo, 535 Mark Ramm-Christensen, Ronald Jaramillo, 531 536 Richard Standbrook, Roger Demetrescu, Patrick Lewis, Hal Wine, 532 537 Jorge Vargas, Bob Kuehne. … … 575 580 * For Python 2.3 users, there is a convenient new decorator syntax 576 581 that comes from Phillip Eby's PEAK. 577 582 578 583 Here's is the equivalent of @expose(): 579 584 branches/1.0/turbogears/paginate.py
r3510 r3525 342 342 col = getattr(var_data.sourceClass.q, colname, None) 343 343 344 elif isinstance(var_data, SASelectResults) or isinstance(var_data, Query):344 elif isinstance(var_data, SASelectResults): 345 345 col = getattr( 346 346 var_data._query.mapper.c, … … 348 348 None) 349 349 350 elif isinstance(var_data, Query): 351 col = getattr( 352 var_data.mapper.c, 353 colname[len(var_data.mapper.column_prefix or ''):], 354 None) 355 #if no attribute is found, let's try searching for 'foreign' objects... 356 # eg.: address.user.occupation.name 357 if not col and colname.find('.'): 358 seq = colname.split('.') 359 mapper = var_data.mapper 360 for propname in seq[:-1]: 361 prop = mapper.properties.get(propname) 362 if not prop: 363 break 364 mapper = prop.mapper 365 # last item from split should be a simple attribute 366 col = getattr( 367 mapper.c, 368 seq[-1][len(mapper.column_prefix or ''):], 369 None) 350 370 else: 351 371 raise StandardError, 'expected SelectResults' … … 372 392 373 393 # Ordering re: 374 ordering_expr = re.compile(r"('\w+ '): ?\[(\d+), ?(True|False)\]")394 ordering_expr = re.compile(r"('\w+(\.\w+)*'): ?\[(\d+), ?(True|False)\]") 375 395 376 396 def convert_ordering(ordering): … … 392 412 for ordering_info in ordering_info_find: 393 413 ordering_key = str(ordering_info[0]).strip("'") 394 ordering_order = int(ordering_info[ 1])395 ordering_reverse = bool(ordering_info[ 2] == 'True')414 ordering_order = int(ordering_info[2]) 415 ordering_reverse = bool(ordering_info[3] == 'True') 396 416 new_ordering[ordering_key] = [ordering_order, 397 417 ordering_reverse]