I am really struggling with pulling information out of a class object. I have tried doing this with FK field, proxy models (shown below as I feel this is the closest to working), etc. and cannot get it to work. I cannot pull the information from my database. I would greatly appreciate help. What I want is to have access to all of these fields independently. I feel like what I have should work but I cannot get the information out of my proxy models (shown below). I see what I want in the admin, however. How can I get the information out independently?
class aichatbox_response2(models.Model):
image_url2 =models.CharField(max_length=1000, default='
https://www.')
response2_text = models.CharField(max_length=1000)
aichatbox_response_input2 = models.ManyToManyField(aichatbox_input2)
views_aichatbox = models.IntegerField(default=0)
pw_aichatbox = models.CharField(max_length=12, default='000000')
link_aichatbox = models.CharField(max_length=250, default='None')
nickname_aichatbox = models.CharField(max_length=100, default='Pseudonym')
email_aichatbox = models.EmailField(max_length=100, default='
bl...@blank.com')
def __str__(self):
return u'%s %s' % (self.response2_text, self.image_url2)
class image_url2_class(aichatbox_response2):
class Meta:
proxy = True
def __str__(self):
return self.image_url2
class response2_text_class(aichatbox_response2):
class Meta:
proxy = True
def __str__(self):
return self.response2_text
class aichatbox_response_input2_class(aichatbox_response2):
class Meta:
proxy = True
def __str__(self):
return self.aichatbox_response_input2
class views_aichatbox_class(aichatbox_response2):
class Meta:
proxy = True
def __str__(self):
return str(self.views_aichatbox) # is it best to have this be str() here? I don't know of a better way to do this...
class pw_aichatbox_class(aichatbox_response2):
class Meta:
proxy = True
def __int__(self):
return self.pw_aichatbox
class link_aichatbox_class(aichatbox_response2):
class Meta:
proxy = True
def __str__(self):
return self.link_aichatbox
class nickname_aichatbox_class(aichatbox_response2):
class Meta:
proxy = True
def __str__(self):
return self.nickname_aichatbox
class email_aichatbox_class(aichatbox_response2):
class Meta:
proxy = True
def __str__(self):
return self.email_aichatbox