Hi,

Im currently at a loss about how to fix this issue.

I have tried the modpython.patch in #1796.

What is weird is that the doesn't consistently appear - it is  
intermittent. When I refresh the page it sometimes appears as it  
should, and other times with the error. I'm running the latest Django  
SVN version, and latest versions of Postgres, Psycopg, mod_python,  
python. The system is being hosted on Freebsd 6.1.

Getting 2 errors:
1)Cannot resolve keyword 'products' into field. Choices are: id,  
osIconName, osIconImage, altText, isPublished
2)Cannot resolve keyword 'products' into field. Choices are: id,  
osIconName, osIconImage, altText, isPublished, created_on,  
created_by, last_modified, modified_by
the models.py:

class Products(models.Model):
     productName = models.CharField('Product Name',maxlength=200)
     productSlug = models.SlugField('Product Slug',prepopulate_from= 
('productName',), unique=True)
     productDrivers = models.ManyToManyField('ProductDrivers',  
filter_interface=models.HORIZONTAL, blank=True, verbose_name='Product  
Drivers')
     productDocuments = models.ManyToManyField('ProductDocuments',  
filter_interface=models.HORIZONTAL, blank=True, verbose_name='Product  
Documents', related_name='productDocuments')
     productOSIcons = models.ManyToManyField 
('ProductOSIcons',verbose_name='Product Operating System Icons',  
filter_interface=models.HORIZONTAL, blank=True)
     relatedProducts = models.ManyToManyField 
('self',verbose_name='Related Products',  
filter_interface=models.HORIZONTAL, blank=True)
     class Admin:
         pass

class ProductOSIcons(models.Model):
     osIconName = models.CharField('Icon Name',maxlength=200)
     osIconImage = models.ImageField('Icon Image',upload_to='...' )
     altText = models.CharField('Icon Alt Text',maxlength=200)
     isPublished = models.BooleanField('Is Icon Published?' )
     class Admin:
         pass

class ProductDrivers(models.Model):
     driverName = models.CharField('Driver Name',maxlength=200)
     driverLink = models.URLField('Driver URL')
     isPublished = models.BooleanField('Is Driver Published?')
     class Admin:
         pass

class ProductDocuments(models.Model):
     documentTitle = models.CharField('Document Title', maxlength=200)
     documentFile = models.FileField('Document File', upload_to='...')
     isPublished = models.BooleanField('Is Document Published?')
     class Admin:
         pass


views.py:

VIEW FOR ERROR 1.
     ...
     productCategories = ProductCategory.objects.filter 
(isPublished=True).order_by('categoryName')
     for category in productCategories:
         products = Products.objects.filter(productCategory=category,  
isPublished=True, productDrivers__isPublished=True) or  
Products.objects.filter(productCategory=category, isPublished=True,  
productDocuments__isPublished=True)
         products = products.distinct().order_by('productName')
        ...
        if product.productDrivers.filter(isPublished=True) and  
product.productDocuments.filter(isPublished=True):  # <------- ERROR  
IS HERE
      ...

VIEW FOR ERROR 2.

    ...
     product = Products.objects.get(productSlug=product_slug,  
isPublished=True)
     relatedDocuments = product.productDocuments.filter 
(isPublished=True).order_by('documentTitle')
     osIcons = product.productOSIcons.filter 
(isPublished=True).order_by('osIconName')
     drivers = product.productDrivers.filter 
(isPublished=True).order_by('driverName')
    ...
     return render_to_response('ProductPage.html',  
{'OsIcons':osIcons,'MEDIA_URL':MEDIA_URL}



Template Code:
...
{% if OsIcons %} # <----- ERROR IS HERE
<li>
{% for icon in OsIcons %}
<img class="logo" src="{{MEDIA_URL}}{{icon.osIconImage}}"  
alt="{{ icon.altText }}" />
{% endfor %}
</li>
{% endif %}
...

settings.py:

MIDDLEWARE_CLASSES = (
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.middleware.doc.XViewMiddleware',
     'appname.middleware.threadlocals.ThreadLocals',
)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to