If you could provide the whole error message it would help us identify where your error is.
On Tuesday, November 22, 2016 at 3:16:51 AM UTC+2, adonis simo wrote:
-- On Tuesday, November 22, 2016 at 3:16:51 AM UTC+2, adonis simo wrote:
Hi django users,
I am new to django and i am using django 1.10, i follow up all the tutorial in the documentation and now i have build an blog application with models like :
Article , Commentaire(comment in english) and Tag. It's working but now i want to add an relation between User (the one who is connected and creating the article)
and the Article but i dont know how to do this . I find on google and try what i see but nothing ran ,
this is my codeAnd when i run
Saisissez le code ici.from django.contrib.auth.models import User..
class Article(models.Model):
titre = models.CharField(max_length=254 )
description = models.TextField()
contenu = models.TextField()
date_publication = models.DateField()
image = models.ImageField(upload_to='blog/static/blog/images/' )
publie = models.BooleanField(default=False ) # par defaut un article n'est pas publier
tag = models.ManyToManyField(Tag)
auteur = models.ForeignKey('auth.User', verbose_name='auteur', default=1)# here is the relationshp creationit give me a long error message with at the end of it :
python manager.py migratePlease help i dont know how to do !!!
TypeError: int() argument must be a string, a bytes-like object or a number, not 'datetime.datetime'
Saisissez le code ici...
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/46a43731-a0ed-4528-b895-a6b44973a14e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment