Remove mediagoblin.db.sql.fake.DESCENDING

This is the last remnant that requires us to keep db.sql.fake.py. Use
ModelName.desc() or sqlalchemy.sql.expression.desc(column) to achieve
descending sorts.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Sebastian Spaeth
2013-01-07 11:15:04 +01:00
parent 208842590c
commit 0efe9e2796
7 changed files with 17 additions and 52 deletions

View File

@@ -14,8 +14,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from mediagoblin.db.util import media_entries_for_tag_slug, DESCENDING
from mediagoblin.db.sql.models import MediaEntry
from mediagoblin.db.util import media_entries_for_tag_slug
from mediagoblin.tools.pagination import Pagination
from mediagoblin.tools.response import render_to_response
from mediagoblin.decorators import uses_pagination
@@ -45,7 +45,7 @@ def tag_listing(request, page):
tag_slug = request.matchdict[u'tag']
cursor = media_entries_for_tag_slug(request.db, tag_slug)
cursor = cursor.sort('created', DESCENDING)
cursor = cursor.order_by(MediaEntry.created.desc())
pagination = Pagination(page, cursor)
media_entries = pagination()
@@ -71,7 +71,7 @@ def tag_atom_feed(request):
tag_slug = request.matchdict[u'tag']
cursor = media_entries_for_tag_slug(request.db, tag_slug)
cursor = cursor.sort('created', DESCENDING)
cursor = cursor.order_by(MediaEntry.created.desc())
cursor = cursor.limit(ATOM_DEFAULT_NR_OF_UPDATED_ITEMS)
"""