Django error 'RawQuerySet' object has no attribute 'all'
<p>I got this error message if I'm using SQL statement to populate data in dropdown.</p>

<p>Error message</p>

<pre><code>'RawQuerySet' object has no attribute 'all'
</code></pre>

<p>Model.py</p>

<pre><code>@python_2_unicode_compatible  # only if you need to support Python 2
class FacebookAccount(models.Model):
    user = models.ForeignKey(User)
    account_description = models.CharField(max_length=50)
    facebook_application_id = models.CharField(max_length=50)
    facebook_application_secret = models.CharField(max_length=50)
    ouath_token = models.CharField(max_length=500)
    status = models.BooleanField(default=False)

    def __str__(self):
        return self.account_description

@python_2_unicode_compatible  # only if you need to support Python 2
class FacebookFanPage(models.Model):
    facebook_account = models.ForeignKey(FacebookAccount)
    fan_page_description = models.CharField(max_length=50)
    fan_page_id = models.CharField(max_length=30)
    fan_page_access_token = models.CharField(max_length=500, null=True)

    def __str__(self):
        return self.fan_page_description

class Campaign(models.Model):
    aList = (
        ('1', 'Send replies to inbox messages'),
        ('2', 'Post replies to users comments')
    )
    user = models.ForeignKey(User)
    campaign_name = models.CharField(max_length=50)
    autoresponder_type = models.CharField(max_length=10, choices=aList, null=True)
    facebook_account_to_use = models.ForeignKey(FacebookAccount)
    set_auto_reply_for_fan_page = models.ForeignKey(FacebookFanPage)
    message_list_to_use = models.ForeignKey(PredefinedMessage)
    #reply_only_in_this_hourly_interval
    reply_only_for_this_keyword = models.CharField(max_length=50, null=True)
</code></pre>

<p>View.py</p>

<pre><code>def autoresponder_create(request, template_name='autoresponder/autoresponder_form.html'):
if not request.user.is_authenticated():
    return redirect('home')
form = AutoresponderForm(request.POST or None)
form.fields["set_auto_reply_for_fan_page"].query = FacebookFanPage.objects.raw('SELECT * '
                                         'FROM fbautoreply_facebookfanpage '
                                         'JOIN fbautoreply_facebookaccount ON fbautoreply_facebookfanpage.facebook_account_id = fbautoreply_facebookaccount.id '
                                         'WHERE fbautoreply_facebookaccount.user_id = %s ', [str(request.user.id)])
if form.is_valid():
    form = form.save(commit=False)
    form.user = request.user
    form.save()
    return redirect('autoresponder_list')
return render(request, template_name, {'form':form})
</code></pre>