mango r233 - in branches/django: . mango
- From: ovitters svn gnome org
- To: svn-commits-list gnome org,gnome-sysadmin gnome org
- Subject: mango r233 - in branches/django: . mango
- Date: Sun, 22 Jun 2008 21:26:36 +0000 (UTC)
Author: ovitters
Date: Sun Jun 22 21:26:35 2008
New Revision: 233
URL: http://svn.gnome.org/viewvc/mango?rev=233&view=rev
Log:
* mango/models.py (Modules): Add Modules class, reflecting the modules
in LDAP.
* mango/urls.py: Make add_account view available as /requests/add/
* mango/views.py (add_account): Do the bare minimum to have the XSLT
template display the form. Submitting doesn't work at this stage.
Modified:
branches/django/ (props changed)
branches/django/ChangeLog
branches/django/mango/models.py
branches/django/mango/urls.py
branches/django/mango/views.py
Modified: branches/django/mango/models.py
==============================================================================
--- branches/django/mango/models.py (original)
+++ branches/django/mango/models.py Sun Jun 22 21:26:35 2008
@@ -188,4 +188,8 @@
for group in user.groups:
node = ET.SubElement(formnode, 'group', {'cn': group.cn})
+class Modules(LdapObject):
+
+ BASEDN = settings.MANGO_CFG['ldap_modules_basedn']
+ MULTI_ATTRS = set(('memberUid', 'objectClass'))
Modified: branches/django/mango/urls.py
==============================================================================
--- branches/django/mango/urls.py (original)
+++ branches/django/mango/urls.py Sun Jun 22 21:26:35 2008
@@ -1,6 +1,6 @@
from django.conf.urls.defaults import *
-from mango.views import current_datetime, list_users, list_accounts, edit_user, list_mirrors, edit_mirror, list_foundationmembers, view_index
+from mango.views import current_datetime, list_users, list_accounts, edit_user, list_mirrors, edit_mirror, list_foundationmembers, view_index, add_account
import mango.settings
urlpatterns = patterns('',
@@ -9,6 +9,7 @@
(r'^%susers/$' % mango.settings.SITE_ROOT, list_users),
(r'^%susers/edit/(?P<user>\w+)/$' % mango.settings.SITE_ROOT, edit_user),
(r'^%srequests/$' % mango.settings.SITE_ROOT, list_accounts),
+ (r'^%srequests/add/$' % mango.settings.SITE_ROOT, add_account),
(r'^%smirrors/$' % mango.settings.SITE_ROOT, list_mirrors),
(r'^%smirrors/edit/(?P<pk>\d+)/$' % mango.settings.SITE_ROOT, edit_mirror),
(r'^%sfoundationmembers/$' % mango.settings.SITE_ROOT, list_foundationmembers),
Modified: branches/django/mango/views.py
==============================================================================
--- branches/django/mango/views.py (original)
+++ branches/django/mango/views.py Sun Jun 22 21:26:35 2008
@@ -156,6 +156,23 @@
return get_xmlresponse(doc, "list_accounts.xsl")
+def add_account(request):
+ doc, root = get_xmldoc('Login Page', request)
+ form = ET.SubElement(root, 'newaccount')
+
+ filter = '(&(!(objectClass=localizationModule))(objectClass=gnomeModule))'
+ dev_modules = models.Modules.search(filter)
+
+ filter = '(objectClass=localizationModule)'
+ trans_modules = models.Modules.search(filter)
+
+ for module in dev_modules:
+ ET.SubElement(form, 'gnomemodule', {'cn': module.cn})
+ for module in trans_modules:
+ ET.SubElement(form, 'translation', {'cn': module.cn, 'desc': module.description})
+
+
+ return get_xmlresponse(doc, "new_account.xsl")
def list_mirrors(request):
doc, root = get_xmldoc('List Mirrors', request)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]