Django

Code

Changeset 2328

Show
Ignore:
Timestamp:
02/17/06 12:33:09 (3 years ago)
Author:
adrian
Message:

Fixed #1177 -- Added django.VERSION and '--version' command to django-admin.py/manage.py

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/management.py

    r2272 r2328  
    6363# field as the field to which it points. 
    6464get_rel_data_type = lambda f: (f.get_internal_type() in ('AutoField', 'PositiveIntegerField', 'PositiveSmallIntegerField')) and 'IntegerField' or f.get_internal_type() 
     65 
     66def get_version(): 
     67    "Returns the version as a human-format string." 
     68    from django import VERSION 
     69    v = '.'.join([str(i) for i in VERSION[:-1]]) 
     70    if VERSION[3]: 
     71        v += ' (%s)' % VERSION[3] 
     72    return v 
    6573 
    6674def get_sql_create(mod): 
     
    901909def execute_from_command_line(action_mapping=DEFAULT_ACTION_MAPPING): 
    902910    # Parse the command-line arguments. optparse handles the dirty work. 
    903     parser = DjangoOptionParser(get_usage(action_mapping)) 
     911    parser = DjangoOptionParser(usage=get_usage(action_mapping), version=get_version()) 
    904912    parser.add_option('--settings', 
    905913        help='Python path to settings module, e.g. "myproject.settings.main". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.') 
  • django/trunk/django/__init__.py

    r3 r2328  
     1VERSION = (0, 9, 1, 'SVN')