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 :)
_______________________________________________
Patchwork mailing list
[email protected]
https://lists.ozlabs.org/listinfo/patchwork

Reply via email to