Exemplo n.º 1
0
Arquivo: views.py Projeto: XYZ17/MRBS
	class Meta:
		model = m.Booking
		columns = ['booking_id','date','starttime','endtime','room','booking_title','no_of_attendees','involve','equipment','confidential','booking_status','cancel']
		ordering = ['-date','starttime','endtime']
		processors = {
			'starttime': helpers.format_date('%I:%M %p'),
			'endtime': helpers.format_date('%I:%M %p'),
			}
Exemplo n.º 2
0
Arquivo: views.py Projeto: XYZ17/MRBS
	class Meta:
		model = m.Booking
		columns = ['booking_id','sort_date','date','starttime','endtime','room','booking_status','prioritize','booking_title','booked_by','equipment','confidential','involve','no_of_attendees','attendees']
		ordering = ['date','starttime','endtime','-room']
		processors = {
			'starttime': helpers.format_date('%I:%M %p'),
			'endtime': helpers.format_date('%I:%M %p'),
			'room': helpers.make_xeditable(type="select",source=['S','M','B']),
			'prioritize': helpers.make_xeditable(type="select",source=['Yes','No']),
			'booking_status': helpers.make_xeditable(type="select",source=['Approve','Reject']),
			}
Exemplo n.º 3
0
class HelpersReferenceDatatableView(DemoMixin, XEditableDatatableView):
    """
    ``datatableview.helpers`` is a module decidated to functions that can be supplied directly as
    column callback functions.  Some of them are easy to use at runtime in your own callbacks,
    making some work easier for you, but the majority aim to solve common problems with as little
    fuss as possible.
    """
    model = Entry
    datatable_options = {
        'columns': [
            ("ID", 'id', helpers.link_to_model),
            ("Blog", 'blog__name',
             helpers.link_to_model(key=lambda instance: instance.blog)),
            ("Headline", 'headline', helpers.make_xeditable),
            ("Body Text", 'body_text', helpers.itemgetter(slice(0, 30))),
            ("Publication Date", 'pub_date',
             helpers.format_date('%A, %b %d, %Y')),
            ("Modified Date", 'mod_date'),
            ("Age", 'pub_date', helpers.through_filter(timesince)),
            ("Interaction", 'get_interaction_total',
             helpers.make_boolean_checkmark),
            ("Comments", 'n_comments', helpers.format("{0:,}")),
            ("Pingbacks", 'n_pingbacks', helpers.format("{0:,}")),
        ],
    }

    implementation = u"""
Exemplo n.º 4
0
 class Meta:
     model = Quote
     ordering = ['-modified']
     columns = ['qt', 'project', 'modified']
     search_fields = ['quote_number', 'project']
     processors = {
         'modified': helpers.format_date('%Y-%m-%d at %H:%M')
     }