Ejemplo n.º 1
0
		def __init__(self, var_name,height=None, width=None, html_id='chart', 
			         display='week',type_chart='AreaChart'):
			self.var_name=var_name
			self.real_estate_node_template='admin/templatetags/graphs/graphs.html'
			self.html_id=html_id
			self.html_id+=radomstring(max=20)
			self.display=display
			self.height=height
			self.width=width
			self.type_chart=str(type_chart)
Ejemplo n.º 2
0
 def __init__(self,
              var_name,
              height=None,
              width=None,
              html_id='chart',
              display='week',
              type_chart='AreaChart'):
     self.var_name = var_name
     self.real_estate_node_template = 'admin/templatetags/graphs/graphs.html'
     self.html_id = html_id
     self.html_id += radomstring(max=20)
     self.display = display
     self.height = height
     self.width = width
     self.type_chart = str(type_chart)
Ejemplo n.º 3
0
	def clean_slug(self):
		"""
		Use clean because a slug is target as unique, and maybe user can add a photo with 
		same name.
		"""
		from django.template.defaultfilters import slugify
		
		slug=self.cleaned_data.get('slug')
		try:
			photo_name=self.cleaned_data['photo']._name
			
			if slugify(photo_name) == slug:
				slug=u'%s%s' %(slug, radomstring())
		except AttributeError:
			pass

		return slug
Ejemplo n.º 4
0
    def clean_slug(self):
        """
		Use clean because a slug is target as unique, and maybe user can add a photo with 
		same name.
		"""
        from django.template.defaultfilters import slugify

        slug = self.cleaned_data.get('slug')
        try:
            photo_name = self.cleaned_data['photo']._name

            if slugify(photo_name) == slug:
                slug = u'%s%s' % (slug, radomstring())
        except AttributeError:
            pass

        return slug
Ejemplo n.º 5
0
    def __init__(self,
                 var_name,
                 object_id=None,
                 date='',
                 html_id='calendar',
                 display='month',
                 height=None,
                 editable=False,
                 admin=False,
                 headers=False,
                 events=True):

        try:
            self.object_id = object_id and int(object_id) or object_id
        except ValueError:
            self.object_id = template.Variable(object_id)

        self.var_name = var_name
        self.display = display
        self.date = date
        self.events = events
        self.height = height
        self.headers = headers
        self.admin = admin
        self.editable = editable
        self.edit_url = ''
        self.html_id = html_id

        self.html_id += radomstring(max=20)

        if self.date:
            self.date = template.Variable(date)

        if self.object_id and not self.admin:
            self.add_url = reverse('visitcalendar-create-object',
                                   args=(object_id, ))
        else:
            self.add_url = reverse('admin:visitcalendar_visitevent_add')

        self.real_estate_node_template = "admin/visitcalendar/templatetags/visitcalendar_list_%s_node.html" % self.display

        if self.display == 'week':
            self.display = 'agendaWeek'
        if self.display == 'day':
            self.display = 'agendaDay'
        def __init__(self, var_name, object_id=None, date='', html_id='calendar',
                     display='month', height=None, editable=False, admin=False, 
                     headers=False, events=True):

            try:
                self.object_id = object_id and int(object_id) or object_id
            except ValueError:
                self.object_id =  template.Variable(object_id)

            
            self.var_name=var_name
            self.display=display
            self.date = date 
            self.events=events
            self.height=height
            self.headers=headers
            self.admin = admin
            self.editable = editable
            self.edit_url = ''
            self.html_id = html_id

            self.html_id+=radomstring(max=20)

            if self.date:
                self.date = template.Variable(date)

            if self.object_id and not self.admin:
                self.add_url = reverse('visitcalendar-create-object',args=(object_id,))
            else:
                self.add_url = reverse('admin:visitcalendar_visitevent_add')
            
            self.real_estate_node_template="admin/visitcalendar/templatetags/visitcalendar_list_%s_node.html" % self.display

            if self.display == 'week':
                self.display='agendaWeek'
            if self.display == 'day':
                self.display='agendaDay'