Changes between Initial Version and Version 1 of new_meta_api


Ignore:
Timestamp:
Jul 11, 2014, 4:53:12 AM (10 years ago)
Author:
pirosb3
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • new_meta_api

    v1 v1  
     1
     2== The new Options API proposal
     3
     4As of my 2014 Summer of Code project, my second deliverable is a refactored working implementation of the Options API.
     5The Options API is at the core of Django, it enables introspection of Django Models with the rest of the system. This includes lookups, queries, forms, admin to understand the capabilities of every model. The Options API is hidden under the _meta attribute of each model class.
     6Options has always been a private API, but Django developers have always been using it in their projects in a non-official way. This is obviously very dangerous because, as there are no official endpoints, Options could change breaking other people's implementation. Options did not have any unit-tests, but the entire system uses it and relies on it to work correctly.
     7My Summer of Code project is all about understanding and refactoring Options to make it a testable and official API that Django and any other developer can use.
     8
     9=== Current state of the API
     10I now have a working and tested implementation of Options, I have managed to simplify 20+ functions and reduce them to 2 main endpoints, that are the main API. Because Options needs to be very fast, I necessarily had to add some accessors on Options for the most common calls (although both endpoints are cached, we can increase speed by avoiding function calls). Each accessor is a cached property and is computed, using the new API, on first access.
     11
     12For this reason, I am planning to release in attached PR:
     13 - Unit tests for the new Meta API
     14 - The new Meta API
     15 - The implementation of the new API throughout django and django.contrib
     16
     17
     18
     19
     20
     21- Soc Status (second deliverable)
     22- Why
     23
     24-The API
     25 - get_fields
     26 - get_field
     27
     28- Fast access Calls
     29 - fields
     30 -
Back to Top