store Operation.date as a datetime.date object
This commit is contained in:
parent
6544bbfcdc
commit
5ffd892a3d
1 changed files with 8 additions and 3 deletions
|
|
@ -18,6 +18,8 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
from datetime import date
|
||||||
|
|
||||||
from weboob.tools.browser import BasePage
|
from weboob.tools.browser import BasePage
|
||||||
from weboob.capabilities.bank import Account
|
from weboob.capabilities.bank import Account
|
||||||
from weboob.capabilities.bank import Transaction
|
from weboob.capabilities.bank import Transaction
|
||||||
|
|
@ -49,7 +51,7 @@ class AccountsPage(BasePage):
|
||||||
first_td = tr.getchildren()[0]
|
first_td = tr.getchildren()[0]
|
||||||
if first_td.attrib.get('class', '') == 'i g' or first_td.attrib.get('class', '') == 'p g':
|
if first_td.attrib.get('class', '') == 'i g' or first_td.attrib.get('class', '') == 'p g':
|
||||||
account = Account()
|
account = Account()
|
||||||
account.label = u"%s"%first_td.find('a').text
|
account.label = u"%s"%first_td.find('a').text.strip()
|
||||||
account.link_id = first_td.find('a').get('href', '')
|
account.link_id = first_td.find('a').get('href', '')
|
||||||
account.id = first_td.find('a').text.split(' ')[0]+first_td.find('a').text.split(' ')[1]
|
account.id = first_td.find('a').text.split(' ')[0]+first_td.find('a').text.split(' ')[1]
|
||||||
s = tr.getchildren()[2].text
|
s = tr.getchildren()[2].text
|
||||||
|
|
@ -78,8 +80,11 @@ class OperationsPage(BasePage):
|
||||||
if first_td.attrib.get('class', '') == 'i g' or first_td.attrib.get('class', '') == 'p g':
|
if first_td.attrib.get('class', '') == 'i g' or first_td.attrib.get('class', '') == 'p g':
|
||||||
operation = Transaction(index)
|
operation = Transaction(index)
|
||||||
index += 1
|
index += 1
|
||||||
operation.date = first_td.text
|
|
||||||
operation.raw = u"%s"%tr.getchildren()[2].text.replace('\n',' ')
|
d = first_td.text.strip().split('/')
|
||||||
|
operation.date = date(*reversed([int(x) for x in d]))
|
||||||
|
|
||||||
|
operation.raw = u"%s"%tr.getchildren()[2].text.replace('\n',' ').strip()
|
||||||
if len(tr.getchildren()[3].text) > 2:
|
if len(tr.getchildren()[3].text) > 2:
|
||||||
s = tr.getchildren()[3].text
|
s = tr.getchildren()[3].text
|
||||||
elif len(tr.getchildren()[4].text) > 2:
|
elif len(tr.getchildren()[4].text) > 2:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue