首页 > 装修问答 > 装饰 > PYTHON里的装饰器能装饰类吗?

PYTHON里的装饰器能装饰类吗?

浏览次数:2465|时间:2024-05-03

热门回答

2024-04-21熊猫小胖
 :

from import  Question(models; .pub_date  timezone
from def date  python_2_unicode_compatible
from datetime  pub_date=models;
@python_2_unicode_compatible
class import :
 =self; .question_text
 now> .CharField(max_length=200)
  :
 >def   django; published' return )
 .now()
 django:
  question_text=models;  .Model); self;  .utils = now=timezone; import 

能; __str__(self).utils;was_published_recently(self).encoding .DateTimeField('timedelta return 

330