From 4de673ad2147cc559f83fd9f3a89dda36a6779ef Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Wed, 26 Oct 2011 11:12:14 -0600 Subject: [PATCH] Tweaked docs for get_subclass, added changelog entry. --- CHANGES.rst | 2 ++ README.rst | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 420b669..5eb2790 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,8 @@ CHANGES tip (unreleased) ---------------- +- Added ``InheritanceManager.get_subclass()``. Thanks smacker. + 1.0.0 (2011.06.16) ------------------ diff --git a/README.rst b/README.rst index 3e7591d..e8c3776 100644 --- a/README.rst +++ b/README.rst @@ -263,14 +263,15 @@ be returned as their actual type, you can pass subclass names to nearby_places = Place.objects.select_subclasses("restaurant") # restaurants will be Restaurant instances, bars will still be Place instances -Also it provides syntax sugar for `get()` method:: +``InheritanceManager`` also provides a subclass-fetching alternative to the +``get()`` method:: place = Place.objects.get_subclass(id=some_id) # "place" will automatically be an instance of Place, Restaurant, or Bar -If you don't explicitly call ``select_subclasses()``, an ``InheritanceManager`` -behaves identically to a normal ``Manager``; so it's safe to use as your -default manager for the model. +If you don't explicitly call ``select_subclasses()`` or ``get_subclass()``, +an ``InheritanceManager`` behaves identically to a normal ``Manager``; so +it's safe to use as your default manager for the model. .. note:: ``InheritanceManager`` currently only supports a single level of model