File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1+ Adopting related names on models.
Original file line number Diff line number Diff line change @@ -90,6 +90,9 @@ class PythonDistribution(PublicationDistribution):
9090
9191 TYPE = 'python'
9292
93+ class Meta :
94+ default_related_name = "%(app_label)s_%(model_name)s"
95+
9396
9497class PythonPackageContent (Content ):
9598 """
@@ -146,6 +149,7 @@ def __str__(self):
146149 )
147150
148151 class Meta :
152+ default_related_name = "%(app_label)s_%(model_name)s"
149153 unique_together = ('filename' ,)
150154
151155
@@ -156,6 +160,9 @@ class PythonPublication(Publication):
156160
157161 TYPE = 'python'
158162
163+ class Meta :
164+ default_related_name = "%(app_label)s_%(model_name)s"
165+
159166
160167class PythonRemote (Remote ):
161168 """
@@ -182,3 +189,6 @@ def excludes(self):
182189 Specify exclude list.
183190 """
184191 return ProjectSpecifier .objects .filter (remote = self , exclude = True )
192+
193+ class Meta :
194+ default_related_name = "%(app_label)s_%(model_name)s"
Original file line number Diff line number Diff line change @@ -373,7 +373,7 @@ class PythonPublicationSerializer(core_serializers.PublicationSerializer):
373373 distributions = core_serializers .DetailRelatedField (
374374 help_text = _ ('This publication is currently being hosted as configured by these '
375375 'distributions.' ),
376- source = "pythondistribution_set " ,
376+ source = "python_pythondistribution " ,
377377 many = True ,
378378 read_only = True ,
379379 )
You can’t perform that action at this time.
0 commit comments