google-code-export / django-forum

Automatically exported from code.google.com/p/django-forum
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Is there missing a table in the models.py after the latest patch? #57

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
Get latest version from subversion.
2.
3.

What is the expected output? What do you see instead?
I expect to see the forum, instead I get an error:

Environment:

Request Method: POST
Request URL: http://www.battleground.no:8001/admin/forum/forum/add/
Django Version: 1.0.2 final
Python Version: 2.5.0
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.humanize',
 'django.contrib.markup',
 'registration',
 'forum',
 'bgno_admin.news',
 'bgno_admin.rules']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware')

Traceback:
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in
get_response
  86.                 response = callback(request, *callback_args,
**callback_kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in root
  157.                 return self.model_page(request, *url.split('/', 2))
File "/usr/lib/python2.5/site-packages/django/views/decorators/cache.py" in
_wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py" in
model_page
  176.         return admin_obj(request, rest_of_url)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in
__call__
  191.             return self.add_view(request)
File "/usr/lib/python2.5/site-packages/django/db/transaction.py" in
_commit_on_success
  238.                 res = func(*args, **kw)
File "/usr/lib/python2.5/site-packages/django/contrib/admin/options.py" in
add_view
  495.                 form.save_m2m()
File "/usr/lib/python2.5/site-packages/django/forms/models.py" in save_m2m
  71.                 f.save_form_data(instance, cleaned_data[f.name])
File "/usr/lib/python2.5/site-packages/django/db/models/fields/related.py"
in save_form_data
  911.         setattr(instance, self.attname, data)
File "/usr/lib/python2.5/site-packages/django/db/models/fields/related.py"
in __set__
  577.         manager.clear()
File "/usr/lib/python2.5/site-packages/django/db/models/fields/related.py"
in clear
  400.             self._clear_items(self.source_col_name)
File "/usr/lib/python2.5/site-packages/django/db/models/fields/related.py"
in _clear_items
  485.                 [self._pk_val])
File "/usr/lib/python2.5/site-packages/django/db/backends/util.py" in execute
  19.             return self.cursor.execute(sql, params)
File "/usr/lib/python2.5/site-packages/django/db/backends/mysql/base.py" in
execute
  83.             return self.cursor.execute(query, args)
File
"/usr/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg/MySQLd
b/cursors.py"
in execute
  166.             self.errorhandler(self, exc, value)
File
"/usr/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg/MySQLd
b/connections.py"
in defaulterrorhandler
  35.     raise errorclass, errorvalue

Exception Type: ProgrammingError at /admin/forum/forum/add/
Exception Value: (1146, "Table 'bgno.forum_forum_groups' doesn't exist")

Original issue reported on code.google.com by ZubZ...@gmail.com on 30 Mar 2009 at 7:36

GoogleCodeExporter commented 9 years ago
Have you run `manage.py syncdb`? Looks like you have updated your SVN checkout
without doing a re-sync of the database.

If you need to create the table manually, you can use the following SQL 
(Postgres, YMMV)

BEGIN;
CREATE TABLE "forum_forum_groups" (
    "id" serial NOT NULL PRIMARY KEY,
    "forum_id" integer NOT NULL REFERENCES "forum_forum" ("id") DEFERRABLE INITIALLY
DEFERRED,
    "group_id" integer NOT NULL REFERENCES "auth_group" ("id") DEFERRABLE INITIALLY
DEFERRED,
    UNIQUE ("forum_id", "group_id")
)
;
COMMIT;

If you're still having troubles, please provide further information (eg was it 
an
upgrade, or fresh install? What tables have already been created? etc).

Original comment by rwpoul...@gmail.com on 31 Mar 2009 at 12:24

GoogleCodeExporter commented 9 years ago
Well it was first an upgrade, and yes I did a syncdb.
Since my project is still in development I decided to drop the tables and 
reinstall
the forum app. But still no forum_forum_groups table. I eventually figured out 
wich
fields that I had to make in the table.

To me it looks like this table isnt in models.py. But I might be mistaken since 
I am
quite new to django.

Original comment by ZubZ...@gmail.com on 31 Mar 2009 at 4:53