def update(self, REQUEST=None):
     """
     """
     alsoProvides(REQUEST, IDisableCSRFProtection)
     self.updateHebergement()
     self.updateCommune()
     self.updateType()
     memcache = memcachedClient()
     memcache.invalidateAll()
def updateHebsSortOrder():
    session = DBSession()

    query = session.query(Hebergement).join("app")
    query = query.order_by(func.random())

    position = 1
    for heb in query.all():
        heb.app.heb_app_sort_order = position
        session.add(heb)
        position += 1

    session.commit()
    session.flush()

    memcache = memcachedClient()
    memcache.invalidateAll()