File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
django-stubs/contrib/contenttypes Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,11 @@ class GenericRelation(ForeignObject[Any]):
84
84
content_type_field_name : Any = ...
85
85
for_concrete_model : Any = ...
86
86
to_fields : Any = ...
87
+ def __new__ (
88
+ cls ,
89
+ * args : Any ,
90
+ ** kwargs : Any
91
+ ) -> GenericRelation : ...
87
92
def __init__ (
88
93
self ,
89
94
to : Union [Type [Model ], str ],
Original file line number Diff line number Diff line change 8
8
9
9
import psycopg2
10
10
from django .contrib .auth .models import User as AuthUser
11
+ from django .contrib .contenttypes .fields import GenericRelation
11
12
from django .contrib .postgres .fields import (
12
13
ArrayField ,
13
14
CICharField ,
@@ -234,6 +235,12 @@ class Comment(models.Model):
234
235
null = True
235
236
)
236
237
238
+ generic_relation = GenericRelation (
239
+ "Post" ,
240
+ content_type_field = "generic_ct" ,
241
+ object_id_field = "generic_id" ,
242
+ )
243
+
237
244
238
245
def process_non_nullable (
239
246
x : Union [
You can’t perform that action at this time.
0 commit comments