Skip to content

Commit

Permalink
Merge branch 'release/0.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
b6d committed Jan 15, 2015
2 parents ac621e1 + 627edc3 commit 4dfed20
Show file tree
Hide file tree
Showing 19 changed files with 1,492 additions and 694 deletions.
40 changes: 40 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,46 @@
Changelog
=========

0.4 (2015-01-15)
================

- **Breaking Change:** The ``Schema.dump`` method no longer supports the
``many`` argument. This makes ``many`` consistent with ``ordered`` and
simplifies internals.

- Improve support for serializing linked data:

- Add new field type ``fields.Reference`` for references to linked objects.

- Add new name for ``fields.Nested``: ``fields.Embed``. Deprecate
``fields.Nested`` in favour of ``fields.Embed``.

- Add read-only properties ``many`` and ``ordered`` for schema objects.

- Don't generate docs for internal modules any more - those did clutter up the
documentation of the actual API (the docstrings remain though).

- Implement lazy evaluation and caching of some attributes (affects methods:
``Schema.dump``, ``Embed.pack`` and ``Reference.pack``). This means stuff is
only evaluated if and when really needed, but it also means:

- The very first time data is dumped/packed by a Schema/Embed/Reference
object, there will be a tiny delay. Keep objects around to mitigate this
effect.

- Some errors might surface at a later time. lima mentions this when
raising exceptions though.

- Allow quotes in field names.

- Small speed improvement when serializing collections.

- Remove deprecated field ``fields.type_mapping``. Use ``fields.TYPE_MAPPING``
instead.

- Overall cleanup, improvements and bug fixes.


0.3.1 (2014-11-11)
==================

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014, Bernhard Weitzhofer
Copyright (c) 2014-2015, Bernhard Weitzhofer

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
9 changes: 4 additions & 5 deletions docs/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ like.
exotic column types. There is still work to be done.


.. _field_name_mangling:

Field Name Mangling
===================

Expand All @@ -73,8 +75,8 @@ Fields provided via class attributes have a drawback: class attribute names
have to be valid Python identifiers.

lima implements a simple name mangling mechanism to allow the specification of
some common non-Python-identifier field names (like JSON-LD's ``"@id"``) as
class attributes.
some common non-Python-identifier field names (like `JSON-LD
<http://json-ld.org>`_'s ``"@id"``) as class attributes.

The following table shows how name prefixes will be replaced by lima when
specifying fields as class attributes (note that every one of those prefixes
Expand Down Expand Up @@ -110,9 +112,6 @@ This enables us to do the following:
explicitly how the data for these fields should be determined (see
:ref:`field_data_sources`).

Also, quotes in field names are currently not allowed in lima, regardless
of how they are specified.


Advanced Topics Recap
=====================
Expand Down
27 changes: 1 addition & 26 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,11 @@ lima.fields

.. automodule:: lima.fields
:members:
:exclude-members: TYPE_MAPPING, type_mapping
:exclude-members: TYPE_MAPPING

.. autodata:: lima.fields.TYPE_MAPPING
:annotation: =dict(...)

.. autodata:: lima.fields.type_mapping
:annotation: =dict(...)


.. _api_registry:

lima.registry
=============

.. automodule:: lima.registry
:members:
:exclude-members: global_registry

.. autodata:: lima.registry.global_registry
:annotation: =lima.registry.Registry()


.. _api_schema:

Expand All @@ -64,12 +48,3 @@ lima.schema

.. automodule:: lima.schema
:members:


.. _api_util:

lima.util
=========

.. automodule:: lima.util
:members:
2 changes: 1 addition & 1 deletion docs/fields.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ Or we can change how already supported data types are marshalled:

Also, don't try to override an existing instance method with a static
method. Have a look at the source if in doubt (currently only
:class:`lima.fields.Nested` implements :meth:`pack` as an instance method.
:class:`lima.fields.Embed` implements :meth:`pack` as an instance method.


.. _data_validation:
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Documentation
first_steps
schemas
fields
nested_data
linked_data
advanced
api
project_info
Expand Down
Loading

0 comments on commit 4dfed20

Please sign in to comment.