PageRenderTime 39ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/indico/MaKaC/fossils/modules.py

https://github.com/davidmorrison/indico
Python | 63 lines | 27 code | 14 blank | 22 comment | 0 complexity | 37d62adde399d15bd7c9176fae7500b3 MD5 | raw file
  1. # -*- coding: utf-8 -*-
  2. ##
  3. ##
  4. ## This file is part of CDS Indico.
  5. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN.
  6. ##
  7. ## CDS Indico is free software; you can redistribute it and/or
  8. ## modify it under the terms of the GNU General Public License as
  9. ## published by the Free Software Foundation; either version 2 of the
  10. ## License, or (at your option) any later version.
  11. ##
  12. ## CDS Indico is distributed in the hope that it will be useful, but
  13. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. ## General Public License for more details.
  16. ##
  17. ## You should have received a copy of the GNU General Public License
  18. ## along with CDS Indico; if not, write to the Free Software Foundation, Inc.,
  19. ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  20. from MaKaC.common.fossilize import IFossil
  21. from MaKaC.common.Conversion import Conversion
  22. from MaKaC.fossils.conference import ICategoryFossil, IConferenceMinimalFossil
  23. class INewsItemFossil(IFossil):
  24. def getId(self):
  25. pass
  26. def getAdjustedCreationDate(self):
  27. pass
  28. getAdjustedCreationDate.convert = Conversion.datetime
  29. getAdjustedCreationDate.name = "creationDate"
  30. def getContent(self):
  31. pass
  32. getContent.name = "text"
  33. def getTitle(self):
  34. pass
  35. def getType(self):
  36. pass
  37. def getHumanReadableType(self):
  38. pass
  39. class IObservedObjectFossil(IFossil):
  40. def getObject(self):
  41. """ Encapsulated Object - either Category or Conference """
  42. getObject.result = {"MaKaC.conference.Category": ICategoryFossil,
  43. "MaKaC.conference.Conference": IConferenceMinimalFossil}
  44. def getWeight(self):
  45. """ Weight of the Observed Object """
  46. def getAdvertisingDelta(self):
  47. """ Time delta """
  48. getAdvertisingDelta.convert = lambda s: s.days
  49. getAdvertisingDelta.name = "delta"