Skip to content

Commit

Permalink
change model field from type to item_type
Browse files Browse the repository at this point in the history
  • Loading branch information
kenmoh committed Dec 4, 2023
1 parent 2346aea commit 67b1e65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/services/movie_services.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import datetime
from fastapi import HTTPException, status
from sqlalchemy import desc
from app.models.movie_model import Movie
from app.database import session
from app.forms import AddMovieForm
Expand All @@ -22,7 +23,7 @@ def get_limited_movies_by_type(db: session, item_type: TypeEnum, limit: int):
movies = (
db.query(Movie)
.filter(Movie.item_type == item_type)
.order_by("-created_at")
.order_by(desc(Movie.created_at))
.limit(limit)
.all()
)
Expand Down

0 comments on commit 67b1e65

Please sign in to comment.