Fixed small issues with parameters. It is required fix.

This commit is contained in:
Timur Nurlygayanov 2013-03-04 18:24:27 +04:00
parent 1c92f3ad22
commit 93044d53f6
6 changed files with 14 additions and 17 deletions

View File

@ -35,11 +35,11 @@ import pdb
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
class WizardForm1(forms.Form): class WizardFormServiceType(forms.Form):
_type = forms.ChoiceField(label=_("Service Type")) _type = forms.ChoiceField(label=_("Service Type"))
class WizardForm2(forms.Form): class WizardFormConfiguration(forms.Form):
subject = forms.CharField(max_length=100) subject = forms.CharField(max_length=100)
sender = forms.CharField(max_length=1) sender = forms.CharField(max_length=1)

View File

@ -81,8 +81,7 @@ class DeleteDataCenter(tables.BatchAction):
return True return True
def action(self, request, datacenter_id): def action(self, request, datacenter_id):
datacenter = api.windc.datacenters_get(request, datacenter_id) api.windc.datacenters_delete(request, datacenter_id)
api.windc.datacenters_delete(request, datacenter)
class DeleteService(tables.BatchAction): class DeleteService(tables.BatchAction):
@ -101,9 +100,8 @@ class DeleteService(tables.BatchAction):
link = request.__dict__['META']['HTTP_REFERER'] link = request.__dict__['META']['HTTP_REFERER']
datacenter_id = re.search('windc/(\S+)', link).group(0)[6:-1] datacenter_id = re.search('windc/(\S+)', link).group(0)[6:-1]
############## ##############
datacenter = api.windc.datacenters_get(request, datacenter_id)
api.windc.services_delete(request, datacenter, service_id) api.windc.services_delete(request, datacenter_id, service_id)
class EditService(tables.LinkAction): class EditService(tables.LinkAction):

View File

@ -22,7 +22,7 @@ from django.conf.urls.defaults import patterns, url
from .views import IndexView, CreateWinDCView, WinServices, CreateWinServiceView from .views import IndexView, CreateWinDCView, WinServices, CreateWinServiceView
from .views import Wizard from .views import Wizard
from .forms import WizardForm1, WizardForm2 from .forms import WizardFormServiceType, WizardFormConfiguration
VIEW_MOD = 'openstack_dashboard.dashboards.project.windc.views' VIEW_MOD = 'openstack_dashboard.dashboards.project.windc.views'
@ -32,7 +32,8 @@ urlpatterns = patterns(VIEW_MOD,
url(r'^create_dc$', CreateWinDCView.as_view(), name='create_dc'), url(r'^create_dc$', CreateWinDCView.as_view(), name='create_dc'),
url(r'^(?P<data_center_id>[^/]+)/$', WinServices.as_view(), url(r'^(?P<data_center_id>[^/]+)/$', WinServices.as_view(),
name='services'), name='services'),
url(r'^update$', Wizard.as_view([WizardForm2, WizardForm2]), url(r'^update$',
Wizard.as_view([WizardFormServiceType, WizardFormConfiguration]),
name='update'), name='update'),
url(r'^(?P<service_id>[^/]+)/$', WinServices.as_view(), url(r'^(?P<service_id>[^/]+)/$', WinServices.as_view(),
name='service_details') name='service_details')

View File

@ -40,7 +40,7 @@ from horizon.forms.views import ModalFormMixin
from openstack_dashboard import api from openstack_dashboard import api
from .tables import WinDCTable, WinServicesTable from .tables import WinDCTable, WinServicesTable
from .workflows import CreateWinService, CreateWinDC from .workflows import CreateWinService, CreateWinDC
from .forms import WizardForm1, WizardForm2 from .forms import WizardFormServiceType, WizardFormConfiguration
import pdb import pdb
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -57,7 +57,6 @@ class Wizard(ModalFormMixin, SessionWizardView, generic.FormView):
form = super(Wizard, self).get_form(step, data, files) form = super(Wizard, self).get_form(step, data, files)
print step print step
print data print data
print files
return form return form
class IndexView(tables.DataTableView): class IndexView(tables.DataTableView):

View File

@ -35,9 +35,9 @@ class DCManager(base.Manager):
body.update(extra) body.update(extra)
return self._create('/datacenters', body, 'datacenter') return self._create('/datacenters', body, 'datacenter')
def delete(self, datacenter): def delete(self, datacenter_id):
return self._delete("/datacenters/%s" % base.getid(datacenter)) return self._delete("/datacenters/%s" % datacenter_id)
def get(self, datacenter): def get(self, datacenter_id):
return self._get("/datacenters/%s" % base.getid(datacenter), return self._get("/datacenters/%s" % datacenter_id,
'datacenter') 'datacenter')

View File

@ -37,10 +37,9 @@ class DCServiceManager(base.Manager):
return self._create("/datacenters/%s/services" % base.getid(datacenter), return self._create("/datacenters/%s/services" % base.getid(datacenter),
body, 'service') body, 'service')
def delete(self, datacenter, service): def delete(self, datacenter_id, service_id):
return self._delete("/datacenters/%s/services/%s" % \ return self._delete("/datacenters/%s/services/%s" % \
(base.getid(datacenter), (datacenter_id, service_id))
base.getid(service)))
def get(self, datacenter, service): def get(self, datacenter, service):
return self._get("/datacenters/%s/services/%s" % \ return self._get("/datacenters/%s/services/%s" % \