Example #1
0
	def delete(self, flavor_id = None):
		# delete the entry from the db
		flavor = Flavor.get_by_id(long(flavor_id))

		if flavor:
			flavor.key.delete()
			self.add_message('Flavor successfully deleted!', 'success')
		else:
			self.add_message('Flavor was not deleted.  Something went horribly wrong somewhere!', 'warning')

		# hangout for a second
		time.sleep(1)

		# use the channel to tell the browser we are done and reload
		channel_token = self.request.get('channel_token')
		channel.send_message(channel_token, 'reload')
		return
Example #2
0
    def put(self, flavor_id=None):
        flavor = Flavor.get_by_id(long(flavor_id))

        # get the enable/active state
        enable = self.request.get("enable")

        if flavor:
            if enable == '1':
                flavor.active = True
                flavor.put()
            else:
                flavor.active = False
                flavor.put()

        # hangout for a second
        time.sleep(1)

        return
Example #3
0
	def put(self, flavor_id = None):
		flavor = Flavor.get_by_id(long(flavor_id))

		# get the enable/active state
		enable = self.request.get("enable")
		
		if flavor:
			if enable == '1':
				flavor.active = True
				flavor.put()
			else:
				flavor.active = False
				flavor.put()
		
		# hangout for a second
		time.sleep(1)
		
		return
Example #4
0
    def delete(self, flavor_id=None):
        # delete the entry from the db
        flavor = Flavor.get_by_id(long(flavor_id))

        if flavor:
            flavor.key.delete()
            self.add_message('Flavor successfully deleted!', 'success')
        else:
            self.add_message(
                'Flavor was not deleted.  Something went horribly wrong somewhere!',
                'warning')

        # hangout for a second
        time.sleep(1)

        # use the channel to tell the browser we are done and reload
        channel_token = self.request.get('channel_token')
        channel.send_message(channel_token, 'reload')
        return