Resource Field for dealing with integervalues
new (require("tastypie/fields/float"))()
Extends:
- Source:
Requires
- module:tastypie/lib/class
- module:tastypie/lib/fields/api
Methods
-
<protected> augment(resource, name)
-
Injects dynamic properties onto field instance for later use
Parameters:
Name Type Description resource
Resource the resource instance this field is attached to
name
String The property name this field is associated to
- Inherited From:
- Source:
-
convert(val)
-
Converts data value into the serialization specific type.
Parameters:
Name Type Description val
Mixed value to convert
- Inherited From:
- Source:
Returns:
value The converted field value
- Type
- Mixed
-
dehydrate(object, attribute)
-
Converts a javascript object / value into something sutable for seriaation. ex. Date formatting
Parameters:
Name Type Description object
Object Object to dehydrate before serialization
attribute
Sting | function a name path or function to use to retrieve a value from the object
- Inherited From:
- Source:
Returns:
value object value converted to its internal type
- Type
- Mixed
-
format()
-
returns a sample of the format expected and returned by a field
- Inherited From:
- Source:
Returns:
The format expected for a particular field type
- Type
- String | undefined
-
hydrate(bundle)
-
Converts a serialized value in to a javascript object value
Parameters:
Name Type Description bundle
Bundle a bundle representing the current request
- Inherited From:
- Source: