'Return a list of identity metadata records, sorted by country name.
:param bool is_verified: filter records by whether or not the
information is verified; ``None`` returns both
Identity metadata records have the following attributes:
:var int id: the record\'s primary key in the ``participant_identities`` table
:var Country country: the country this identity applies to
:var unicode schema_name: the name of the schema that the data itself conforms to
:var bool is_verified: whether or not the information has been verified
The national identity information itself is not included, only
metadata. Use :py:meth:`retrieve_identity_info` to get the actual data.'

def list_identity_metadata(self, is_verified=None):

    return self.db.all(u'\n\n                                                SELECT    pi.id\n                                                                    ,    c.*::countries    AS    country\n                                                                    ,    schema_name\n                                                                    ,    is_verified\n                                                        FROM    participant_identities    pi\n                                                        JOIN    countries    c    ON    pi.country_id=c.id\n                                                    WHERE    participant_id=%s\n                                                            AND    COALESCE(is_verified    =    %s,    true)\n                                        ORDER    BY    c.code\n\n                                ', (self.id, is_verified))
