I advice you to learn learn Python Language first before you start messing
with Django.
On Mon, Dec 9, 2019 at 2:19 AM Bruckner de Villiers <
bruckner.devilli...@gmail.com> wrote:
> Thank you Daniel. I believe that issue started with VSCode automatically
> inserting “from date time import date ti
Thank you Daniel. I believe that issue started with VSCode automatically
inserting “from date time import date time” after I hit enter on “import date
time”.
Thank you for the quick response.
Bruckner
0836251086
> On 09 Dec 2019, at 10:38, Daniel Hepper wrote:
>
>
> You can fix your code
You can fix your code by changing datetime.timedelta to timedelta:
*def* was_published_recently(self):
return self.pub_date >= timezone.now() - timedelta(days=1)
The statement "from datetime import datetime, timedelta" imports the
classes datetime and timedelta from the module dateti
Your timedelta import is correct but usage of the timedelta is not.
Replace "datetime.timedelta(days=1)" with "timedelta(days=1)"
Saygılarımla,
Sencer HAMARAT
On Mon, Dec 9, 2019 at 11:24 AM Bruckner de Villiers
wrote:
> Running Django 3.0 & Python 3.7.3
>
> Everything works per the tutoria
Running Django 3.0 & Python 3.7.3
Everything works per the tutorial until I get to:
q.was_published_recently()
It throws the following error:
File
"/Volumes/Data/DevelopmentTraining/django_tutorials/mysite/polls/models.py",
line 19, in was_published_recently
return self.pub_date >= timez
5 matches
Mail list logo