theherk / django-theherk-events

Django CMS plugin to track events on multiple calendars.
Other
0 stars 0 forks source link

Error with migration #2

Closed erieval closed 10 years ago

erieval commented 10 years ago

I am trying the app with newly installed django-cms rc and django 1.6 both installed with djangocms-installer. I get an error with migration: django.db.utils.ProgrammingError: relation "resources_organization" does not exist Full error: http://paste.debian.net/91433/

erieval commented 10 years ago

I was able to get through migration using django-cms develop and django 1.6.2. And I hooked app to a page, but when I go to events in admin interface and click on it , I get OperationalError at /en/admin/events/event/ no such table: resources_organization Full error: http://paste.debian.net/91453/ I hope all your work yesterday will not be to no avail. Thanks

erieval commented 10 years ago

I also noticed that according to docs 'resources' is included in INSTALLED_APPS, but the migrration command is python manage.py migrate events, so I tried also : python manage.py migrate resources and got an error: ValueError: Cannot import the required field 'django.contrib.localflavor.us.models.USStateField' Full error: http://paste.debian.net/91462/ Thanks

theherk commented 10 years ago

Okay. First, there should be nothing referencing django.contrib.localflavor.us.models.USStateField because that is no longer imported in the newest version. Maybe you don't have the correct version. Please do pip freeze and share the results.

Next, good catch, you do have to migrate both.

Last, that error indicating no table resources_organization probably indicates that they didn't both migrate correctly.

After you hooked the app to the page, did you restart the server?

theherk commented 10 years ago

Okay, I see the issue. It is with the migration. Standby.

theherk commented 10 years ago

Alright, try it when you can please. You can see the referenced commit attached above. The problem was indeed in the migration file. Let me know how you fare. I am going to close it, because I believe it is resolved. However, you should still be able to comment on this issue after it is closed.

erieval commented 10 years ago

I made new install of the app and hooked it to the page Events and I am not getting errors : ), but it seems that I can add an event only through admin interface. In frontend the only choice for events is the "number to show" and all three "Organization", "Organization and People" and "People" have field for choice of organization only. The nice form with calendar, audience and description available in admin interface is not available in frontend. Is this how it is intended ? I am kind of spoiled with django-cms 3, where all editing of plugins occur in frontend. Another issue is that there is no menu on the Events page hooked to the app. Also just to clarify: do I need to add 'localflavor' to INSTALLED_APPS before migrating?

Thanks

On Thu, Apr 3, 2014 at 12:27 PM, Adam Sherwood notifications@github.comwrote:

Alright, try it when you can please. You can see the referenced commit attached above. The problem was indeed in the migration file. Let me know how you fare. I am going to close it, because I believe it is resolved. However, you should still be able to comment on this issue after it is closed.

Reply to this email directly or view it on GitHubhttps://github.com/theherk/django-theherk-events/issues/2#issuecomment-39479797 .

theherk commented 10 years ago

Yes, add 'localflavor' to INSTALLED_APPS before migrating. It may work without it, but it is recommended by the developers of django-localflavor.

Bear in mind, these are designed specifically to suit my needs, which may differ slightly from your needs. Here is the intention.

I do only add events on the backend, so I saw no need to develop a front end. However, you can accomplish this in django-cms v3 by going to any of the admin screen overlays, like Page > Page Settings in the toolbar, then clicking Home in the breadcrumbs for that admin overlay.

The django-theherk-resources plugin options work like this:

You can see an example here responders.us - contact

There is a menu on the page hooked to the app. The menu lists the calendars. So if you had a calendar for concerts and one for races you would have 2 options in that menu (one for each calendar).

I would love to have this be much more robust. If you want to fork it and add a front end I would be happy to pull.

erieval commented 10 years ago

I will use it the way it is for now, adding events from admin interface. I need to see why I don't have django-cms menu on the page hooked to app. I do have lists of calendars, but not the menu of pages. It was great help. Thanks a lot.

On Thu, Apr 3, 2014 at 1:40 PM, Adam Sherwood notifications@github.comwrote:

Yes, add 'localflavor' to INSTALLED_APPS before migrating. It may work without it, but it is recommended by the developers of django-localflavor.

