Hi all,
Here is my model:
class Members(models.Model):
firstname = models.CharField(max_length=30)
lastname = models.CharField(max_length=30)
gender = models.CharField(max_length=1)
email = models.EmailField()
password = models.CharField(max_length=30)
country_code = models.CharField(max_length=4, choices=COUNTRY_CHOICES)
zip = models.CharField(max_length=10)
will_share = models.IntegerField()
will_chat = models.IntegerField()
priv_level = models.IntegerField()
email_format = models.CharField(max_length=4, choices=EMAIL_CHOICES)
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
last_login = models.DateTimeField(auto_now=True)
active = models.BooleanField()
When I do a query as follows:
Members.objects.all()
How do I limit the fields returned. I only want firstname, lastname and last_login so effectively creating a query like:
SELECT firstname, lastname, last_login FROM members
There are a lot of members and I need to send a lot of XML data to the browser and don't want all the fields returned as it will bulk out the data too much. I have checked all the docs and can't see which option to use.
Is there an easy way for me to turn my limited fields dataset into XML for return to the browser to use in ajax?
Thanks
Rich