Table in models.py not being created during syncdb

1,799 views
Skip to first unread message

wchildsuk

unread,
Mar 31, 2010, 1:16:11 PM3/31/10
to Django users
Hi,

I'm using the django app, django-schedule (http://github.com/thauber/
django-schedule) and am adding an additional table to map users to
calendars (see line 253 on dpaste). When I run syncdb it completely
ignores my table and doesn't through any errors. Can anyone shed any
light on way it might be being igored?

My models file is available here:

http://dpaste.com/178158/

Thanks in advance

Wes

Russell Keith-Magee

unread,
Mar 31, 2010, 7:42:28 PM3/31/10
to django...@googlegroups.com
On Thu, Apr 1, 2010 at 1:16 AM, wchildsuk <childs...@gmail.com> wrote:
> Hi,
>
> I'm using the django app, django-schedule (http://github.com/thauber/
> django-schedule) and am adding an additional table to map users to
> calendars (see line 253 on dpaste).  When I run syncdb it completely
> ignores my table and doesn't through any errors. Can anyone shed any
> light on way it might be being igored?

The most likely cause - a table of that name already exists. Django
uses the existence of the table as a mark for whether the table needs
to be created at all. If a table of the required name
(yourapp_calendarusers) already exists -- either because of a clash
with an existing project, or because you ran syncdb previously and
have an old version of the table -- Django won't create or update the
table.

Yours,
Russ Magee %-)

Wesley Childs

unread,
Apr 1, 2010, 3:30:00 AM4/1/10
to django...@googlegroups.com
Hi,

Thanks for the advice.

I removed the sqlite db file, changed the table name to something more random and I still hit the same problem.

Do you have any other ideas?

Thanks

Wes


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


Kenneth Gonsalves

unread,
Apr 1, 2010, 3:35:29 AM4/1/10
to django...@googlegroups.com
On Thursday 01 Apr 2010 1:00:00 pm Wesley Childs wrote:
> I removed the sqlite db file, changed the table name to something more
> random and I still hit the same problem.
>

are you able to import your model and views.py from the shell. Just check if
both these work - from yourproject.yourapp.views import * and import
yourproject.yourapp.views. There used to be a bug where syncdb failed silently
when the concerned views/models file had a failed import. I am not sure whether
the bug has been rectified. (bad internet so cannot check)
--
regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS
http://certificate.nrcfoss.au-kbc.org.in

Wesley Childs

unread,
Apr 1, 2010, 4:24:47 PM4/1/10
to django...@googlegroups.com
Thanks but still no luck, it imports fine as expected.

Also tried splitting it out to a separate models file but it failed to even pick that.

Any other ideas?


--

Dennis Kaarsemaker

unread,
Apr 3, 2010, 1:16:13 PM4/3/10
to django...@googlegroups.com
On wo, 2010-03-31 at 10:16 -0700, wchildsuk wrote:

> I'm using the django app, django-schedule (http://github.com/thauber/
> django-schedule) and am adding an additional table to map users to
> calendars (see line 253 on dpaste). When I run syncdb it completely
> ignores my table and doesn't through any errors. Can anyone shed any
> light on way it might be being igored?

Did you add the app to INSTALLED_APPS?
--
Dennis K.

They've gone to plaid!

Wesley Childs

unread,
Apr 3, 2010, 1:21:26 PM4/3/10
to django...@googlegroups.com
Yep definitely in installed_apps.

After several hours of playing I've changed my method of implementation to work around this issue.

Thanks for everyone's help on this issue, really appreciated.

Wes

Edward Lazarenko

unread,
Oct 9, 2013, 9:11:02 AM10/9/13
to django...@googlegroups.com
Can you tell what did you exactly do, to make it work?

Sergiy Khohlov

unread,
Oct 10, 2013, 7:38:25 AM10/10/13
to django-users
Have you added schedule to installed application list ?
Many thanks,

Serge


+380 636150445
skype: skhohlov
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0573be21-ab52-44ec-a005-e8efb3ea09bd%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages