Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to update documentation and examples #18

Open
treyhunner opened this issue Mar 20, 2012 · 3 comments
Open

Need to update documentation and examples #18

treyhunner opened this issue Mar 20, 2012 · 3 comments

Comments

@treyhunner
Copy link

This application looks like it is still under development and I would love to contribute to it (documentation, code cleanup, etc.), but I need more guidance than the documentation and code currently give.

I have spent multiple hours wading through the code and at this point I still don't understand how GeneratorModel (or OccurrenceGeneratorBase if that's actually used) are supposed to be used with EventModel to actually create an event and occurrences out of the event.

A demo application (like django-swingtime has) would be incredibly useful in understanding how this application works.

Could someone show me a basic models.py file and some sample code that uses the abstract models in this package to make a working event?

@Aramgutang
Copy link
Collaborator

Unfortunately, due to time pressures, we haven't had as much time to keep the docs up to date as we'd like. Until we find the time to do so, I would suggest looking at the ixc fork of the project on GitHub, which we treat as a development branch for eventtools. That fork has two active branches: newtools, and api-tidy; the former still receives bugfixes for our legacy sites, and is still a marked improvement over the glamkit repo, while the latter is the branch we use for new sites, and is the one I would recommend using.

In lieu of documentation, the test suite, even though it's not very complete, is the best place to get an idea for how to use eventtools. You'll need to have an app in your project with models that inherit from all 4 of EventModel, GeneratorModel, OccurrenceModel, and ExclusionModel, with foreign keys between them as seen here: https://github.com/ixc/glamkit-eventtools/blob/api-tidy/eventtools/tests/eventtools_testapp/models.py

For your app's admin.py, you'll want to have at least the following:

from eventtools.admin import EventAdmin, OccurrenceAdmin
from .models import Event, Occurrence # these are the models you defined
admin.site.register(Event, EventAdmin(Event))
admin.site.register(Occurrence, OccurrenceAdmin(Occurrence))

I hope that's enough to get you started, and I again apologise for the lack of documentation.

@Aramgutang
Copy link
Collaborator

Oh, I completely forgot. There's documentation available for the code in the main glamkit repo here: http://docs.glamkit.org/documentation/eventtools/ (the link from the README was broken).

Also, there's more complete documentation on how to use the api-tidy branch here: https://github.com/ixc/glamkit-eventtools/blob/api-tidy/docs/install.rst

@treyhunner
Copy link
Author

Thanks a bunch for the explanation. I had not yet waded into the tests directory for examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants