class accounts(models.Model):
twitterid = models.IntegerField()
credit = models.IntegerField()
activate = models.TextField()
group = models.TextField()
ban = models.TextField(blank=True)
others = models.TextField()
class group(models.Model):
groupname = models.TextField()
groupfollowers = models.IntegerField()
userid = request.session['userid']
juser = accounts.objects.get(twitterid=int(userid))
jgrp = group.objects.get(groupname=juser.group)
如果我使用 jgrp = group.objects.get(groupname="beginners") 此代码有效但不接受变量?DoesNotExist:组匹配查询不存在。