chore(dao): Replace save/overwrite with create/update respectively (#24467)

This commit is contained in:
John Bodley
2023-08-11 12:55:39 -07:00
committed by GitHub
parent a3d72e0ec7
commit ed0d288ccd
22 changed files with 196 additions and 194 deletions

View File

@@ -14,7 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# pylint: disable=arguments-renamed
from __future__ import annotations
import logging
@@ -54,18 +53,6 @@ class ChartDAO(BaseDAO[Slice]):
db.session.rollback()
raise ex
@staticmethod
def save(slc: Slice, commit: bool = True) -> None:
db.session.add(slc)
if commit:
db.session.commit()
@staticmethod
def overwrite(slc: Slice, commit: bool = True) -> None:
db.session.merge(slc)
if commit:
db.session.commit()
@staticmethod
def favorited_ids(charts: list[Slice]) -> list[FavStar]:
ids = [chart.id for chart in charts]