On Jun 18, 7:00 am, timc3 <[EMAIL PROTECTED]> wrote:
> I am trying to use django-notification in an application but I am
> having some problems with it creating notice types. In fact the
> notification types are for the django-messages application but the
> management.py file looks correct:
>
> from django.dispatch import dispatcher
> from django.db.models import get_models, signals
>
> from django.utils.translation import ugettext_noop as _
>
> try:
>     from notification import models as notification

Renaming models to notification here is not a good idea (see below for
the reason)


>     def create_notice_types(app, created_models, verbosity, **kwargs):
<snip>

>     dispatcher.connect(create_notice_types,
> signal=signals.post_syncdb, sender=notification)

The sender here must be the app name 'notification'. However, your
above import clobbers notification to take on the value of
notification.models. The net effect is that your callback function
create_notice_types is never called.

So, after you fix your import above and make sure sender=notification
refers to the notification app (i.e. import notification), do the
following:

manage.py reset notification

Hopefully, that will do the right thing. If it doesn't, try dropping
the notification app's tables from your DB, and run syncdb again.

-Rajesh D

--~--~---------~--~----~------------~-------~--~----~
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