I'm following this 
<https://docs.djangoproject.com/en/3.1/intro/tutorial05/#testing-our-new-view> 
Django tutorial. So far I haven't had an issue so far, but now I'm not 
really sure if I understood it correctly. We created a shortcut function to 
create questions, but I thought that it was meant to be user-side and when 
I use 'runserver', on the website there's no such option, only the 
previously created question. This is the code for the function:
def create_question(question_text, days): """ Create a question with the 
given `question_text` and published the given number of `days` offset to 
now (negative for questions published in the past, positive for questions 
that have yet to be published). """ time = timezone.now() + 
datetime.timedelta(days=days) return 
Question.objects.create(question_text=question_text, pub_date=time) 

Did I get it wrong? This function is only admin-sided? It's on 
'polls/test.py' and it's outside every class.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f4dfe964-3417-4605-af26-d99a0d8fa4b5n%40googlegroups.com.

Reply via email to