Bear in mind, these are designed specifically to suit my needs, which may differ slightly from your needs. Here is the intention.

I do only add events on the backend, so I saw no need to develop a front end. However, you can accomplish this in django-cms v3 by going to any of the admin screen overlays, like Page > Page Settings in the toolbar, then clicking Home in the breadcrumbs for that admin overlay.

The django-theherk-resources plugin options work like this:

  • Organization - show contact information for the organization only
  • People - show contact information for only the people that belong to the selected organization
  • Organization and People - show both the contact information for the selected organization and the people that belong to it.

You can see an example here responders.us - contacthttp://responders.us/contact/midwest-card-and-id-solutions/

There is a menu on the page hooked to the app. The menu lists the calendars. So if you had a calendar for concerts and one for races you would have 2 options in that menu (one for each calendar).

I would love to have this be much more robust. If you want to fork it and add a front end I would be happy to pull.

Reply to this email directly or view it on GitHubhttps://github.com/theherk/django-theherk-events/issues/2#issuecomment-39488730 .

theherk commented 10 years ago

That is possible due to the default template being

<ul>
{% for calendar in calendars %}
  <li style="display: inline; "><a href="{% url 'events:calendar-events' calendar.slug %}">{{ calendar.name }}</a>{% if not forloop.last %} | {% endif %}</li>
{% endfor %}
</ul>

You will need to override this template to extend from base to pick up your other templating blocks. For example, in my project folder under templates/events/index.html, I have:

{% extends "base.html" %} 
{% load cms_tags %}

{% block masthead %}
      <h1>Events</h1>
{% endblock %}

{% block main %}
<div id="main" class="leftbar-content"><!-- BEGIN Main Section -->
  <section id="content"><!-- BEGIN Content -->
&nbsp;
  </section><!-- END Content -->
  <aside id="leftbar"><!-- BEGIN Sidebar -->
    <div class="calendar-links">
      <ul>
{% page_attribute "slug" as current_slug %}
{% for calendar in calendars %}
        <li{% if current.slug == calendar.slug %} class="active"{% endif %}><a href="{% url 'events:calendar-events' calendar.slug %}" style="text-decoration: none; ">{{ calendar.name }}</a></li>
{% endfor %}
      </ul>
    </div>
  </aside><!-- END Sidebar -->
</div><!-- END Main Section -->
{% endblock %}

I hope that helps.

erieval commented 10 years ago

I added {% extends "base.html" %} to all events templates except plugin.html and the menu of pages is seen now on Events page, but I am getting other errors: I add events in admin interface, but on navigating to Events page nothing show up, in the terminal I get messages:

/home/valerie/TRYEVENTS/venvtryevents/local/lib/python2.7/site-packages/django/db/models/fields/init.py:848: RuntimeWarning: DateTimeField Event.end received a naive datetime (2014-04-04 00:00:00) while time zone support is active. RuntimeWarning)

/home/valerie/TRYEVENTS/venvtryevents/src/django-cms/cms/plugin_pool.py:152: DeprecationWarning: please rename the table "cmsplugin_eventsplugin" to "events_eventsplugin" in events The compatibility code will be removed in 3.1 table_name, old_db_name, model._meta.app_label), DeprecationWarning)

Maybe I will install a fresh django-cms and events.

On Fri, Apr 4, 2014 at 9:48 AM, Adam Sherwood notifications@github.comwrote:

That is possible due to the default template being

    {% for calendar in calendars %}
  • {{ calendar.name }}{% if not forloop.last %} | {% endif %}
  • {% endfor %}

You will need to override this template to extend from base to pick up your other templating blocks. For example, in my project folder under templates/events/index.html, I have:

{% extends "base.html" %} {% load cms_tags %}

{% block masthead %}

Events

{% endblock %}

{% block main %}

 
{% endblock %} I hope that helps. ## Reply to this email directly or view it on GitHubhttps://github.com/theherk/django-theherk-events/issues/2#issuecomment-39572752 .
theherk commented 10 years ago

Sorry, I missed this message. I looks like it has to do with your use of TIME_ZONE in settings. I'm sorry that I do not have more to dedicate to this.