-
Notifications
You must be signed in to change notification settings - Fork 33
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
Make multigtfs easily extensible #83
base: master
Are you sure you want to change the base?
Conversation
This is interesting, I still need to think about the approach. I'm surprised the tests passed, since the processing order of imports and exports was different before, but maybe they reflect an issue with real feeds rather than ones from the tests. Are you using migrations in your project? How did this code interact with migrations? |
I use the same order for import (because it matters). For export the order de-facto doesn't matter, so first I used the same order for both, but than I realized that I need to sort them by the filename to pass the tests. However, I should still write some tests for the registering / unregistering feature. Hopefully I'll get back to it soon. |
Regarding the migrations, we use them. As You see in the example, the |
I like the idea of ordering exports based on the I'm trying to think if there is a more "Django" way to register and order the models. The register methods would require some one-time code to setup the extended models, such as in an |
I see registering using decorator a very Python/Django way. It is very similar to registering to Django admin site for example. |
@daliborpavlovic, do you really mean to update this pull request with the latest changes? |
58c15e4
to
6793d2f
Compare
No, sorry, I did not want to update this PR. I was just playing around with our fork and did not know, that this would propagate here. I made reset and force push of the original version, if that is ok. |
We would like to merge this feature. May also provide general solution for #73 without extending multigtfs by non-standard models. Before merge, test case must be provided. Thank you. |
This change makes
multigtfs
easily extensible by other Django applications.All you need is to create model based on
multigtfs.models.base.Base
and register the model with decorator
multigtfs.models.Feed.register_model
.For example, we use following
sexi
(Stop External Id) extension in our project: