Index: tests/modeltests/basic/tests.py
===================================================================
--- tests/modeltests/basic/tests.py	(revision 15530)
+++ tests/modeltests/basic/tests.py	(working copy)
@@ -50,6 +50,8 @@
         self.assertEqual(Article.objects.get(pub_date__year=2005, pub_date__month=7), a)
         self.assertEqual(Article.objects.get(pub_date__year=2005, pub_date__month=7, pub_date__day=28), a)
         self.assertEqual(Article.objects.get(pub_date__week_day=5), a)
+        self.assertEqual(Article.objects.get(pub_date__week_of_year=30), a)
+        self.assertEqual(Article.objects.get(pub_date__day_of_year=209), a)
 
         # The "__exact" lookup type can be omitted, as a shortcut.
         self.assertEqual(Article.objects.get(id=a.id), a)
 
Index: django/db/models/sql/where.py
===================================================================
--- django/db/models/sql/where.py	(revision 15530)
+++ django/db/models/sql/where.py	(working copy)
@@ -199,7 +199,7 @@
                         params)
         elif lookup_type in ('range', 'year'):
             return ('%s BETWEEN %%s and %%s' % field_sql, params)
-        elif lookup_type in ('month', 'day', 'week_day'):
+        elif lookup_type in ('month', 'day', 'week_day', 'week_of_year', 'day_of_year'):
             return ('%s = %%s' % connection.ops.date_extract_sql(lookup_type, field_sql),
                     params)
         elif lookup_type == 'isnull':
 
Index: django/db/models/sql/constants.py
===================================================================
--- django/db/models/sql/constants.py	(revision 15530)
+++ django/db/models/sql/constants.py	(working copy)
@@ -4,7 +4,7 @@
 QUERY_TERMS = dict([(x, None) for x in (
     'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in',
     'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year',
-    'month', 'day', 'week_day', 'isnull', 'search', 'regex', 'iregex',
+    'month', 'day', 'week_day', 'week_of_year', 'day_of_year', 'isnull', 'search', 'regex', 'iregex',
     )])
 
 # Size of each "chunk" for get_iterator calls.
 
Index: django/db/models/fields/__init__.py
===================================================================
--- django/db/models/fields/__init__.py	(revision 15530)
+++ django/db/models/fields/__init__.py	(working copy)
@@ -283,8 +283,8 @@
             return value._prepare()
 
         if lookup_type in (
-                'regex', 'iregex', 'month', 'day', 'week_day', 'search',
-                'contains', 'icontains', 'iexact', 'startswith', 'istartswith',
+                'regex', 'iregex', 'month', 'day', 'week_day', 'week_of_year', 'day_of_year',
+                'search','contains', 'icontains', 'iexact', 'startswith', 'istartswith',
                 'endswith', 'iendswith', 'isnull'
             ):
             return value
@@ -317,7 +317,7 @@
                 sql, params = value._as_sql(connection=connection)
             return QueryWrapper(('(%s)' % sql), params)
 
-        if lookup_type in ('regex', 'iregex', 'month', 'day', 'week_day', 'search'):
+        if lookup_type in ('regex', 'iregex', 'month', 'day', 'week_day', 'week_of_year', 'day_of_year', 'search'):
             return [value]
         elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte'):
             return [self.get_db_prep_value(value, connection=connection, prepared=prepared)]
@@ -639,7 +639,7 @@
     def get_prep_lookup(self, lookup_type, value):
         # For "__month", "__day", and "__week_day" lookups, convert the value
         # to an int so the database backend always sees a consistent type.
-        if lookup_type in ('month', 'day', 'week_day'):
+        if lookup_type in ('month', 'day', 'week_day', 'week_of_year', 'day_of_year'):
             return int(value)
         return super(DateField, self).get_prep_lookup(lookup_type, value)
 
Index: django/db/backends/postgresql/operations.py
===================================================================
--- django/db/backends/postgresql/operations.py	(revision 15530)
+++ django/db/backends/postgresql/operations.py	(working copy)
@@ -24,6 +24,13 @@
         if lookup_type == 'week_day':
             # For consistency across backends, we return Sunday=1, Saturday=7.
             return "EXTRACT('dow' FROM %s) + 1" % field_name
+        elif lookup_type == 'day_of_year':
+            # http://www.postgresql.org/docs/8.3/static/functions-formatting.html
+            return "TO_CHAR(%s, 'DDD')" % field_name
+        elif lookup_type == 'week_of_year':
+            # http://www.postgresql.org/docs/8.3/static/functions-formatting.html
+            # returns ISO week of the year.
+            return "TO_CHAR(%s, 'IW')" % field_name
         else:
             return "EXTRACT('%s' FROM %s)" % (lookup_type, field_name)
 
Index: django/db/backends/sqlite3/base.py
===================================================================
--- django/db/backends/sqlite3/base.py	(revision 15530)
+++ django/db/backends/sqlite3/base.py	(working copy)
@@ -256,8 +256,15 @@
         dt = util.typecast_timestamp(dt)
     except (ValueError, TypeError):
         return None
+
+    _, iso_week, iso_week_day = dt.isocalendar()
+    
     if lookup_type == 'week_day':
-        return (dt.isoweekday() % 7) + 1
+        return (iso_week_day % 7) + 1
+    elif lookup_type == 'week_of_year':
+        return iso_week
+    elif lookup_type == 'day_of_year':
+        return int(dt.strftime('%j'))
     else:
         return getattr(dt, lookup_type)
 
Index: django/db/backends/mysql/base.py
===================================================================
--- django/db/backends/mysql/base.py	(revision 15530)
+++ django/db/backends/mysql/base.py	(working copy)
@@ -155,6 +155,14 @@
             # DAYOFWEEK() returns an integer, 1-7, Sunday=1.
             # Note: WEEKDAY() returns 0-6, Monday=0.
             return "DAYOFWEEK(%s)" % field_name
+        elif lookup_type == 'day_of_year':
+            # DAYOFYEAR() returns the day of the year (1-366)
+            return "DAYOFYEAR(%s)" % field_name
+        elif lookup_type == 'week_of_year':
+            # WEEKOFYEAR() returns the ISO week of the year (1-53).
+            # The first week having 4 or more days in the year is considered week 1.
+            return "WEEKOFYEAR(%s)" % field_name
+        
         else:
             return "EXTRACT(%s FROM %s)" % (lookup_type.upper(), field_name)
 
Index: django/db/backends/oracle/base.py
===================================================================
--- django/db/backends/oracle/base.py	(revision 15530)
+++ django/db/backends/oracle/base.py	(working copy)
@@ -115,6 +115,12 @@
         if lookup_type == 'week_day':
             # TO_CHAR(field, 'D') returns an integer from 1-7, where 1=Sunday.
             return "TO_CHAR(%s, 'D')" % field_name
+        elif lookup_type == 'day_of_year':
+            # TO_CHAR(field, 'DDD') returns an integer from 1-366, representing the day of the year.
+            return "TO_CHAR(%s, 'DDD')" % field_name
+        elif lookup_type == 'week_of_year':
+            # TO_CHAR(field, 'IW') returns an integer from 1-53, representing the ISO week of the year.
+            return "TO_CHAR(%s, 'IW')" % field_name
         else:
             return "EXTRACT(%s FROM %s)" % (lookup_type, field_name)
 
