Changeset 1768

Show
Ignore:
Timestamp:
09/16/08 09:00:41 (18 months ago)
Author:
JensDiemer
Message:
  • move ModelForm?2 into forms_utils and use it in install section, too.
  • set version string to RC2
Location:
trunk/pylucid_project/PyLucid
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid_project/PyLucid/install/install.py

    r1731 r1768  
    1414 
    1515from PyLucid.install.BaseInstall import BaseInstall 
     16from PyLucid.tools.forms_utils import ModelForm2 
    1617 
    1718import sys, os 
     
    204205 
    205206 
    206 class CreateUserForm(forms.ModelForm): 
     207class CreateUserForm(ModelForm2): 
    207208    """ 
    208209    form for input the username, used in auth.login() 
  • trunk/pylucid_project/PyLucid/plugins_internal/auth/auth.py

    r1758 r1768  
    6161    warnings.warn("Debugmode is on", UserWarning) 
    6262 
    63  
    6463from django.conf import settings 
     64 
    6565from PyLucid.tools import crypt 
     66from PyLucid.models import JS_LoginData, Page 
     67from PyLucid.tools.forms_utils import ModelForm2 
    6668from PyLucid.system.BasePlugin import PyLucidBasePlugin 
    6769from PyLucid.system.context_processors import add_dynamic_context 
    68 from PyLucid.models import JS_LoginData, Page 
     70 
    6971 
    7072 
     
    160162#______________________________________________________________________________ 
    161163# FORMS 
    162  
    163 class ModelForm2(forms.ModelForm): 
    164     def validate_unique(self): 
    165         """ 
    166         Don't validate unique fields. 
    167         We used a ModelForm only for generating the forms and not for 
    168         create/update any database data. So a field unique Test would like 
    169         generate Errors like: 
    170             User with this Username already exists. 
    171         """ 
    172         pass 
    173  
    174164 
    175165class UsernameForm(ModelForm2): 
  • trunk/pylucid_project/PyLucid/tools/forms_utils.py

    r1722 r1768  
    153153 
    154154 
     155class ModelForm2(forms.ModelForm): 
     156    """ 
     157    A model form witch don't validate unique fields. 
     158     
     159    This ModelForm is only for generating the forms and not for create/update 
     160    any database data. So a field unique Test would like generate Errors like: 
     161        User with this Username already exists. 
     162         
     163    see also: 
     164    http://www.jensdiemer.de/_command/118/blog/detail/30/ (de) 
     165    http://www.python-forum.de/topic-16000.html (de) 
     166    """ 
     167    def validate_unique(self): 
     168        pass 
     169 
     170 
     171 
    155172 
    156173if __name__ == "__main__": 
  • trunk/pylucid_project/PyLucid/__init__.py

    r1762 r1768  
    1919try: 
    2020    from django.utils.version import get_svn_revision 
    21  
     21     
    2222    svn_revision = get_svn_revision("PyLucid") 
    2323    if svn_revision == u'SVN-unknown': 
     
    3636# - No spaces: "0.8.0 RC2" -> "0.8.0RC2" 
    3737# http://peak.telecommunity.com/DevCenter/setuptools#specifying-your-project-s-version 
    38 PYLUCID_VERSION = (0, 8, 5, svn_revision) 
    39 PYLUCID_VERSION_STRING = "0.8.5" + svn_revision 
     38PYLUCID_VERSION = (0, 8, 5, "RC2", svn_revision) 
     39PYLUCID_VERSION_STRING = "0.8.5RC2" + svn_revision 
    4040 
    4141