tschellenbach / Django-facebook

Facebook open graph api implementation using the Django web framework in python
http://www.mellowmorning.com/
Other
1.43k stars 543 forks source link

Django 1.9 and relation "django_facebook_open_graph_share" does not exist #570

Open turukawa opened 8 years ago

turukawa commented 8 years ago

I've been upgrading a Django project to 1.9 and get the following error with Django Facebook:

ProgrammingError at /admin/django_facebook/opengraphshare/
relation "django_facebook_open_graph_share" does not exist
LINE 1: SELECT COUNT(*) AS "__count" FROM "django_facebook_open_grap...

I've installed the Django Facebook 6.0.4 version from Master which is mostly Django 1.9 compliant (and I fixed the urlpatterns in urls.py for my version).

On my build the error is simple enough to reproduce. Go into the admin view and select Open graph shares. Instant chaos.

I've seen the discussion for https://github.com/tschellenbach/Django-facebook/issues/523 by @amarpreetsaini but there doesn't seem to be any resolution to that, and I'm not sure if this is new and related to 1.9.

I'm less interested in the OpenGraphShare problem than that this prevents me deleting users (results in the same error message).

Any ideas?

turukawa commented 8 years ago

UPDATE: this seems a very terrible and stupid hack, but - after the database has been created - if I directly edit the table name from 'django_facebook_opengraphshare' to 'django_facebook_open_graph_share' it works.

I don't feel comfortable doing this, so would prefer a more lasting solution. Any thoughts?

jrabbit commented 8 years ago

So this appears to be because of https://github.com/tschellenbach/Django-facebook/blob/e91e389f463743f64917fa840a40a72513008b60/django_facebook/models.py#L531 which #django says is bad.

@tschellenbach: What's the benefit of having the complex table renaming like in https://github.com/tschellenbach/Django-facebook/blob/e91e389f463743f64917fa840a40a72513008b60/django_facebook/models.py#L369? Doesn't django do it for you?

jsvaughan commented 8 years ago

As a workaround note that:

I'm part way through a django upgrade so YMMV but I am at least able now to run my test suite

Jiloc commented 6 years ago

still no fixes? I am running in to this right now