mirror of
https://github.com/django/django.git
synced 2025-09-21 18:00:45 +00:00
parent
888c1e9bfe
commit
d1bab24e01
63 changed files with 201 additions and 251 deletions
|
@ -230,7 +230,7 @@ def get_valid_filename(s):
|
|||
"""
|
||||
Returns the given string converted to a string that can be used for a clean
|
||||
filename. Specifically, leading and trailing spaces are removed; other
|
||||
spaces are converted to underscores; and anything that is not a unicode
|
||||
spaces are converted to underscores; and anything that is not an
|
||||
alphanumeric, dash, underscore, or dot, is removed.
|
||||
>>> get_valid_filename("john's portrait in 2004.jpg")
|
||||
'johns_portrait_in_2004.jpg'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue