[Mpuls-commits] r1459 - in wasko/branches/2.0: mpulsweb/model waskaweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Feb 10 15:14:17 CET 2010


Author: torsten
Date: 2010-02-10 15:14:16 +0100 (Wed, 10 Feb 2010)
New Revision: 1459

Added:
   wasko/branches/2.0/mpulsweb/model/news.py
Removed:
   wasko/branches/2.0/waskaweb/model/news.py
Log:
Moved news model to base


Copied: wasko/branches/2.0/mpulsweb/model/news.py (from rev 1458, wasko/branches/2.0/waskaweb/model/news.py)


Property changes on: wasko/branches/2.0/mpulsweb/model/news.py
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: wasko/branches/2.0/waskaweb/model/news.py
===================================================================
--- wasko/branches/2.0/waskaweb/model/news.py	2010-02-10 13:26:21 UTC (rev 1458)
+++ wasko/branches/2.0/waskaweb/model/news.py	2010-02-10 14:14:16 UTC (rev 1459)
@@ -1,70 +0,0 @@
-#-*- coding: utf-8 -*-
-#
-# Copyright 2007, 2008 Intevation GmbH, Germany, <info at intevation.de>
-# 
-# This file is part of mpuls WASKA (CoMPUter-based case fiLeS - 
-# Web-Anwendungs-Server fuer Kompetenzagenturen).
-# 
-# mpuls WASKA is free software: you can redistribute it and/or modify it under
-# the terms of the GNU Affero General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-# 
-# mpuls WASKA is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
-# License for more details.
-# 
-# You should have received a copy of the GNU Affero General Public
-# License along with mpuls WASKA. If not, see <http://www.gnu.org/licenses/>.
-# 
-# mpuls WASKA has been developed on behalf of the 
-# Projekttraeger im Deutschen Zentrum fuer Luft- und Raumfahrt e.V. (PT-DLR)
-# within the programme Kompetenzagenturen (Durchfuehrungsphase) funded by
-# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and 
-# European Social Fund resources.
-#
-# Authors:
-# Torsten Irländer <torsten.irlaender at intevation.de>
-#
-import psycopg2.extras
-import os
-import traceback
-import sys
-from mpulsweb.lib.db import db
-
-FETCH_ALL_NEWS = """SELECT id, datum, titel, nachricht, art_beschreibung FROM ka_nachrichten_tbl_view WHERE id NOT IN (SELECT nachrichten_id from nm_benutzer_nachrichten_tbl_view WHERE benutzer_id = %(user_id)s) ORDER BY datum DESC"""
-
-class NewsFactory:
-    def __init__(self):
-        pass
-
-    def createByData(self, **attr):
-        return News(**attr)
-
-class NewsList:
-    '''List of news objects for the given user'''
-    def __init__(self, user):
-        self.list = []
-        factory = NewsFactory()
-        try:
-            conn = db.getConnection()
-            cur = conn.cursor()
-            cur.execute(FETCH_ALL_NEWS, {'user_id': user.id})
-            for row in cur.fetchall():
-                self.list.append(factory.createByData(id=row[0], date=row[1], title=row[2], text=row[3], type=row[4]))
-        finally:
-            db.recycleConnection(conn, cur)
-
-    def getList(self):
-        return self.list
-
-class News:
-    def __init__(self, id=None, date=None, title=None, text=None, type=None):
-        self.id    = id
-        self.date  = date
-        self.title = title
-        self.text  = text
-        self.type  = type
-
-# vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8:



More information about the Mpuls-commits mailing list