File tree Expand file tree Collapse file tree 1 file changed +37
-3
lines changed Expand file tree Collapse file tree 1 file changed +37
-3
lines changed Original file line number Diff line number Diff line change 55
66
77class LinkCounter (models .Model ):
8+ """
9+ Represents a count of links sent by a user.
10+
11+ Attributes
12+ ----------
13+ requester : OneToOneField
14+ A one-to-one relationship with the user who made the request.
15+ sent_count : int
16+ The total number of links sent by the requester.
17+
18+ Methods
19+ -------
20+ __str__() -> str:
21+ Returns the username of the requester as a string.
22+
23+ __repr__() -> str:
24+ Returns the username of the requester for representation.
25+ """
26+
827 requester = models .OneToOneField (USER , on_delete = models .CASCADE )
928 sent_count = models .IntegerField ()
1029
11- def __str__ (self ):
12- return str (self .requester .get_username ())
30+ def __str__ (self ) -> str :
31+ """
32+ Returns the username of the requester when converting the object to a string.
1333
14- def __repr__ (self ):
34+ Returns
35+ -------
36+ str
37+ The username of the requester.
38+ """
1539 return str (self .requester .get_username ())
1640
41+ def __repr__ (self ) -> str :
42+ """
43+ Returns a string representation of the LinkCounter instance.
44+
45+ Returns
46+ -------
47+ str
48+ The username of the requester.
49+ """
50+ return str (self .requester .get_username ())
You can’t perform that action at this time.
0 commit comments