Advertisement
Guest User

Untitled

a guest
Mar 7th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1.     file = models.CharField(max_length=300, default='')
  2.  
  3.     def __str__(self):
  4.         return self.file_name
  5.  
  6.     def file_link(self):
  7.         if self.file:
  8.             return "<a href='%s'>download</a>" % (self.file)
  9.         else:
  10.             return "No attachment"
  11.  
  12.     file_link.allow_tags = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement