Project

Profile

Help

Story #5574

Updated by gmbnomis about 5 years ago

Due to issue #5562, pulpcore_plugin proposes a convention for the @ref_name@ attribute of serializer @Meta@ classes. 

 Ideally, all serializers defined by plugins would use this convention automatically. That seems hard to achieve, since the content of @ref_name@ needs to be computed dynamically based on other attributes. 

 However, we can provide a class decorator @plugin_ref_name@ in pulpcore-plugin that sets @ref_name@ according to the convention. This defines the convention at a central location. 

 A plugin will have to declare its serializers like this: 

 <pre><code class="python"> 
 class PluginRemoteSerializer(RemoteSerializer): 

     @plugin_ref_name 
     class Meta: 
         model = PluginRemote CookbookRemote 
 </code></pre> 





Back