;ò
0^ÖCc           @   sZ   d  Z  d k Td k l Z d k l Z d k l Z d k Z d e e	 f d „  ƒ  YZ
 d S(   sH   
   Copyright (C) 2005-2006 PimenTech SARL (http://www.pimentech.net)
   
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   This library 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
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with this library; see the file COPYING.LIB.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.	
(   s   *(   s   Object(   s	   sqlcommon(   s   autostrftimeNs
   SQLFactoryc           B   sY   t  Z d  Z d Z e Z e Z e Z d Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z RS(   s    The MaMa Object for SQL !s
   SQLFactoryi    c         C   sg   d } t i ƒ  i d ƒ | d <|  i ƒ  | d <|  i | ƒ | d <| t i	 |  i
 | ƒ d 7} | Sd  S(   Ns   Set DateStyle To European;
s   %d/%m/%Y %H:%M:%Ss	   datemodifs	   codemodifs	   authmodifs   
(   s   querys   DateTimes   strftimes   dict_valuess   selfs   _get_code_logs   get_ref_authors   REQUESTs	   sqlcommons
   sql_updates	   tablename(   s   selfs   dict_valuess   REQUESTs   query(    (    s   SQLFactory.pys   _query_change&   s    c         C   sg   d } t i ƒ  i d ƒ | d <|  i ƒ  | d <|  i | ƒ | d <| t i	 |  i
 | ƒ d 7} | Sd  S(   Ns   Set DateStyle To European;
s   %d/%m/%Y %H:%M:%Ss   datecreas   codecreas   authcreas   
(   s   querys   DateTimes   strftimes   dict_valuess   selfs   _get_code_logs   get_ref_authors   REQUESTs	   sqlcommons
   sql_inserts	   tablename(   s   selfs   dict_valuess   REQUESTs   query(    (    s   SQLFactory.pys   _query_insert.   s    c         C   s-   h  d | <} d | d <|  i | | ƒ Sd  S(   Ns   uidi   s
   ref_statut(   s   uids   dict_valuess   selfs   _query_changes   REQUEST(   s   selfs   uids   REQUESTs   dict_values(    (    s   SQLFactory.pys   _query_delete6   s    
c         C   s³   |  i h  d | d <d | <| ƒ } xM d d d d d d d f D]0 } y | i | ƒ WqD t j
 o
 qD qD XqD Wd	 | d
 <| | d <| |  _	 | |  i
 | | ƒ 7} | Sd S(   s    duplication in postgresql s   uids
   ref_objects   datecreas	   datemodifs   authcreas	   authmodifs   codecreas	   codemodifi   s   frozenN(   s   selfs   _query_changes	   copy_dicts   history_refs   REQUESTs   querys   keys   pops   KeyErrors
   ref_objects   _query_insert(   s   selfs	   copy_dicts   history_refs   REQUESTs   keys   query(    (    s   SQLFactory.pys   _copy;   s     ( 

	c         C   sÄ   t  | i ƒ } x& | D] } | i |  i j o Pq q W| i |  i j o7 d | i d i | i d i ƒ  | i	 i
 ƒ  f ‚ n | i	 i d | ƒ o# d | i	 i
 ƒ  | i ƒ  f ‚ n | Sd  S(   Ns   %s(%s) is not allowed for %si    s   Views:   user %s is not allowed to access cibles for affectation %s(   s   lists   REQUESTs   PARENTSs   aq_chains   objs	   meta_types   selfs   accesss   getIds   AUTHENTICATED_USERs   getUserNames   has_permission(   s   selfs   REQUESTs   aq_chains   obj(    (    s   SQLFactory.pys   _check_securityI   s     	7#(   s   __name__s
   __module__s   __doc__s	   meta_types   Nones	   tablenames   accesss   autostrftimes
   ref_objects   _query_changes   _query_inserts   _query_deletes   _copys   _check_security(    (    (    s   SQLFactory.pys
   SQLFactory   s    				(   s   __doc__s   OFS.SimpleItems"   Products.PimenTechLibCommon.objects   Objects   Products.PimenTechLibCommons	   sqlcommons"   Products.PimenTechLibCommon.commons   autostrftimes   DateTimes
   SimpleItems
   SQLFactory(   s   autostrftimes   Objects   DateTimes
   SQLFactorys	   sqlcommon(    (    s   SQLFactory.pys   ?   s   	
