Module Import alias ImportFrom alias Import alias ImportFrom alias Import alias Import alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Assign AttributeStore NameLoad attr BoolOpOr NameLoad Dict decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Return BoolOpAnd Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad CompareEq Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body If Call NameLoad NameLoad Str body If Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr orelse Assign NameStore NameLoad If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad Str attr Call NameLoad NameLoad Call NameLoad NameLoad If Call AttributeLoad NameLoad attr NameLoad NameLoad body Expr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad attr Dict Str NameLoad orelse Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Dict Str Str Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Delete SubscriptDel AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad BinOpSub BinOpAdd NameLoad SubscriptLoad NameLoad Index Str Num Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Call AttributeLoad NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Call NameLoad kwarg body Expr Str If Call AttributeLoad NameLoad attr Str NameLoad body Raise Call NameLoad Str If CompareIn Str NameLoad body Raise Call NameLoad Str If CompareIn Str NameLoad body Raise Call NameLoad Str Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Num Assign NameStore Num While NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad For NameStore NameLoad body Expr Yield NameLoad AugAssignAdd NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad BinOpSub Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If NameLoad body Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str Assign SubscriptStore NameLoad Index Str Num decorator_list Assign NameStore Call AttributeLoad NameLoad attr ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If UnaryOpNot Call NameLoad NameLoad Str body Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam defaults body TryExcept body Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore AttributeLoad NameLoad attr attr Call NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assert AttributeLoad NameLoad attr Delete SubscriptDel AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list
N/A N/A base64 copy copy N/A hashlib mimetypes guess_type N/A datetime N/A threading CouchAttachmentsBuilder N/A object N/A N/A 
    Helper for saving attachments on doc save rather than as a separate step.
    Example usage:

    Instead of the normal 1 + N request save where N is the # of attachments:

        foo = Foo()
        foo.save()
        foo.put_attachment(
            name=filename,
            content=content,
            content_type=mime_type
        )

    You can use the following to do a single-request save:

        foo = Foo()

        attachment_builder = CouchAttachmentsBuilder(foo._attachments)
        attachment_builder.add(
            name=filename,
            content=content,
            content_type=mime_type
        )
        foo._attachments = attachment_builder.to_json()

        foo.save(encode_attachments=False)


        # or bulk save
        Foo.get_db().bulk_save([foo, ...])

    NB: If you save without encode_attachments=False
    (here or later on down the line)
    then your attachment content will end up base64 encoded!
    That's a real thing that's happened in the past,
    so be careful who you're passing this object on to!
    (Think signals, etc. where you have no control over who uses it next
    and how/whether they call .save() on the object.)

     __init__ N/A N/A self original N/A None N/A N/A N/A self _dict N/A original N/A N/A couch_style_digest N/A N/A data N/A N/A N/A N/A N/A md5-{} format N/A N/A base64 b64encode N/A N/A N/A N/A hashlib md5 data digest N/A staticmethod no_change N/A N/A self name data N/A N/A N/A N/A N/A N/A N/A self _dict get name N/A N/A N/A N/A N/A self _dict N/A name get digest N/A N/A self couch_style_digest data N/A add N/A N/A self content name content_type N/A None None N/A N/A N/A hasattr content read N/A N/A N/A hasattr content seek N/A N/A N/A N/A content seek 0 N/A data N/A N/A content read N/A N/A data content N/A N/A isinstance data unicode N/A N/A data N/A N/A data encode utf-8 N/A N/A content_type None N/A N/A content_type N/A N/A ; join N/A filter None N/A guess_type name N/A N/A N/A self no_change name data N/A N/A N/A N/A N/A N/A self _dict N/A name update N/A content_type content_type N/A N/A N/A N/A self _dict N/A name N/A data content_type N/A N/A base64 b64encode data content_type N/A remove N/A N/A self name N/A N/A N/A 
        raises a `KeyError` if there's no attachment called `name`
         N/A N/A N/A self _dict N/A name N/A to_json N/A N/A self N/A N/A N/A N/A copy N/A self _dict N/A N/A PaginateViewLogHandler N/A object N/A log N/A N/A self message N/A N/A N/A N/A view_starting N/A N/A self db view_name kwargs total_emitted N/A N/A N/A N/A N/A self log N/A N/A Fetching rows {}-{} from couch format total_emitted N/A N/A total_emitted N/A kwargs N/A limit 1 N/A startkey N/A N/A kwargs get startkey N/A N/A N/A self log N/A N/A   startkey={!r}, startkey_docid={!r} format startkey N/A N/A kwargs get startkey_docid N/A view_ending N/A N/A self db view_name kwargs total_emitted time N/A N/A N/A N/A N/A self log N/A N/A View call took {} format time N/A N/A paginate_view N/A N/A db view_name chunk_size log_handler N/A N/A PaginateViewLogHandler view_kwargs N/A N/A 
    intended as a more performant drop-in replacement for

        iter(db.view(view_name, **kwargs))

    intended specifically to be more performant when dealing with
    large numbers of rows

    Note: If the contents of the couch view do not change over the duration of
    the paginate_view call, this is guaranteed to have the same results
    as a direct view call. If the view is updated, however,
    paginate_views may skip docs that were added/updated during this period
    or may include docs that were removed/updated during this period.
    For this reason, it's best to use this with views that update infrequently
    or that are sorted by date modified and/or add-only,
    or when exactness is not a strict requirement

    chunk_size is how many docs to fetch per request to couchdb

     N/A N/A N/A view_kwargs get reduce True N/A N/A N/A ValueError paginate_view must be called with reduce=False N/A N/A limit view_kwargs N/A N/A N/A ValueError paginate_view cannot be called with limit N/A N/A skip view_kwargs N/A N/A N/A ValueError paginate_view cannot be called with skip N/A N/A view_kwargs N/A limit chunk_size N/A total_emitted 0 N/A len_results -1 N/A len_results N/A N/A N/A N/A log_handler view_starting db view_name view_kwargs total_emitted N/A start_time N/A N/A N/A datetime datetime utcnow N/A results N/A N/A db view view_name view_kwargs N/A len_results N/A len results N/A result results N/A N/A N/A result N/A total_emitted len_results N/A N/A N/A log_handler view_ending db view_name view_kwargs total_emitted N/A N/A N/A N/A datetime datetime utcnow start_time N/A len_results N/A N/A N/A view_kwargs N/A startkey N/A result N/A key N/A N/A view_kwargs N/A startkey_docid N/A result N/A id N/A N/A view_kwargs N/A skip 1 N/A N/A _override_db N/A N/A threading local OverrideDB N/A object N/A __init__ N/A N/A self document_class database N/A N/A N/A N/A self document_class document_class N/A N/A self database database N/A N/A self orig_database None N/A N/A self orig_get_db None N/A N/A N/A hasattr _override_db class_to_db N/A N/A N/A _override_db class_to_db N/A N/A __enter__ N/A N/A self N/A N/A N/A N/A N/A N/A self orig_database N/A N/A _override_db class_to_db N/A N/A self document_class N/A N/A N/A KeyError N/A N/A N/A self orig_get_db N/A N/A self document_class get_db N/A N/A N/A self document_class get_db N/A classmethod _get_db N/A N/A N/A _override_db class_to_db N/A N/A self document_class N/A self database N/A __exit__ N/A N/A self exc_type exc_val exc_tb N/A N/A N/A N/A N/A self orig_database None N/A N/A N/A N/A _override_db class_to_db N/A N/A self document_class N/A self orig_database N/A N/A N/A self orig_get_db N/A N/A N/A _override_db class_to_db N/A N/A self document_class N/A N/A N/A self document_class get_db N/A self orig_get_db N/A N/A _get_db N/A N/A cls N/A N/A N/A N/A N/A _override_db class_to_db N/A cls N/A