This may not be the best way, but it works:

 temp_ept_id = EptInv.objects.filter(inv_id=80581770).values_list()

and I got it from

http://docs.djangoproject.com/en/1.0/ref/models/querysets/

On Nov 10, 3:47 pm, octopusgrabbus <old_road_f...@verizon.net> wrote:
> My new model class works great. It returns my answer, but in a query
> set, and the table is set up only to return one element in the
> QuerySet due to the indexes. My problem is how to extract the data
> from that QuerySet. repr() does not work, because the model class has
> no repr method.
>
> How do I extract the data?
>
> # This is an auto-generated Django model module.
> # You'll have to do the following manually to clean this up:
> #     * Rearrange models' order
> #     * Make sure each model has one field with primary_key=True
> # Feel free to rename the models, but don't rename db_table values or
> field names.
> #
> # Also note: You'll have to insert the output of 'django-admin.py
> sqlcustom [appname]'
> # into your database.
>
> from django.db import models
>
> class EptInv(models.Model):
>     part_num = models.CharField(max_length=60, blank=True)
>     ept_type = models.IntegerField(primary_key=True)
>     inv_id = models.IntegerField(primary_key=True)
>     load_date = models.DateField(null=True, blank=True)
>     class Meta:
>         db_table = u'ept_inv'
>
>     def __unicode__(self):
>         return str(self.inv_id)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to