File tree 2 files changed +5
-3
lines changed
baseapp-files/baseapp_files
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ class Meta:
27
27
filterset_class = FileFilter
28
28
29
29
def resolve_file (self , info , ** kwargs ):
30
- return self .file .url
30
+ # return self.file.url
31
+ return info .context .build_absolute_uri (self .file .url )
31
32
32
33
# @classmethod
33
34
# def get_node(cls, info, id):
Original file line number Diff line number Diff line change @@ -29,9 +29,10 @@ class File(TimeStampedModel):
29
29
parent_content_type = models .ForeignKey (
30
30
ContentType ,
31
31
null = True ,
32
+ blank = True ,
32
33
on_delete = models .CASCADE ,
33
34
)
34
- parent_object_id = models .PositiveIntegerField (null = True )
35
+ parent_object_id = models .PositiveIntegerField (null = True , blank = True )
35
36
parent = GenericForeignKey ("parent_content_type" , "parent_object_id" )
36
37
37
38
content_type = models .CharField (max_length = 150 , null = True , blank = True )
@@ -50,7 +51,7 @@ class File(TimeStampedModel):
50
51
created_by = models .ForeignKey (
51
52
settings .AUTH_USER_MODEL ,
52
53
related_name = "files_created" ,
53
- on_delete = models .DO_NOTHING ,
54
+ on_delete = models .CASCADE ,
54
55
null = True ,
55
56
)
56
57
You can’t perform that action at this time.
0 commit comments