This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload_path(instance, old_filename): | |
extension = os.path.splitext(old_filename)[1].lower() | |
today = datetime.datetime.today() | |
timestamp = str(time.time()) | |
file_path = 'media/{year}{month}/{timestamp}{extension}'.format( | |
year=today.year, | |
month=today.month, | |
timestamp=timestamp, | |
extension=extension) | |
return file_path |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
单行文本方法, 通过CSS即可解决 | |
<style> | |
p{ | |
width: 100px; | |
display: block; | |
text-overflow: ellipsis; | |
-o-text-overflow: ellipsis; | |
-icab-text-overflow: ellipsis; | |
-khtml-text-overflow: ellipsis; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html { | |
-webkit-filter: grayscale(100%); | |
-moz-filter: grayscale(100%); | |
-ms-filter: grayscale(100%); | |
-o-filter: grayscale(100%); | |
filter: grayscale(100%); | |
filter: gray; | |
filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.clearfix:after { | |
content: ""; | |
display: block; | |
height: 0; | |
clear: both; | |
} | |
.clearfix { | |
zoom: 1; | |
} |
NewerOlder