
Public Member Functions | |
| def | create_qoid |
| def | build_authors_raw |
| def | build_authors_str |
| def | rebuild_authors_str |
| def | rebuild_all_strs |
| def | is_nextout |
| def | is_latestout |
| def | belongs_to_library |
Public Attributes | |
| authors_raw | |
| authors_str | |
| drawers_raw | |
| drawers_str | |
Static Public Attributes | |
| tuple | qoid = Qoid() |
| tuple | name = StringField() |
| tuple | series = models.ForeignKey(Series) |
| tuple | volume = models.SmallIntegerField() |
| tuple | catalog = models.ForeignKey(CatalogVersion, null=True) |
| list | search_field = ["name", "authors_str", "drawers_str"] |
| tuple | matching = StringField() |
| tuple | authors_raw = StringField() |
| tuple | drawers_raw = StringField() |
| tuple | authors_str = StringField() |
| tuple | drawers_str = StringField() |
| tuple | authors = property(_get_authors,_set_authors) |
| tuple | authors_entities = property(_get_authors_entities,_set_authors_entities) |
| tuple | drawers = property(_get_drawers,_set_drawers) |
| tuple | drawers_entities = property(_get_drawers_entities,_set_drawers_entities) |
| tuple | published_date = models.CharField( maxlength=10, blank=True ) |
| tuple | ean = models.CharField( maxlength=13, blank=True ) |
| tuple | isbn = models.CharField( maxlength=10, blank=True ) |
| tuple | guiding_price = Price(default=0) |
| tuple | published_date_obj = property(_get_published_date_obj) |
| tuple | published_date_str = property(_get_published_date_str) |
| tuple | created_by_user = models.BooleanField(default=False) |
| tuple | deletable = property(_get_deletable) |
Private Member Functions | |
| def | _authors_from_value |
| def | _set_authors |
| def | _get_authors |
| def | _get_authors_entities |
| def | _set_authors_entities |
| def | _set_drawers |
| def | _get_drawers |
| def | _get_drawers_entities |
| def | _set_drawers_entities |
| def | _get_published_date_obj |
| def | _get_published_date_str |
| def | _get_deletable |
| def py::qodb::models::Album::create_qoid | ( | model, | ||
| series, | ||||
| name, | ||||
ensure_new = True, |
||||
| props | ||||
| ) |
00341 : 00342 if "ean" in props and props["ean"] : 00343 id = props["ean"] 00344 elif "isbn" in props and props["isbn"] : 00345 id = props["isbn"] 00346 else : 00347 volume = "" 00348 if "volume" in props and props["volume"] is not None : 00349 volume = str(props["volume"]).replace("-","MINUS") 00350 id = "%s%s%s" % (series.qoid,qo.utils.make_qoid(name) or "DEFAULT",volume) 00351 if ensure_new : 00352 cont = True 00353 nid = id 00354 c = 0 00355 while cont : 00356 try : 00357 model.objects.get(qoid=nid) 00358 except model.DoesNotExist : 00359 cont = False 00360 else : 00361 nid = "%s@%d" % (id,c) 00362 c += 1 00363 cont = True 00364 id = nid 00365 return id 00366 00367 @staticmethod def build_authors_raw( values ) :
| def py::qodb::models::Album::build_authors_raw | ( | values | ) |
| def py::qodb::models::Album::build_authors_str | ( | authors | ) |
| def py::qodb::models::Album::_authors_from_value | ( | self, | ||
| value | ||||
| ) | [private] |
00376 : 00377 authors = [] 00378 fetch_qoid = value 00379 if self.cache : 00380 fetch_qoid = [] 00381 for author_qoid in value : 00382 if author_qoid in self.cache["authors"] : 00383 authors.append(self.cache["authors"][author_qoid]) 00384 else : 00385 fetch_qoid.append(author_qoid) 00386 if len(fetch_qoid) : 00387 authors += Author.objects.filter(qoid__in=fetch_qoid) 00388 return authors 00389 def rebuild_authors_str( self, field="authors" ) :
| def py::qodb::models::Album::rebuild_authors_str | ( | self, | ||
field = "authors" | ||||
| ) |
| def py::qodb::models::Album::rebuild_all_strs | ( | self | ) |
| def py::qodb::models::Album::_set_authors | ( | self, | ||
| value | ||||
| ) | [private] |
| def py::qodb::models::Album::_get_authors | ( | self | ) | [private] |
| def py::qodb::models::Album::_get_authors_entities | ( | self, | ||
field = 'authors' | ||||
| ) | [private] |
| def py::qodb::models::Album::_set_authors_entities | ( | self, | ||
| authors | ||||
| ) | [private] |
| def py::qodb::models::Album::_set_drawers | ( | self, | ||
| value | ||||
| ) | [private] |
| def py::qodb::models::Album::_get_drawers | ( | self | ) | [private] |
| def py::qodb::models::Album::_get_drawers_entities | ( | self | ) | [private] |
| def py::qodb::models::Album::_set_drawers_entities | ( | self, | ||
| drawers | ||||
| ) | [private] |
| def py::qodb::models::Album::_get_published_date_obj | ( | self | ) | [private] |
00436 : 00437 value = self.published_date or "0000-00-00" 00438 [ year, month, day ] = map( int, value.split('-') ) 00439 if year == 0 : 00440 year = datetime.MINYEAR 00441 if month == 0 : 00442 month = 1 00443 if day == 0 : 00444 day = 1 00445 return datetime.date( year, month, day ) published_date_obj = property(_get_published_date_obj)
| def py::qodb::models::Album::_get_published_date_str | ( | self | ) | [private] |
00448 : 00449 value = self.published_date or "0000-00-00" 00450 [ year, month, day ] = map( int, value.split('-') ) 00451 if year > 1900 : 00452 fmt = '%Y' 00453 if month != 0 : 00454 fmt = '%B '+fmt 00455 if day != 0 : 00456 fmt = '%d '+fmt 00457 return qo.utils.decode(self.published_date_obj.strftime(fmt)) published_date_str = property(_get_published_date_str)
| def py::qodb::models::Album::is_nextout | ( | self | ) |
| def py::qodb::models::Album::is_latestout | ( | self | ) |
| def py::qodb::models::Album::belongs_to_library | ( | self, | ||
| library_id | ||||
| ) |
| def py::qodb::models::Album::_get_deletable | ( | self | ) | [private] |
tuple py::qodb::models::Album::qoid = Qoid() [static] |
tuple py::qodb::models::Album::name = StringField() [static] |
tuple py::qodb::models::Album::series = models.ForeignKey(Series) [static] |
tuple py::qodb::models::Album::volume = models.SmallIntegerField() [static] |
tuple py::qodb::models::Album::catalog = models.ForeignKey(CatalogVersion, null=True) [static] |
Reimplemented from py::qodb::models::catalog_interface.
list py::qodb::models::Album::search_field = ["name", "authors_str", "drawers_str"] [static] |
Reimplemented from py::qodb::models::catalog_interface.
tuple py::qodb::models::Album::matching = StringField() [static] |
Reimplemented from py::qodb::models::catalog_interface.
tuple py::qodb::models::Album::authors_raw = StringField() [static] |
tuple py::qodb::models::Album::drawers_raw = StringField() [static] |
tuple py::qodb::models::Album::authors_str = StringField() [static] |
tuple py::qodb::models::Album::drawers_str = StringField() [static] |
tuple py::qodb::models::Album::authors = property(_get_authors,_set_authors) [static] |
tuple py::qodb::models::Album::authors_entities = property(_get_authors_entities,_set_authors_entities) [static] |
tuple py::qodb::models::Album::drawers = property(_get_drawers,_set_drawers) [static] |
tuple py::qodb::models::Album::drawers_entities = property(_get_drawers_entities,_set_drawers_entities) [static] |
tuple py::qodb::models::Album::published_date = models.CharField( maxlength=10, blank=True ) [static] |
tuple py::qodb::models::Album::ean = models.CharField( maxlength=13, blank=True ) [static] |
tuple py::qodb::models::Album::isbn = models.CharField( maxlength=10, blank=True ) [static] |
tuple py::qodb::models::Album::guiding_price = Price(default=0) [static] |
tuple py::qodb::models::Album::published_date_obj = property(_get_published_date_obj) [static] |
tuple py::qodb::models::Album::published_date_str = property(_get_published_date_str) [static] |
tuple py::qodb::models::Album::created_by_user = models.BooleanField(default=False) [static] |
Reimplemented from py::qodb::models::catalog_interface.
tuple py::qodb::models::Album::deletable = property(_get_deletable) [static] |
Reimplemented from py::qodb::models::catalog_interface.
1.5.3