Skip to content

Commit bc65271

Browse files
committed
Removed unnecessary SqlAlchemy model class __eq__ methods
1 parent 7d3f242 commit bc65271

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed
0 Bytes
Binary file not shown.

python-sqlite-sqlalchemy/project/modules/models.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ class Author(Base):
3030
publishers = relationship(
3131
"Publisher", secondary=author_publisher, back_populates="authors"
3232
)
33-
def __eq__(self, other):
34-
author_name = f"{self.first_name} {self.last_name}"
35-
other_name = f"{other.first_name} {other.last_name}"
36-
return author_name == other_name
3733

3834

3935
class Book(Base):
@@ -44,8 +40,6 @@ class Book(Base):
4440
publishers = relationship(
4541
"Publisher", secondary=book_publisher, back_populates="books"
4642
)
47-
def __eq__(self, other):
48-
return self.title == other.title
4943

5044

5145
class Publisher(Base):
@@ -58,6 +52,4 @@ class Publisher(Base):
5852
books = relationship(
5953
"Book", secondary=book_publisher, back_populates="publishers"
6054
)
61-
def __eq__(self, other):
62-
return self.name == other.name
63-
55+

0 commit comments

Comments
 (0)