code: def get_collection(cls):
          
  
          # By default the collection returned will be the published collection,
          # however if the `draft` flag has been set against the global context
          # (e.g `g`) then the collection returned will contain draft documents.
  
          if g.get('draft'):
              return getattr(
                  cls.get_db(),
                  '{collection}_draft'.format(collection=cls._collection)
                  )
  
          return getattr(cls.get_db(), cls._collection)
docs: Return a reference to the database collection for the class