Skip to content

Commit

Permalink
fix: notes relationship in point
Browse files Browse the repository at this point in the history
  • Loading branch information
seelengxd committed Sep 22, 2024
1 parent a2a04b6 commit 6bf54c7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backend/src/user_questions/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from sqlalchemy import ForeignKey
from sqlalchemy import ForeignKey, and_
from src.common.base import Base
from sqlalchemy.orm import Mapped, mapped_column, relationship
from sqlalchemy.orm import Mapped, mapped_column, relationship, foreign
from src.notes.models import Note


class UserQuestion(Base):
Expand Down Expand Up @@ -35,6 +36,6 @@ class Point(Base):

notes = relationship(
"Note",
primaryjoin="and_(Event.id == foreign(Note.parent_id), Note.parent_type=='event')",
primaryjoin=and_(id == foreign(Note.parent_id), Note.parent_type == "note"),
backref="point",
)

0 comments on commit 6bf54c7

Please sign in to comment.