title: How to retrieve records from past weeks in django
body: <p>I am having trouble in django on how to retrieve data from last week (not 7 days ago). Using <code>date.isocalendar()[1]</code> would be great. However Some stackoverflow browsing lead me to no satisfactory results. </p>
  
  <p>Whatsoever, I could do without portability and use mysql's <code>INTERVAL</code> function. This is the query I want to make using django's ORM.</p>
  
  <p><code>SELECT id, user_id, CAST(timestamp AS Date), WEEK(timestamp,3), WEEK(CURDATE(), 3) FROM main_userstats WHERE week(timestamp, 3) = WEEK(DATE_SUB(CURDATE(), INTERVAL 1 WEEK ), 3)</code> </p>
  
  <p>how can I do this using the <code>extra</code> function in django (if it's not possible to do in any other simpler way)? </p>