This is part of my code.
My imports:
import jinja2
from jinja2 import evalcontextfilter, Markup, escape
import os
import hashlib
import logging
import json
import re
import webapp2
from string import *
import random
import hmac
import xlwt
from datetime import datetime, date, time, timedelta
import time as tiempo
from models import *
One of my models:
class Combustible(SqliteModel):
cini = DateTimeField()
cfin = DateTimeField()
And when I execute this line of code:
combus=Combustible.select().where(Combustible.cfin.year==3000).count()
I get this error:
AttributeError: 'DateTimeField' object has no attribute 'year'
I use peewee as orm.
What is driving me crazy is that it doesn't work in one computer but it works fine in another. The python and lib versions are the same.
Anybody can help me?
I would double and triple-check your peewee versions.