Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个 django 应用程序,该应用程序的功能类似于 craigslist 在发布帖子时选择使用“匿名”选项隐藏他们的电子邮件时所做的事情。是否有一个 python 包已经做了类似的事情?
一个包将是矫枉过正。为什么不直接使用带有匿名标志的模型?
class Item(models.Model): user = models.ForeignKey(User) anonymous = models.BooleanField() def get_email(self): return "Anonymous" if self.anonymous else self.user.email