Models

Models define the core data structures that support the application and are represented in the database.

With Fleeting Forms, the Form is at the heart of the application. They are grouped together in a FleetingNamespace and contain the FleetingTemplate and FleetingAuth that define the form.

class fleetingform.models.FleetingAction(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A form action.

All templates must have at least one action, which is rendered as the button that submits the form.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

label

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
template

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

template_id
class fleetingform.models.FleetingAuditEntry(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Fleeting Audit Entries track usage without personal details.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

auth

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

code

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

completed_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

delete(*args, **kwargs)[source]
get_auth_display(*, field=<django.db.models.fields.CharField: auth>)
get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
get_status_display(*, field=<django.db.models.fields.CharField: status>)
get_template_display(*, field=<django.db.models.fields.CharField: template>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

namespace

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

namespace_id
objects = <django.db.models.manager.Manager object>
opened_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

template

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class fleetingform.models.FleetingAuth(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Auth controls the authentication workflow for the form.

Every form has authentication parameters. Authentication parameters define how the authentication pages are displayed and which authentication workflow the user has to complete to access the form.

The simplest form of authentication, none, does not require any user authentication.

The most complex form, user_otp_phone, supports multiple users with individual one time pass codes delivered over SMS.

AUTH_DEFAULT_CONTENT = 'Use your credentials to unlock the form.'
AUTH_DEFAULT_TITLE = 'Unlock Fleeting Form'
AUTH_TYPES = (('none', 'None'), ('user', 'Username'), ('pass', 'Password'), ('user_pass', 'Username and Password'), ('otp_email', 'One-time Passcode via Email'), ('otp_phone', 'One-time Passcode via SMS'), ('user_otp_email', 'Username and One-time Passcode via Email'), ('user_otp_phone', 'Username and One-time Passcode via SMS'))
AUTH_TYPES_EMAIL_OTP = ('otp_email', 'user_otp_email')
AUTH_TYPES_OTP = ('otp_phone', 'user_otp_phone', 'otp_email', 'user_otp_email')
AUTH_TYPES_OTP_ONLY = ('otp_email', 'otp_phone')
AUTH_TYPES_PASSWORD = ('pass',)
AUTH_TYPES_PHONE_OTP = ('otp_phone', 'user_otp_phone')
AUTH_TYPES_USER = ('user', 'user_pass', 'user_otp_email', 'user_otp_phone')
AUTH_TYPES_USERNAME = ('user',)
AUTH_TYPES_USEROTP = ('user_otp_email', 'user_otp_phone')
AUTH_TYPES_USERPASS = ('user_pass',)
AUTH_TYPE_NONE = 'none'
AUTH_TYPE_PASS = 'pass'
AUTH_TYPE_PASS_OTP_EMAIL = 'otp_email'
AUTH_TYPE_PASS_OTP_PHONE = 'otp_phone'
AUTH_TYPE_USER = 'user'
AUTH_TYPE_USER_PASS = 'user_pass'
AUTH_TYPE_USER_PASS_OTP_EMAIL = 'user_otp_email'
AUTH_TYPE_USER_PASS_OTP_PHONE = 'user_otp_phone'
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

action

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

authenticate(username='', password='')[source]

Authenticate a user and password.

Given the auth type, authenticate the given username and password.

Parameters
  • username (str) – the username to authenticate.

  • password (str) – the plain text password to authenticate.

Returns

True if username and password valid, else False

Return type

bool

content

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property email_otp

Does this form use email for the one time pass?

Returns

True if username and email one time pass required, else False

Return type

bool

form

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

form_controls

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

get_type_display(*, field=<django.db.models.fields.CharField: type>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
opened_by(username)[source]

Set the opened_by timestamp for a user on access.

Parameters

username (str) – the user that opened the form.

Returns

None

property otp

Does this form require a one time pass?

Returns

True if one time pass required, else False

Return type

bool

property password_only

Does this form require a password only.

Returns

True if password only authentication required, else False

Return type

bool

property phone_otp

Does this form use phone for the one time pass?

Returns

True if username and phone one time pass required, else False

Return type

bool

property required

Does this form require authentication?

Returns

True if authentication required, else False

Return type

bool

property requires_password

Does this form require a password of some kind? OTP or Static.

Returns

True if password required, else False

Return type

bool

property requires_username

Does this form require a username?

Returns

True if username required, else False

Return type

bool

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property username_and_otp

Does this form require a username and one time passcode?

Returns

True if username and static password required, else False

Return type

bool

property username_and_password

Does this form require a username and static password.

Returns

True if username and static password required, else False

Return type

bool

property username_only

Does this form require a username only.

Returns

True if username only authentication required, else False

Return type

bool

users

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

verify_password(password, password_hash)[source]

Verify that a plain text password matches a hash.

Automatically identifies and instantiates the correct hasher and performs the hash verification.

Parameters

password (str) – password to verify

Returns

True if password matches hash, else False

Return type

bool

verify_username(username='')[source]

Verify that a username is valid for the form.

Checks whether the username is present in users.

Parameters

username (str) – username to verify

Returns

True if user is present, else False

Return type

bool

class fleetingform.models.FleetingChoice(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A choice field entry.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

form_control

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

form_control_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

value

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class fleetingform.models.FleetingForm(*args, **kwargs)[source]

Bases: django.db.models.base.Model

The whole point.

Fleeting forms provide a quick way to set up a one-off interaction with someone.

All forms have a template, which defines how it is rendered and which workflow is executed when the user completes the form.

Easy to use and setup, the default form comes with a title, space for instructions or a message to the user, and whichever form fields and action buttons you need.

Create a new default form:

{
    'template': {
        'title': 'Page Title',
        'content': 'Hi Ethel!
Some instructions.’,

‘form_controls’:[…], ‘actions’: [‘Submit’] }

}

}

This will return a response that contains a one time code for the the form along with a new URL to access it.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

FORM_STATUSES = (('created', 'Created'), ('opened', 'Opened'), ('completed', 'Completed'), ('error', 'Error'))
FORM_STATUSES_COMPLETED = {'completed', 'error'}
FORM_STATUS_COMPLETED = 'completed'
FORM_STATUS_CREATED = 'created'
FORM_STATUS_ERROR = 'error'
FORM_STATUS_OPENED = 'opened'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

app

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property audit_entry
auth

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

auth_id
auth_token

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

code

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

complete(result={})[source]

Put the form into the completed state.

Parameters

result (JSON-serializable dict) – the result for the FleetingForm

Raises

FleetingFormCompleteError

property completed

Is this form complete? Either the user has submitted or error.

Returns

True if form complete or errored, else False

Return type

bool

completed_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

created_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

error(error_code, message, force_status=False)[source]

Put the form into an error state.

Parameters
  • error_code (str) – the error code that was triggered.

  • message (str) – a descriptive message to the user.

  • force_status (bool) – force the transition even if the form is already complete?

Raises

FleetingFormCompleteError

property expired

Has the form expired?

Returns

True if expired else False

Return type

bool

property expires_on

When does the form expire?

Returns

form exipiry date

Return type

datetime.datetime

get_next_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=True, **kwargs)
get_previous_by_created_on(*, field=<django.db.models.fields.DateTimeField: created_on>, is_next=False, **kwargs)
get_status_display(*, field=<django.db.models.fields.CharField: status>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

namespace

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

namespace_id
objects = <django.db.models.manager.Manager object>
open(username=None)[source]

Open the form for the first time.

Parameters

username (str) – the user that opened the form.

Raises

FleetingFormCompleteError

opened_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

result

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

save(*args, **kwargs)[source]

Inhibit the Form from saving if it is already complete.

Parameters

force_status (bool) – force the save, overriding the status check.

Returns

the saved instance.

Return type

FleetingForm

Raises

FleetingFormCompleteError

property short_url

Short URL based on the namespace URL shortener and scheme settings.

Returns

URL to the form.

Return type

str

status

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

template

Accessor to the related object on the forward side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Restaurant.place is a ForwardOneToOneDescriptor instance.

template_id
property url

Full length URL based on the default domain and scheme settings.

Returns

URL to the form.

Return type

str

class fleetingform.models.FleetingFormControl(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A form control.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

FIELD_TYPES = (('text', 'Text'), ('textarea', 'Text Area'), ('integer', 'Integer'), ('float', 'Float'), ('decimal', 'Decimal'), ('url', 'URL'), ('email', 'Email'), ('date', 'Date'), ('time', 'Time'), ('datetime', 'Date and Time'), ('choice', 'Choice'), ('boolean', 'Boolean'))
FIELD_TYPE_BOOLEAN = 'boolean'
FIELD_TYPE_CHOICE = 'choice'
FIELD_TYPE_DATE = 'date'
FIELD_TYPE_DATETIME = 'datetime'
FIELD_TYPE_DECIMAL = 'decimal'
FIELD_TYPE_EMAIL = 'email'
FIELD_TYPE_FLOAT = 'float'
FIELD_TYPE_INTEGER = 'integer'
FIELD_TYPE_TEXT = 'text'
FIELD_TYPE_TEXTAREA = 'textarea'
FIELD_TYPE_TIME = 'time'
FIELD_TYPE_URL = 'url'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

choices

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

content_type

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

content_type_id
disabled

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

form

Provide a generic many-to-one relation through the content_type and object_id fields.

This class also doubles as an accessor to the related object (similar to ForwardManyToOneDescriptor) by adding itself as a model attribute.

get_type_display(*, field=<django.db.models.fields.CharField: type>)
help_text

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

hidden

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

initial

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

label

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

object_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
params

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

required

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

validations

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class fleetingform.models.FleetingNamespace(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Namespaces are a honking great idea - group forms and settings.

Each namespace groups FleetingForms that require consistent settings ans styling, i.e. those supporting a single application or user. All forms in a namespace share the same subdomain (https://subdomain.fleetingforms.io/), styling, support email.

Users access the a namespace by providing the correct token in the settings.FLEETING_TOKEN_HEADER HTTP header.

CH_URL_UNSAFE = '< > # % " ; / ? : @ & = + $ , { } | \\ ^ [ ] ` \\\' .'
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

RE_URL_UNSAFE = '[\\[\\]<>#%";/?:@&=+$,{}|.`\\\'^\\\\ \\t\\r\\n\\f]'
URL_FLEETI_NG = 'fleeti.ng'
URL_SHORTENERS = (('fleeti.ng', 'fleeti.ng'), ('fleeting.link', 'fleeting.link'))
property active_forms
audit_entries

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

delete(*args, **kwargs)[source]
forms

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

forms_between(_from, _to)[source]
property forms_last_month
forms_since(date)[source]
property forms_this_month
classmethod from_request(request)[source]

Get the namespace from a Django Request object.

Parameters

request (Django Request) – the request to extract the namespace from.

Returns

FleetingNamespace that matches the token or None

Return type

FleetingNamespace or None

get_url_shortener_display(*, field=<django.db.models.fields.CharField: url_shortener>)
hard_limit

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
retention

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

save(*args, **kwargs)[source]

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.

soft_limit

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

style

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

subdomain

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

support_email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

token

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property total_forms
total_forms_between(_from, _to)[source]
total_forms_since(date)[source]
url_shortener

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

user

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

user_id
webhooks

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class fleetingform.models.FleetingTemplate(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Templates control how the form is displayed and which actions are taken.

Every form has a template. The template defines which HTML page will be rendered and which actions will be taken when the user submits the form.

The simplest template, ‘generic’, renders a title, introductory content, and a single form. On submit, the contents of the form are saved in the results.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

TEMPLATE_CONTENT_TYPES = (('md', 'Markdown'), ('rst', 'ReStructured Text'), ('txt', 'Plain Text'))
TEMPLATE_CONTENT_TYPE_MARKDOWN = 'md'
TEMPLATE_CONTENT_TYPE_PLAINTEXT = 'txt'
TEMPLATE_CONTENT_TYPE_RESTRUCTURED = 'rst'
TEMPLATE_HELPERS = {'generic': 'fleetingform.template_helpers.generic.GenericTemplateHelper'}
TEMPLATE_TYPES = (('generic', 'Generic'), ('stripe', 'Stripe'), ('paypal', 'Paypal'))
TEMPLATE_TYPE_GENERIC = 'generic'
TEMPLATE_TYPE_PAYPAL = 'paypal'
TEMPLATE_TYPE_STRIPE = 'stripe'
actions

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

content

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

content_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

form

Accessor to the related object on the reverse side of a one-to-one relation.

In the example:

class Restaurant(Model):
    place = OneToOneField(Place, related_name='restaurant')

Place.restaurant is a ReverseOneToOneDescriptor instance.

form_controls

Accessor to the related objects manager on the one-to-many relation created by GenericRelation.

In the example:

class Post(Model):
    comments = GenericRelation(Comment)

post.comments is a ReverseGenericManyToOneDescriptor instance.

get_content_type_display(*, field=<django.db.models.fields.CharField: content_type>)
get_type_display(*, field=<django.db.models.fields.CharField: type>)
property helper

Get the helper class name for this template.

Returns

helper class full dotted path.

Return type

str

helper_class()[source]

Get the helper class.

Returns

class object for this template type’s helper.

Return type

class

Raises

ImportError if helper cannot be found.

property html_template

Get the HTML template path for this Template

Returns

full static HTML template path.

Return type

str

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
params

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property supported_templates

Get the list of supported templates.

Returns

supported template names.

Return type

[str, ]

classmethod template_helper_class_for(_type)[source]

Get the helper class for any supported template type.

Returns

class object for this template type’s helper.

Return type

class

Raises

KeyError if the type isn’t valid, ImportError if helper cannot be found.

title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class fleetingform.models.FleetingUser(id, auth, username, password, email, phone, opened_on, attempts)[source]

Bases: django.db.models.base.Model

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

attempts

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

auth

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

auth_id
authenticate(plain_password)[source]

Authenticate this user with plain_password.

Parameters

plain_password (str) – the plain text password to authenticate

Returns

True is the password matches, else False

Return type

bool

email

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

encrypt_and_set_password(plain_password)[source]

Encrypt and set the user password.

Parameters

plain_password (str) – the password to encrypt and set.

generate_and_send_otp()[source]

Generate and send a new one time passcode to the user.

Raises

FleetingAuthOTPError on OTP send failure.

id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
opened_on

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

property otp_contact_obscured

The contact information used to send OTP, obscured.

Hides the email or phone number with some x’s.

Returns

email or phone for this user with some x’s

Return type

str

password

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

phone

The descriptor for the phone number attribute on the model instance. Returns a PhoneNumber when accessed so you can do stuff like:

>>> instance.phone_number.as_international

Assigns a phone number object on assignment so you can do:

>>> instance.phone_number = PhoneNumber(...)

or,

>>> instance.phone_number = '+414204242'
username

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class fleetingform.models.FleetingValidation(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A custom field validation.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

VALIDATION_TYPES = (('regex', 'Regular Expression'), ('min-length', 'Minimum Length'), ('max-length', 'Maximum Length'), ('range-length', 'Length Range'), ('min', 'Minimum Value'), ('max', 'Maximum Value'), ('range', 'Value Range'))
VALIDATION_TYPE_MAX = 'max'
VALIDATION_TYPE_MAX_LENGTH = 'max-length'
VALIDATION_TYPE_MIN = 'min'
VALIDATION_TYPE_MIN_LENGTH = 'min-length'
VALIDATION_TYPE_RANGE = 'range'
VALIDATION_TYPE_RANGE_LENGTH = 'range-length'
VALIDATION_TYPE_REGEX = 'regex'
form_control

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

form_control_id
get_type_display(*, field=<django.db.models.fields.CharField: type>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

message

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
params

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class fleetingform.models.FleetingWebhook(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Webhooks for namespaces.

Enables a user-configurable callback when a form changes state.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

WEBHOOK_EVENTS = (('create', 'Created'), ('complete', 'Completed'), ('error', 'Error'), ('access', 'On Access'))
WEBHOOK_EVENT_ACCESS = 'access'
WEBHOOK_EVENT_COMPLETE = 'complete'
WEBHOOK_EVENT_CREATE = 'create'
WEBHOOK_EVENT_ERROR = 'error'
event

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

get_event_display(*, field=<django.db.models.fields.CharField: event>)
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

namespace

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

namespace_id
objects = <django.db.models.manager.Manager object>
token

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

url

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.