What would be the best approach for the following...
In a Django I have a view with a variable called 'showItem
' which could be true
or false
. I want to set showItem to true 40% of the time and false 60% of the time, with options to change these odds later on.
Using Python how should I go about this?
Part of view:
def get_context_data(self, **kwargs):
context = super(EntryDetail, self).get_context_data(**kwargs)
context['showItem'] = (odds?????)
return context