我有這個tastypie資源: class TagResource_min(ModelResource):
class Meta:
queryset=Question.objects.values('text', 'id')
當我做到這一點我有錯誤: {
"error_message": "'dict' object has no attribute 'pk
我的模型: class UserDetails(models.Model):
user=models.ForeignKey(User)
email=models.CharField(max_length=30)
name=models.CharField(max_length=30)
class Problem(models.Model):
user=m
就像頁面標題所說的,我是Getting Started with Tastypie,按照鏈接教程。但是,當我嘗試加載/api/entry/?format=json,我得到HTTP 500響應,與此錯誤消息: 沒有這樣的表:myapp_entry 當我看着sqlite3的,確實,沒有這樣的表。 以下是我跟着教程:
$ django-admin startproject mysite
$ cd
我有以下型號我想加盟: Datapoint class Datapoint(models.Model):
id = models.IntegerField(db_column='ID', primary_key=True) # Field name made lowercase.
composition = models.ForeignKey(Composition, mode