[PATCH v2 07/13] REST: Make 'Patch.state' editable

Andy Doan andy.doan at linaro.org
Tue Nov 29 02:03:37 AEDT 2016


On 11/24/2016 02:01 PM, Stephen Fincane wrote:
>>> +from patchwork.models import State
>>> > > +
>>> > > +STATE_CHOICES = ['-'.join(state.name.lower().split())
>>> > > +                 for state in State.objects.all()]
>> >
>> > This confused me for a moment. I think a more clear way to do this
>> > would be:
>> >
>> >   [x.name.lower().replace(' ', '-') for x in State.objects.all()]
> I considered this, but 'replace' will replace multiple spaces with
> multiple '-'. It's unlikely to happen, but I'd rather avoid the change
> of getting 'hello--world' if possible. I'm happy to reassess that,
> however :)

ah - never mind then :)


More information about the Patchwork mailing list