装修问答

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

 :

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 

hinomoonna 312024-05-04