1
, 나는 이것을 달성 할 장고 모델 매개 변수 :추가 장고 모델
class Foo(models.Model):
name = models.CharField(max_length=50)
#wrapping the save function, including extra tasks
def save(self, *args, **kwargs):
super(Foo, self).save(*args, **kwargs)
if extra_param:
...do task 1
else:
...do task 2
그리고 나는이 작업을 수행 할 수있는 방법
Foo(name="Bill Gates",extra_param=True).save() # now triggers the task 1
Foo(name="Bill Gates").save() # now triggers the task 2
등 전달하려는 푸 레이팅 동안? 또한
감사