← Back to team overview

launchpad-dev team mailing list archive

Re: tuesday - performance day!

 

> Now, I'd like to ask for some advice. There seem to be three ways of
> fixing this:
>  - (somehow - I don't know the magic) tell lazr.restful to skip some
> attributes (e.g. karma, coc_signed etc) for representations.
> https://bugs.edge.launchpad.net/launchpad-foundations/+bug/251284 -
> makes note of things being removed from representations, but I don't
> know whats involved in doing that (yet). Or I may be misunderstanding
> and actually its an all-or-nothing solution. Leonard, if you could
> comment here (or there) and help enlighten me, I'd really love that :)

lazr.restful will publish an attribute in representations only if it is
tagged with the exported() decorator. If you remove the exported()
decorator from an attribute that attribute will instantly disappear.

But unless the performance problem is catastrophically bad, you want to
un-export an attribute only in the latest version, so as to preserve
backwards compatibility. For that, let me quote my earlier email to
Julian:

---
And here's how to get rid of queue_status in the latest version while
maintaining it in the old versions.

    queue_status = exported(
        Choice(
            title=_('Status'),
            vocabulary=BranchMergeProposalStatus, required=True,
            readonly=True,
            description=_("The current state of the proposal.")),
        ('devel', dict(exported=False)))
---

So you call exported(), but then you take it back, as of a specific
version of the web service.

Leonard

Attachment: signature.asc
Description: This is a digitally signed message part


References