forked from MarseyWorld/MarseyWorld
use `self.__class__.__name__` for `__repr__`
parent
87c4d2cb6b
commit
e9887059d1
|
@ -19,4 +19,4 @@ class Alt(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Alt(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
|
|
@ -29,7 +29,7 @@ class AwardRelationship(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<AwardRelationship(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -21,7 +21,7 @@ class BadgeDef(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<BadgeDef(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
@ -48,7 +48,7 @@ class Badge(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Badge(user_id={self.user_id}, badge_id={self.badge_id})>"
|
||||
return f"<{self.__class__.__name__}(user_id={self.user_id}, badge_id={self.badge_id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -28,7 +28,7 @@ class Casino_Game(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<CasinoGame(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -29,8 +29,7 @@ class OauthApp(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<OauthApp(id={self.id})>"
|
||||
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -81,7 +81,7 @@ class Comment(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Comment(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
||||
@lazy
|
||||
def top_comment(self, db:scoped_session):
|
||||
|
|
|
@ -16,4 +16,4 @@ class BannedDomain(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<BannedDomain(domain={self.domain})>"
|
||||
return f"<{self.__class__.__name__}(domain={self.domain})>"
|
||||
|
|
|
@ -20,4 +20,4 @@ class Exile(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Exile(user_id={self.user_id}, sub={self.sub})>"
|
||||
return f"<{self.__class__.__name__}(user_id={self.user_id}, sub={self.sub})>"
|
||||
|
|
|
@ -23,7 +23,7 @@ class Flag(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Flag(user_id={self.user_id}, post_id={self.post_id})>"
|
||||
return f"<{self.__class__.__name__}(user_id={self.user_id}, post_id={self.post_id})>"
|
||||
|
||||
@lazy
|
||||
def realreason(self, v):
|
||||
|
@ -45,7 +45,7 @@ class CommentFlag(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<CommentFlag(user_id={self.user_id}, comment_id={self.comment_id})>"
|
||||
return f"<{self.__class__.__name__}(user_id={self.user_id}, comment_id={self.comment_id})>"
|
||||
|
||||
@lazy
|
||||
def realreason(self, v):
|
||||
|
|
|
@ -20,4 +20,4 @@ class Follow(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Follow(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
|
|
@ -27,7 +27,7 @@ class HatDef(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<HatDef(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
||||
@lazy
|
||||
def number_sold(self, db:scoped_session):
|
||||
|
@ -59,7 +59,7 @@ class Hat(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Hat(user_id={self.user_id}, hat_id={self.hat_id})>"
|
||||
return f"<{self.__class__.__name__}(user_id={self.user_id}, hat_id={self.hat_id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -23,7 +23,7 @@ class Lottery(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Lottery(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -20,7 +20,7 @@ class Marsey(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Marsey(name={self.name})>"
|
||||
return f"<{self.__class__.__name__}(name={self.name})>"
|
||||
|
||||
def tags_list(self):
|
||||
return self.tags.split(" ") + [self.name[len("marsey"):]] # type: ignore
|
||||
|
|
|
@ -17,4 +17,4 @@ class Media(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Media(kind={self.kind}, filename={self.filename})>"
|
||||
return f"<{self.__class__.__name__}(kind={self.kind}, filename={self.filename})>"
|
||||
|
|
|
@ -17,4 +17,4 @@ class Mod(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Mod(user_id={self.user_id}, sub={self.sub})>"
|
||||
return f"<{self.__class__.__name__}(user_id={self.user_id}, sub={self.sub})>"
|
||||
|
|
|
@ -31,7 +31,7 @@ class ModAction(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<ModAction(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -22,4 +22,4 @@ class Notification(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Notification(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
|
|
@ -24,7 +24,7 @@ class SubmissionOption(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<SubmissionOption(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
@ -53,7 +53,7 @@ class SubmissionOptionVote(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<SubmissionOptionVote(option_id={self.option_id}, user_id={self.user_id})>"
|
||||
return f"<{self.__class__.__name__}(option_id={self.option_id}, user_id={self.user_id})>"
|
||||
|
||||
|
||||
class CommentOption(Base):
|
||||
|
@ -74,7 +74,7 @@ class CommentOption(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<CommentOption(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
@ -103,4 +103,4 @@ class CommentOptionVote(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<CommentOptionVote(option_id={self.option_id}, user_id={self.user_id})>"
|
||||
return f"<{self.__class__.__name__}(option_id={self.option_id}, user_id={self.user_id})>"
|
||||
|
|
|
@ -20,7 +20,7 @@ class SaveRelationship(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<SaveRelationship(user_id={self.user_id}, submission_id={self.submission_id})>"
|
||||
return f"<{self.__class__.__name__}(user_id={self.user_id}, submission_id={self.submission_id})>"
|
||||
|
||||
|
||||
class CommentSaveRelationship(Base):
|
||||
|
@ -38,4 +38,4 @@ class CommentSaveRelationship(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<CommentSaveRelationship(user_id={self.user_id}, comment_id={self.comment_id})>"
|
||||
return f"<{self.__class__.__name__}(user_id={self.user_id}, comment_id={self.comment_id})>"
|
||||
|
|
|
@ -15,4 +15,4 @@ class Streamer(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Streamer(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
|
|
@ -31,7 +31,7 @@ class SubAction(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<SubAction(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -74,7 +74,7 @@ class Submission(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Submission(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -20,4 +20,4 @@ class Subscription(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Subscription(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
|
|
@ -13,4 +13,4 @@ class Transaction(Base):
|
|||
claimed = Column(Boolean)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Transaction(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id})>"
|
||||
|
|
|
@ -168,7 +168,7 @@ class User(Base):
|
|||
|
||||
|
||||
def __repr__(self):
|
||||
return f"<User(id={self.id}, username={self.username})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id}, username={self.username})>"
|
||||
|
||||
def pay_account(self, currency, amount):
|
||||
if currency == 'coins':
|
||||
|
|
|
@ -20,4 +20,4 @@ class UserBlock(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<UserBlock(user={self.user_id}, target={self.target_id})>"
|
||||
return f"<{self.__class__.__name__}(user={self.user_id}, target={self.target_id})>"
|
||||
|
|
|
@ -24,7 +24,7 @@ class ViewerRelationship(Base):
|
|||
super().__init__(**kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<ViewerRelationship(user_id={self.user_id}, viewer_id={self.viewer_id})>"
|
||||
return f"<{self.__class__.__name__}(user_id={self.user_id}, viewer_id={self.viewer_id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -25,7 +25,7 @@ class Vote(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Vote(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id}, vote_type={self.vote_type})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
@ -56,7 +56,7 @@ class CommentVote(Base):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<CommentVote(id={self.id})>"
|
||||
return f"<{self.__class__.__name__}(id={self.id}, vote_type={self.vote_type})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
Loading…
Reference in New Issue