2013-12-17 08:42:53 +00:00
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
|
|
|
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
|
|
|
|
|
<title>accounting.storage — Accounting API 0.1-beta documentation</title>
|
|
|
|
|
2013-12-20 15:00:09 +00:00
|
|
|
<link rel="stylesheet" href="../../_static/flasky.css" type="text/css" />
|
2013-12-17 08:42:53 +00:00
|
|
|
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
var DOCUMENTATION_OPTIONS = {
|
|
|
|
URL_ROOT: '../../',
|
|
|
|
VERSION: '0.1-beta',
|
|
|
|
COLLAPSE_INDEX: false,
|
|
|
|
FILE_SUFFIX: '.html',
|
|
|
|
HAS_SOURCE: true
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript" src="../../_static/jquery.js"></script>
|
|
|
|
<script type="text/javascript" src="../../_static/underscore.js"></script>
|
|
|
|
<script type="text/javascript" src="../../_static/doctools.js"></script>
|
|
|
|
<link rel="top" title="Accounting API 0.1-beta documentation" href="../../index.html" />
|
2013-12-20 15:00:09 +00:00
|
|
|
<link rel="up" title="Module code" href="../index.html" />
|
|
|
|
|
|
|
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9">
|
|
|
|
|
2013-12-17 08:42:53 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2013-12-20 15:00:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2013-12-17 08:42:53 +00:00
|
|
|
<div class="related">
|
|
|
|
<h3>Navigation</h3>
|
|
|
|
<ul>
|
|
|
|
<li class="right" style="margin-right: 10px">
|
|
|
|
<a href="../../genindex.html" title="General Index"
|
|
|
|
accesskey="I">index</a></li>
|
2013-12-18 21:46:19 +00:00
|
|
|
<li class="right" >
|
|
|
|
<a href="../../http-routingtable.html" title="HTTP Routing Table"
|
|
|
|
>routing table</a> |</li>
|
2013-12-17 08:42:53 +00:00
|
|
|
<li class="right" >
|
|
|
|
<a href="../../py-modindex.html" title="Python Module Index"
|
|
|
|
>modules</a> |</li>
|
|
|
|
<li><a href="../../index.html">Accounting API 0.1-beta documentation</a> »</li>
|
2013-12-20 15:00:09 +00:00
|
|
|
<li><a href="../index.html" accesskey="U">Module code</a> »</li>
|
2013-12-17 08:42:53 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="document">
|
|
|
|
<div class="documentwrapper">
|
|
|
|
<div class="bodywrapper">
|
|
|
|
<div class="body">
|
|
|
|
|
|
|
|
<h1>Source code for accounting.storage</h1><div class="highlight"><pre>
|
2013-12-20 15:00:09 +00:00
|
|
|
<span class="c"># Part of accounting-api project:</span>
|
|
|
|
<span class="c"># https://gitorious.org/conservancy/accounting-api</span>
|
|
|
|
<span class="c"># License: AGPLv3-or-later</span>
|
|
|
|
|
|
|
|
<span class="kn">from</span> <span class="nn">abc</span> <span class="kn">import</span> <span class="n">ABCMeta</span><span class="p">,</span> <span class="n">abstractmethod</span>
|
|
|
|
|
|
|
|
<span class="kn">from</span> <span class="nn">accounting.exceptions</span> <span class="kn">import</span> <span class="n">AccountingException</span>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="viewcode-block" id="Storage"><a class="viewcode-back" href="../../api/accounting.storage.html#accounting.storage.Storage">[docs]</a><span class="k">class</span> <span class="nc">Storage</span><span class="p">:</span>
|
|
|
|
<span class="sd">'''</span>
|
2013-12-17 08:42:53 +00:00
|
|
|
<span class="sd"> ABC for accounting storage</span>
|
|
|
|
<span class="sd"> '''</span>
|
2013-12-20 15:00:09 +00:00
|
|
|
<span class="n">__metaclass__</span> <span class="o">=</span> <span class="n">ABCMeta</span>
|
2013-12-17 08:42:53 +00:00
|
|
|
|
2013-12-20 15:00:09 +00:00
|
|
|
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">):</span>
|
|
|
|
<span class="k">pass</span>
|
2013-12-17 08:42:53 +00:00
|
|
|
|
2013-12-20 15:00:09 +00:00
|
|
|
<span class="nd">@abstractmethod</span>
|
|
|
|
<div class="viewcode-block" id="Storage.get_transactions"><a class="viewcode-back" href="../../api/accounting.storage.html#accounting.storage.Storage.get_transactions">[docs]</a> <span class="k">def</span> <span class="nf">get_transactions</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">):</span>
|
|
|
|
<span class="k">raise</span> <span class="ne">NotImplementedError</span>
|
|
|
|
</div>
|
|
|
|
<span class="nd">@abstractmethod</span>
|
|
|
|
<div class="viewcode-block" id="Storage.get_transaction"><a class="viewcode-back" href="../../api/accounting.storage.html#accounting.storage.Storage.get_transaction">[docs]</a> <span class="k">def</span> <span class="nf">get_transaction</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">):</span>
|
|
|
|
<span class="k">raise</span> <span class="ne">NotImplementedError</span>
|
|
|
|
</div>
|
|
|
|
<span class="nd">@abstractmethod</span>
|
|
|
|
<div class="viewcode-block" id="Storage.get_account"><a class="viewcode-back" href="../../api/accounting.storage.html#accounting.storage.Storage.get_account">[docs]</a> <span class="k">def</span> <span class="nf">get_account</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">):</span>
|
|
|
|
<span class="k">raise</span> <span class="ne">NotImplementedError</span>
|
|
|
|
</div>
|
|
|
|
<span class="nd">@abstractmethod</span>
|
|
|
|
<div class="viewcode-block" id="Storage.get_accounts"><a class="viewcode-back" href="../../api/accounting.storage.html#accounting.storage.Storage.get_accounts">[docs]</a> <span class="k">def</span> <span class="nf">get_accounts</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kw</span><span class="p">):</span>
|
|
|
|
<span class="k">raise</span> <span class="ne">NotImplementedError</span>
|
|
|
|
</div>
|
|
|
|
<span class="nd">@abstractmethod</span>
|
|
|
|
<div class="viewcode-block" id="Storage.add_transaction"><a class="viewcode-back" href="../../api/accounting.storage.html#accounting.storage.Storage.add_transaction">[docs]</a> <span class="k">def</span> <span class="nf">add_transaction</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">transaction</span><span class="p">):</span>
|
|
|
|
<span class="k">raise</span> <span class="ne">NotImplementedError</span>
|
|
|
|
</div>
|
|
|
|
<span class="nd">@abstractmethod</span>
|
|
|
|
<div class="viewcode-block" id="Storage.update_transaction"><a class="viewcode-back" href="../../api/accounting.storage.html#accounting.storage.Storage.update_transaction">[docs]</a> <span class="k">def</span> <span class="nf">update_transaction</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">transaction</span><span class="p">):</span>
|
|
|
|
<span class="k">raise</span> <span class="ne">NotImplementedError</span>
|
|
|
|
</div>
|
|
|
|
<span class="nd">@abstractmethod</span>
|
|
|
|
<div class="viewcode-block" id="Storage.delete_transaction"><a class="viewcode-back" href="../../api/accounting.storage.html#accounting.storage.Storage.delete_transaction">[docs]</a> <span class="k">def</span> <span class="nf">delete_transaction</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">transaction_id</span><span class="p">):</span>
|
|
|
|
<span class="k">raise</span> <span class="ne">NotImplementedError</span>
|
|
|
|
</div>
|
|
|
|
<span class="nd">@abstractmethod</span>
|
|
|
|
<div class="viewcode-block" id="Storage.reverse_transaction"><a class="viewcode-back" href="../../api/accounting.storage.html#accounting.storage.Storage.reverse_transaction">[docs]</a> <span class="k">def</span> <span class="nf">reverse_transaction</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">transaction_id</span><span class="p">):</span>
|
|
|
|
<span class="k">raise</span> <span class="ne">NotImplementedError</span>
|
2013-12-17 08:42:53 +00:00
|
|
|
|
2013-12-20 15:00:09 +00:00
|
|
|
</div></div>
|
|
|
|
<div class="viewcode-block" id="TransactionNotFound"><a class="viewcode-back" href="../../api/accounting.storage.html#accounting.storage.TransactionNotFound">[docs]</a><span class="k">class</span> <span class="nc">TransactionNotFound</span><span class="p">(</span><span class="n">AccountingException</span><span class="p">):</span>
|
|
|
|
<span class="k">pass</span></div>
|
|
|
|
</pre></div>
|
2013-12-17 08:42:53 +00:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="sphinxsidebar">
|
|
|
|
<div class="sphinxsidebarwrapper">
|
2013-12-20 15:00:09 +00:00
|
|
|
<p class="logo"><a href="../../index.html">
|
|
|
|
<img class="logo" src="../../_static/accounting-api-logo.png" alt="Logo"/>
|
|
|
|
</a></p><h3>Related Topics</h3>
|
|
|
|
<ul>
|
|
|
|
<li><a href="../../index.html">Documentation overview</a><ul>
|
|
|
|
<li><a href="../index.html">Module code</a><ul>
|
|
|
|
</ul></li>
|
|
|
|
</ul></li>
|
|
|
|
</ul>
|
2013-12-17 08:42:53 +00:00
|
|
|
<div id="searchbox" style="display: none">
|
|
|
|
<h3>Quick search</h3>
|
|
|
|
<form class="search" action="../../search.html" method="get">
|
|
|
|
<input type="text" name="q" />
|
|
|
|
<input type="submit" value="Go" />
|
|
|
|
<input type="hidden" name="check_keywords" value="yes" />
|
|
|
|
<input type="hidden" name="area" value="default" />
|
|
|
|
</form>
|
|
|
|
<p class="searchtip" style="font-size: 90%">
|
|
|
|
Enter search terms or a module, class or function name.
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<script type="text/javascript">$('#searchbox').show(0);</script>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="clearer"></div>
|
|
|
|
</div>
|
2013-12-20 15:00:09 +00:00
|
|
|
<div class="footer">
|
|
|
|
© Copyright 2013, Joar Wandborg.
|
|
|
|
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
|
|
|
|
</div>
|
|
|
|
|
2013-12-17 08:42:53 +00:00
|
|
|
</body>
|
|
|
|
</html>
|