On Tue, Jul 11, 2017 at 1:52 PM Alok Gandhi
wrote:
> If you consider creating the model data dict having status as the keys
> then the whole search becomes increasingly simple:
>
True. Although imagine that the model data is likely to have more fields
than just a
If you consider creating the model data dict having status as the keys then
the whole search becomes increasingly simple:
# Force an order for status search
STATUS_SEARCH_ORDER = ('Approved', 'In Progress', 'Pending', 'In Use')
def get_model(model_data):
model = None
model_status = None
Hey,
Check out these two approaches:
https://repl.it/JViC/1
The overall approach is to have a custom comparison function so that you
can sort you model dict by status and then by name. We would want our
subset of statuses that are "available" to come first, followed by a
secondary sorting of the
I have created a dictionary in which it stores the information as follows:
dict = {'model_v001': 'In Progress',
'model_v002': 'In Use',
'model_v003': 'In Progress',
'model_v004': 'In Progress',
'model_v005': 'Approved',
'model_v006': 'Pending'}
I am trying to achieve that, from the