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

Added slash separator to DateField and more comments styles to MediaFile #1043

Merged
merged 4 commits into from Oct 28, 2014

Conversation

kiefermat
Copy link
Contributor

I have added some StorageStyles to the comments field, which I have seen appearing in actual files.

Additionally, I have changed the DateField to also allow slashed as separator. An example file where this date format appears can be found at http://commons.wikimedia.org/wiki/File:Tromboon-sample.ogg

datestring = super(DateField, self).__get__(mediafile, None)
if isinstance(datestring, basestring):
datestring = re.sub(r'[Tt ].*$', '', unicode(datestring))
items = unicode(datestring).split('-')
items = re.split('-|/', unicode(datestring))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good (although I might have arbitrarily gone with [-/] for the regex 😃). We should add a test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are right. I will change this and add a test.

@sampsyo sampsyo merged commit 610942b into beetbox:master Oct 28, 2014
sampsyo added a commit that referenced this pull request Oct 28, 2014
Added slash separator to DateField and more comments styles to MediaFile
sampsyo added a commit that referenced this pull request Oct 28, 2014
More discussion to come.
sampsyo added a commit that referenced this pull request Oct 28, 2014
@kiefermat
Copy link
Contributor Author

Thanks for merging!

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

Successfully merging this pull request may close these issues.

None yet

2 participants