rough-minister-58256
04/25/2017, 6:13 PMrough-minister-58256
04/25/2017, 10:57 PM@classmethod
on Target
subclasses to generate the initial Payload
object given kwargs - which would be called by Target.__init__()
rather than taking payload
as a kwarg. then the Payload
fields would be the fields we could inherently externalize - so we’d have SourcesField
and e.g. DependenciesField
etc.rough-minister-58256
04/25/2017, 10:58 PMdef payload_factory(cls, kwargs)
etcrough-minister-58256
04/25/2017, 11:03 PMPayload
the Target.__init__()
in subclasses could do all of the other stuff that happens there today like setting private attrs and whatnotrough-minister-58256
04/25/2017, 11:07 PMTarget.create_sources_field
seems like it should clearly be a @classmethod
since it carries this warning: Note that this method is called before the call to Target.__init__ so don't expect fields to be populated!
witty-crayon-22786
04/25/2017, 11:07 PMwitty-crayon-22786
04/25/2017, 11:08 PMrough-minister-58256
04/25/2017, 11:08 PMfancy-queen-20734
04/25/2017, 11:09 PMwitty-crayon-22786
04/25/2017, 11:09 PMrough-minister-58256
04/25/2017, 11:11 PMdef payload_factory(cls, kwargs, fields=ALL)
and then given specific fields it would compute and return partial Payload
objects which would open way to more granular field product requests?fancy-queen-20734
04/25/2017, 11:12 PMfancy-queen-20734
04/25/2017, 11:13 PMrough-minister-58256
04/25/2017, 11:13 PMTarget
subclasses __init__
methods too so we don’t double computewitty-crayon-22786
04/25/2017, 11:14 PMrough-minister-58256
04/25/2017, 11:14 PMrough-minister-58256
04/25/2017, 11:14 PMrough-minister-58256
04/25/2017, 11:15 PMwitty-crayon-22786
04/25/2017, 11:15 PMwitty-crayon-22786
04/25/2017, 11:15 PMwitty-crayon-22786
04/25/2017, 11:15 PMrough-minister-58256
04/25/2017, 11:16 PMSourcesField
vs another that emits a DependenciesField
fancy-queen-20734
04/25/2017, 11:16 PMfancy-queen-20734
04/25/2017, 11:16 PMrough-minister-58256
04/25/2017, 11:16 PMwitty-crayon-22786
04/25/2017, 11:16 PM@classmethod def fields
required, and without any parameters (and thus probably no logic)witty-crayon-22786
04/25/2017, 11:17 PMwitty-crayon-22786
04/25/2017, 11:17 PMwitty-crayon-22786
04/25/2017, 11:17 PMfancy-queen-20734
04/25/2017, 11:18 PM