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

Document how to add entities #27

Open
laidig opened this issue May 11, 2017 · 0 comments
Open

Document how to add entities #27

laidig opened this issue May 11, 2017 · 0 comments

Comments

@laidig
Copy link
Contributor

laidig commented May 11, 2017

I need to add entities (specifically, a feed_info where one is not present in the original feed) to my feed. I've figured out how to do this, but it's not documented and may be a little convoluted:

if 'feed_info' not in gtfs_feed.by_id:
    gtfs_feed.by_id['feed_info'] = {}
    cls = gtfs_feed.FACTORIES['feed_info']
    info = cls.from_row({
        'feed_publisher_name' : agency_id,
        'feed_publisher_url' : url ,
        'feed_lang' : feed_lang,
        'feed_id' : agency_id
        })
    gtfs_feed.by_id['feed_info']['a'] = info

Is there a better way? If this is acceptable I will submit a PR explaining the process.

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

1 participant