Example #1
0
    def put(self, *args, **kw):
        new_model = kw_to_sqlalchemy(model.JobAlchemy, kw)

        prepare_job_for_address_update(new_model)
        kw = sqlalchemy_to_kw(new_model)

        return EasyCrudRestController.put(self, *args, **kw)
Example #2
0
    def put(self, *args, **kw):
        new_model = kw_to_sqlalchemy(model.JobAlchemy, kw)

        prepare_job_for_address_update(new_model)
        kw = sqlalchemy_to_kw(new_model)

        return EasyCrudRestController.put(self, *args, **kw)
Example #3
0
    def put(self, *args, **kw):
        # TODO: Could this test be removed if 'publication_datetime_is_fake'
        # TODO: was False by default and un-nullable
        if not kw['publication_datetime_is_fake']:
            kw['publication_datetime_is_fake'] = False

        old_model = model.JobAlchemy.get_job_offer(kw['id'])
        new_model = kw_to_sqlalchemy(model.JobAlchemy, kw)

        # Check if the address has been modified. If it's the case, then
        # prepare the kw dict before insertion.
        if old_model.address != new_model.address:
            prepare_job_for_address_update(new_model)

        kw = sqlalchemy_to_kw(new_model)

        return EasyCrudRestController.put(self, *args, **kw)
Example #4
0
    def put(self, *args, **kw):
        # TODO: Could this test be removed if 'publication_datetime_is_fake'
        # TODO: was False by default and un-nullable
        if not kw['publication_datetime_is_fake']:
            kw['publication_datetime_is_fake'] = False

        old_model = model.JobAlchemy.get_job_offer(kw['id'])
        new_model = kw_to_sqlalchemy(model.JobAlchemy, kw)

        # Check if the address has been modified. If it's the case, then
        # prepare the kw dict before insertion.
        if old_model.address != new_model.address:
            prepare_job_for_address_update(new_model)

        kw = sqlalchemy_to_kw(new_model)

        return EasyCrudRestController.put(self, *args, **kw)