Skip to content

Instantly share code, notes, and snippets.

@emilepetrone
Created May 12, 2011 15:45
Show Gist options
  • Save emilepetrone/968794 to your computer and use it in GitHub Desktop.
Save emilepetrone/968794 to your computer and use it in GitHub Desktop.
Date Dictionary
meal = get_object_or_404(Meal, id=meal_id)
date_dictionary = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']
mealdate = date_dictionary[meal.date.weekday()]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment