Changes between Version 23 and Version 24 of new_meta_api


Ignore:
Timestamp:
Sep 11, 2014, 8:57:58 AM (10 years ago)
Author:
pirosb3
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • new_meta_api

    v23 v24  
    358358Returns all the reverse objects pointing to the current model.
    359359
    360 
    361 
    362 This API has remained the same, but the newer implementation is more efficient.
    363 
    364 
    365 
    366 ==== Use cached_properties when possible
    367 Function calls are expensive in Python, All sensible attributes with no arguments have been transformed into cached_properties.
    368 A cached property is a read-only property that is calculated on demand and automatically cached. If the value has already been calculated, the cached value is returned. Cached properties avoid a new stack and are used for fast-access to fields, concrete_fields,
    369 local_concrete_fields, many_to_many, field_names
    370 
    371 
    372 
     360===== _meta.field_names
     361This API has remains the same, but the newer implementation is more efficient.
     362
     363=== Field flags
     364Each field and/or object defines a set of flags that are used by the developer to manually narrow down the search or iteration of the above API calls. By defining field flags, we give the possibility for developers to create custom-made field instances that can behave correctly in an admin interface or in auto-generated model forms.
     365
     366===== field.concrete
     367A concrete field has a database column associated to it's field instance.
     368
     369===== field.editable
     370An editable field is a field that's data can be manipulated (an Autofield for example should not be manipulated and responds False to an "editable" query).
     371
     372===== field.has_many_values
     373A field that can contain 1 or more values. This does not need to necessary be a ManyToMany field, but can also be a future ArrayField.
     374
     375===== field.has_relation
     376A field has a relation when it depends on 1 or more models, and therefore might generate reverse relations on the pointed model.
     377
     378===== object.is_related_object and field.is_related_object
     379A very simple way to query if an object returned from get_field() or get_fields() is a reverse object or a forward object.
Back to Top