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

Better filenames #349

Merged
merged 5 commits into from
May 16, 2014
Merged

Better filenames #349

merged 5 commits into from
May 16, 2014

Conversation

micahflee
Copy link
Contributor

Filenames are much prettier, and always remain sequential. Fixes #320.

screenshot from 2014-04-04 20 12 35

def journalist_filename(self):
valid_chars = 'abcdefghijklmnopqrstuvwxyz1234567890-_'
filename = ''
for c in self.journalist_designation.lower().replace(' ', '_'):
Copy link
Contributor

Choose a reason for hiding this comment

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

Fancy Python: return ''.join([c for c in self.journalist_designation.lower().replace(' ', '_') if c in valid_chars])

@micahflee
Copy link
Contributor Author

Ok I've addressed everything here except for how the get_docs() function sorts results. I actually think it's fine how it is. There's no real need to add a new incrementing id row to the Submission table, and sorting numberically by filename works fine.

garrettr added a commit that referenced this pull request May 16, 2014
@garrettr garrettr merged commit dad442f into freedomofpress:develop May 16, 2014
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.

Better filenames for individual docs and messages
2 participants