
Public Member Functions | |
| def | __init__ |
| def | clear_indexes |
| def | register_model |
| def | register |
| def | unregister |
| def | register_item |
| def | matches |
| def | fill |
| def | has_album |
| def | get_series |
| def | has_series |
| def | has_series_completed |
| def | get_row_colors |
Public Attributes | |
| library_id | |
| childs | |
Static Public Attributes | |
| string | album_related = "album__" |
Private Member Functions | |
| def | _create_entry |
| def | _queryset |
| def py::gui::models::flat_library::__init__ | ( | self, | ||
| id, | ||||
| view | ||||
| ) |
| def py::gui::models::flat_library::clear_indexes | ( | self | ) |
Reimplemented from py::gui::models::flat_catalog.
00368 : 00369 flat_catalog.clear_indexes(self) 00370 self['by-copy'] = {} 00371 def register_model( self, model ) :
| def py::gui::models::flat_library::register_model | ( | self, | ||
| model | ||||
| ) |
| def py::gui::models::flat_library::register | ( | self, | ||
| albumcopy | ||||
| ) |
register a new albumcopy
00378 : 00379 """ 00380 register a new albumcopy 00381 """ 00382 assert albumcopy.library.id == self.library_id 00383 self.register_item(albumcopy, albumcopy_item(self, self.view, albumcopy)) 00384 self.invalidate_sort() 00385 self.album_count_changed() 00386 # notify childs 00387 for model in self.childs : 00388 model.parent_registered(albumcopy) 00389 def unregister( self, albumcopy_id, album ) :
| def py::gui::models::flat_library::unregister | ( | self, | ||
| albumcopy_id, | ||||
| album | ||||
| ) |
00390 : 00391 if albumcopy_id in self['by-copy'] : 00392 for item in self['by-copy'][albumcopy_id] : 00393 self.view.remove_item(item) 00394 self['by-album'][album.qoid].remove(item) 00395 self['by-series'][album.series.qoid].remove(item) 00396 del item 00397 if len(self['by-album'][album.qoid]) == 0 : 00398 del self['by-album'][album.qoid] 00399 if len(self['by-series'][album.series.qoid]) == 0 : 00400 del self['by-series'][album.series.qoid] 00401 del self['by-copy'][albumcopy_id] 00402 self.album_count_changed() 00403 # notify childs 00404 for model in self.childs : 00405 model.parent_unregistered(albumcopy_id, album) 00406 def register_item( self, albumcopy, item ) :
| def py::gui::models::flat_library::register_item | ( | self, | ||
| albumcopy, | ||||
| item | ||||
| ) |
internal
Reimplemented from py::gui::models::flat_catalog.
00407 : 00408 """ 00409 internal 00410 """ 00411 if albumcopy.id not in self['by-copy'] : 00412 self['by-copy'][albumcopy.id] = set() 00413 self['by-copy'][albumcopy.id].add(item) 00414 return flat_catalog.register_item(self, albumcopy.album, item) 00415 def matches( self, album ) :
| def py::gui::models::flat_library::matches | ( | self, | ||
| album | ||||
| ) |
| def py::gui::models::flat_library::_create_entry | ( | self, | ||
| album | ||||
| ) | [private] |
Reimplemented from py::gui::models::flat_catalog.
00419 : 00420 for copy in album.albumcopy_set.all() : 00421 self.register_item(copy, albumcopy_item(self, self.view, copy)) 00422 self.album_count_changed() 00423 def _queryset( self ) :
| def py::gui::models::flat_library::_queryset | ( | self | ) | [private] |
| def py::gui::models::flat_library::fill | ( | self | ) |
Reimplemented from py::gui::models::flat_catalog.
00427 : 00428 for copy in self.queryset() : 00429 self.register_item(copy, albumcopy_item(self, self.view, copy)) 00430 def has_album( self, album ) :
| def py::gui::models::flat_library::has_album | ( | self, | ||
| album | ||||
| ) |
| def py::gui::models::flat_library::get_series | ( | self | ) |
| def py::gui::models::flat_library::has_series | ( | self, | ||
| series | ||||
| ) |
| def py::gui::models::flat_library::has_series_completed | ( | self, | ||
| series | ||||
| ) |
00450 : 00451 ret = False 00452 if series.is_oneshot() : 00453 pass 00454 elif series.qoid in self['by-series'] : 00455 ret = len(self['by-series'][series.qoid]) == series.album_set.count() 00456 elif not self.loaded : 00457 ret = series.has_library_complete(self.library_id) 00458 return ret 00459 def get_row_colors( self, row ) :
| def py::gui::models::flat_library::get_row_colors | ( | self, | ||
| row | ||||
| ) |
string py::gui::models::flat_library::album_related = "album__" [static] |
Reimplemented from py::gui::models::flat_catalog.
1.5.3