def add_meetmefeatures(self, **kwargs): kwargs.setdefault('id', self._generate_int()) kwargs.setdefault('meetmeid', self._generate_int()) kwargs.setdefault('name', ''.join(random.choice('abcdefghijklmnopqrstuvwxyz') for _ in range(6))) kwargs.setdefault('confno', ''.join(random.choice('0123456789') for _ in range(6))) kwargs.setdefault('context', ''.join(random.choice('abcdefghijklmnopqrstuvwxyz') for _ in range(6))) kwargs.setdefault('admin_identification', 'all') kwargs.setdefault('admin_mode', 'all') kwargs.setdefault('admin_announcejoinleave', 'no') kwargs.setdefault('user_mode', 'all') kwargs.setdefault('user_announcejoinleave', 'no') kwargs.setdefault('emailbody', '') kwargs.setdefault('description', '') meetmefeatures = MeetmeFeatures(**kwargs) self.add_me(meetmefeatures) return meetmefeatures
def _insert_meetme(self, meetmeid, name, confno, pin=None, context='foo'): var_val = confno if pin is None else ','.join([confno, pin]) static_meetme = StaticMeetme() static_meetme.category = 'rooms' static_meetme.var_name = 'conf' static_meetme.var_val = var_val static_meetme.filename = 'meetme.conf' self.session.begin() self.session.add(static_meetme) self.session.commit() meetme = MeetmeFeatures() meetme.meetmeid = meetmeid meetme.name = name meetme.confno = confno meetme.meetmeid = static_meetme.id meetme.context = context meetme.admin_identification = 'all' meetme.admin_mode = 'all' meetme.admin_announcejoinleave = 'no' meetme.user_mode = 'all' meetme.user_announcejoinleave = 'no' meetme.emailbody = '' meetme.description = '' self.session.begin() self.session.add(meetme) self.session.commit() return meetme
def _add_meetme(form, staticmeetmeid): meetme = MeetmeFeatures() meetme.meetmeid = staticmeetmeid meetme.name = form.name.data meetme.confno = form.confno.data meetme.context = form.context.data meetme.admin_identification = 'pin' meetme.admin_mode = 'all' meetme.admin_announcejoinleave = 'no' meetme.user_mode = 'all' meetme.user_announcejoinleave = 'no' meetme.emailbody = '' meetme.description = form.description.data return meetme