写一个前后端分离的小项目,一边看django,一边看vue.
在写用户登录注册的时候,需要验证码,这时候用到了django-simple-captcha
下面是这个其中的一个模型类:
>>>
class CaptchaStore(django.db.models.base.Model)
| CaptchaStore(*args, **kwargs)
|
| CaptchaStore(id, challenge, response, hashkey, expiration)
|
| Method resolution order:
| CaptchaStore
| django.db.models.base.Model
| builtins.object
|
| Methods defined here:
|
| __str__(self)
| Return str(self).
|
| challenge = <django.db.models.query_utils.DeferredAttribute object>
| expiration = <django.db.models.query_utils.DeferredAttribute object>
| get_next_by_expiration = _method(self, *, field=<django.db.models.fields.DateTimeField: expiration>, is_next=True, **kwargs)
|
| get_previous_by_expiration = _method(self, *, field=<django.db.models.fields.DateTimeField: expiration>, is_next=False, **kwargs)
|
| hashkey = <django.db.models.query_utils.DeferredAttribute object>
| id = <django.db.models.query_utils.DeferredAttribute object>
| response = <django.db.models.query_utils.DeferredAttribute object>
| save(self, *args, **kwargs)
| Save the current instance. Override this in a subclass if you want to
| control the saving process.
|
| The 'force_insert' and 'force_update' parameters can be used to insist
| that the "save" must be an SQL insert or update (or equivalent for
| non-SQL backends), respectively. Normally, they should not be set.
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| create_pool(count=1000) from django.db.models.base.ModelBase
|
| generate_key(generator=None) from django.db.models.base.ModelBase
|
| pick() from django.db.models.base.ModelBase
|
| remove_expired() from django.db.models.base.ModelBase
调用它可以一次删除过期的数据库中的行