title: Create a database entry for a value according to range
body: <p>I'm working with Django/python and I need to enter a value in a database which has predefined ranges which correspond to the values.</p>
  
  <p>Eg: If the entry I have to make has a value of 125. I need to retrieve the data for the range of 125-130. If the entry does not exist in the database then it should create a new entry in the database (suppose the range 130-135 does not exist when I have to work with a value of 132).</p>
  
  <p>How should go about creating something like this? Is there a specific name for this kind of operation?</p>