not mentioned in a remote update should get deleted.
This is rarely important in practice, but we should support it.
This commit fixes that problem, but breaks the tests. Thus it
lives in a side branch until someone gets around to implementing
it.
The specific breakage is that AcObject has no __delitem__() method.
It probably should have one for completeness, even apart from this
particular issue.
There should be tests specifically for this problem in test_update.
Because of this, the side_effect routines take **kwargs,
as does run_side_effects() in AcObject.
The side_effect routine for Update can update cached data for remote objects.
It doesn't attempt to modify the "id" or "type" fields on any object.
AcObject gains an items() method, by analogy with dicts etc.
It's just syntactic sugar around activity_form.
This was introduced in commit 047aec. AcActor's activity_form() expects to get
a field named "publicKey" from its parent method, and to rearrange that.
But renaming f_publicKey to publicKey meant that the parent method
assumed it wasn't public, and didn't put it into its result.
Test included.
Closes issue #35.
"f_publicKey" would mean it can be set automatically. Because it's
typically a JSON object, it can't be represented with a simple type,
so it can't be set automatically; it must be represented in ThingField.
This didn't make a practical difference before, but since commit 6ce087
create() has honoured the "f_*" convention.
then sets the others by subscripting.
"As many fields as it can" means
- the id field
- any field whose name begins with "f_".
Previously, create() filled in as few fields as it could
(typically only the id, if supplied), then set the others by subscripting.
This change increases efficiency, but also allows the save() method
of AcObject and its subclasses to take account of the intial values of
the f_* fields.
is now only applied to incoming activities, as the spec requires.
For local activities, the actor is *always* told about their own activities.
Tests updated.
views.Statuses works with this, for a single status. (Retrieving multiple statuses still needs adding.)
trilby's url.py gains /api/v1/statuses/<id>.
And tests for the above.
on a template defined in settings. Also, code which needs it refactored to use it.
Similarly, a function chapeau.kepi.utils.configured_path().
is_short_id() and short_id_to_url() moved into chapeau.kepi.utils
from chapeau.kepi.find.
Fieldnames changed to USER_LINK instead of USER_URL_FORMAT etc.
Relevant modifications to tests.