2
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
4
# Copyright (C) 2010 James Jesudason <james.jesudason@canonical.com>
5
# This program is free software: you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 3, as published
7
# by the Free Software Foundation.
9
# This program is distributed in the hope that it will be useful, but
10
# WITHOUT ANY WARRANTY; without even the implied warranties of
11
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12
# PURPOSE. See the GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License along
15
# with this program. If not, see <http://www.gnu.org/licenses/>.
18
from wsdlexplorer.common.database import Database
22
"""Model class for a WSDL Connection"""
23
# WSDL Connection record defaults
24
record_type = "http://wiki.ubuntu.com/Quickly/WSDLConnection"
25
keys = ["Name", "Type" ,"WSDL", "Username"]
29
self.database = Database()
32
self.types = ["WSDL", "Salesforce"]
35
"""Get the CouchGrid for display"""
36
grid = self.database.get_grid(self.record_type, self.keys)
39
def save_record(self, record):
40
record_id = self.database.save_record(self.record_type, record, self.key_field)
43
def get_record(self, record):
44
document = self.database.get_record(self.record_type, record, self.key_field)
47
def delete_record(self, record):
48
self.database.delete_record(self.record_type, record, self.key_field)