Package: django-modeldict-yplan
django-modeldictRetired: this project is no longer maintained.I (Adam Johnson) no longer
have time to continue maintaining this. I was doing so to supportgargoyle-yplan, a fork for my
ex-employer YPlan. If you’d like to sponsor ongoing maintenance or take it over
yourself, please contactme@adamj.eu.ModelDictis a very efficient way to store things like settings in your database. The entire model is transformed into a dictionary (lazily) as well as stored in your cache. It’s invalidated only when it needs to be (both in process and based onCACHE_BACKEND).It was originally created byDisqus, but due to the inactivity we at YPlan have taken over maintenance on this fork.RequirementsTested with all combinations of:Python: 3.6Django: 1.11, 2.0, 2.1, 2.2Python 3.4+ supported.InstallInstall it withpip:pipinstalldjango-modeldict-yplanMake sure youpip uninstalldjango-modeldictfirst if you’re upgrading from the original to this fork - the packages clash.Example Usage# You'll need a model with fields to use as key and value in the dictclassSetting(models.Model):key=models.CharField(max_length=32)value=models.CharField(max_length=200)# Create the ModelDict...settings=ModelDict(Setting,key='key',value='value',instances=False)# And you can treat it like a normal dict:# Missing values = KeyErrorsettings['foo']>>>KeyError# Sets supportedsettings['foo']='hello'# Fetch the current value using normal dictionary accesssettings['foo']>>>'hello'# ...or by normal model queriesSetting.objects.get(key='foo').value>>>'hello'HistoryPending release2.0.3 (2019-05-17)Retired: this project is no longer maintained.I (Adam Johnson) no longer
have time to continue maintaining this. I was doing so to supportgargoyle-yplan, a fork for my
ex-employer YPlan. If you’d like to sponsor ongoing maintenance or take it
over yourself, please contactme@adamj.eu.2.0.2 (2019-04-28)Tested with Django 2.2. No changes were needed for compatibility.2.0.1 (2019-02-15)No functional changes. This is a re-release of version 2.0.0 to fix immutable
metadata on PyPI so that Pip on Python 2 doesn’t pick up the Python 3 only
2.X series.Version 2.0.0 will be pulled from PyPI on 2019-03-01.2.0.0 (2019-01-29)This version is due to be pulled from PyPI, please use version 2.0.1 as per
its above release note.Drop Python 2 support, only Python 3.4+ is supported now.Drop Django 1.8, 1.9, and 1.10 support. Only Django 1.11+ is supported now.Removeiteritems(),iterkeys(), anditervalues()methods fromModelDict, and moveitems(),keys(), andvalues()to Python 3
semantics, returning iterators rather than lists.Include LICENSE file in wheel.Tested with Django 2.1. No changes were needed for compatibility.1.5.4 (2016-10-28)Fixed a race condition in threaded code. Seehttps://github.com/adamchainz/django-modeldict/pull/40for a detailed
explanation. Thanks @Jaidan.1.5.3 (2016-09-20)Stop roundingtime.time()down to the nearest integer, so we are more fine grained around expiration. It might
also fix a subtle timing bug around re-fetching the remote cache unnecessarily.1.5.2 (2016-07-31)Fixed update missing when_local_last_updatedcould be set even when it
wasn’t updatedFixed update missing from integer rounding in time comparisonFixedCachedDict.__repr__so it works for other subclasses ofCachedDictthanModelDict(don’t assumeself.modelexists)1.5.1 (2016-06-13)Fixed local cache never expiring if value was checked too often.Use Django’scache.set_manyfor more efficient storage.1.5.0 (2016-01-11)Forked by YPlanFixed concurrency TOCTTOU bug for threaded Django servers.Stopped including the ‘tests’ directory in packageDjango 1.8 and 1.9 supported.Python 3 support added.Fixedsetdefault()to return the value that was set/found, as per normal dict semantics. Thanks @olevinsky.1.4.1 (2012-12-04)Last release by Disqus