Salut tout le monde,

J'ai le message suivant après avoir executé la vue suivante :

from MyProject.MyApp.models import Picture
from django.shortcuts import render_to_response
from django.http import HttpResponse

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
 
def save(request):
	rank = request.POST["rank"]
	path = request.POST["path"]
	pseudo = request.POST["pseudo"]
	year = request.POST["year"]
	month = request.POST['month']
	day = request.POST['day']
 
	picture = Picture(rank=rank, path=path, year=year, month=month, day=day)
	picture.save()
	return HttpResponse('SAVED')
Sachant que voici mon model qui est dans MyProject > MyApp:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 
from django.db import models
from django.contrib.sites.models import Site
from django.conf import settings
 
# Create your models here.
 
def __unicode__(self):
        return u'foo %s' % self.bar
 
Site.objects.get(pk=settings.SITE_ID)
 
class Picture(models.Model):
	rank = models.CharField(max_length=10)
	path = models.CharField(max_length=100)
	pseudo = models.CharField(max_length=100)
	year = models.CharField(max_length=4)
	month = models.CharField(max_length=2)
	day = models.CharField(max_length=2)
Bien sur j'ai fais un syncdb...
=> En fait c'est vraiment au moment du Save (picture.save()) qu'il plante j'ai l'impression...
Comme si il ne connaissait pas la table picture en BDD alors que j'ai synchronisé.

Est-ce que vous auriez une idée please???

Merci d'avance.