Django ticket #4492 - problems with relatedItems and alsoPurchased in Postgresql

Create issue
Issue #125 resolved
mike created an issue

I saw John's ticket (4492) and patch to Django regarding this problem:

http://code.djangoproject.net/ticket/4492

I am dealing with the same problem and would like to suggest that "relatedItems" and "alsoPurchased" simply be changed to "related_items" and "also_purchased". While John's patch fixes the issues with Django (which is very nice), it will still be a problem when browsing tables in psql. For example, if I syncdb with the M2M fields named as relatedItems and alsoPurchased, when I list the tables in psql I can see them:

db=> \dt ... public | product_product_alsoPurchased | table | mike public | product_product_category | table | mike public | product_product_relatedItems | table | mike ...

However, I cannot examine the tables:

db=> \d product_product_relatedItems Did not find any relation named "product_product_relatedItems".

and

db=> select * from product_product_relateditems; ERROR: relation "product_product_relateditems" does not exist

Removing the capital letters from these field names fixes this issue, and the problems awaiting fixes in Django with John's ticket #4492.

Comments (4)

  1. Log in to comment