title: Django: How to depend on an externally ID, which can be switched?
body: <p>Consider the following scenario: </p>
  
  <p>Our Django database objects must rely on IDs that are provided by external service A (<code>ESA</code>) - this is because we use this ID to pull the information about objects that aren't created yet from the external directly. <code>ESA</code> might shut down soon, so we also pull information about the same objects from external service B (<code>ESB</code>), and save them as a fallback.</p>
  
  <p>Because these IDs are relied on heavily in views and URLs, the ideal scenario would be to use a @property:</p>
  
  <pre><code>@property
  dynamic_id = ESA_id
  </code></pre>
  
  <p>And then, if <code>ESA</code> shuts down, we can switch easily by changing <code>dynamic_id</code> to <code>ESB_id</code>. The problem with this though, is that properties cannot be used in queryset filters and various other scenarios, which is also a must in this case.</p>
  
  <p>My current thought is to just save ESA_id, ESB_id, and dynamic_ID as regular fields separately and assign <code>dynamic_ID = ESA_id</code>, and then, in case <code>ESA</code> shuts down, simply go over the objects and do <code>dynamic_ID = ESB_id</code>.</p>
  
  <p>But I feel there must be a better way?</p>