def notification_list(request, username, page=0, paginate_by=10, **kwargs): """Displays the list of all filtered notifications. """ user = get_object_or_404(User, username=username) if request.method == 'POST': form = SubscriptionsForm(request.POST, user=user) if form.is_valid(): form.save() form = SubscriptionsForm(user=user) messages.success(request, _("The user was updated successfully.")) else: if Signature.objects.count() > 0: form = SubscriptionsForm(user=user) else: form = None return filtered_list_detail(request, Notification.objects.filter(user=user), fields=['title', 'created', 'read'], paginate_by=paginate_by, page=page, extra_context={ 'form': form, 'object': user, }, **kwargs)
def tag_list(request, page=0, paginate_by=5, **kwargs): """Displays the list of all tags. """ return filtered_list_detail(request, Tag.objects.all(), fields=['title'], paginate_by=paginate_by, page=page, **kwargs)
def category_list(request, page=0, paginate_by=5, **kwargs): """Displays the list of all categories. """ return filtered_list_detail(request, Category.objects.filter(parent=None), fields=['title', 'parent'], paginate_by=paginate_by, page=page, **kwargs)
def project_list(request, page=0, paginate_by=5, **kwargs): """Displays the list of all published projects. """ return filtered_list_detail( request, Project, fields=['code', 'title', 'author', 'manager', 'created', 'status'], paginate_by=paginate_by, page=page, **kwargs)
def salesinvoice_list(request, page=0, paginate_by=10, **kwargs): """Shows a sales invoice list. """ return filtered_list_detail(request, Document.objects.get_for_content(SalesInvoice), fields=['code', 'author', 'created', 'owner'], page=page, paginate_by=paginate_by, template_name='sales/salesinvoice_list.html', **kwargs)
def warehouse_list(request, page=0, paginate_by=10, **kwargs): """Shows a warehouse list. """ return filtered_list_detail(request, Warehouse, fields=['name', 'owner', 'address'], page=page, paginate_by=paginate_by, template_name='stock/warehouse_list.html', **kwargs)
def letter_list(request, page=0, paginate_by=10, **kwargs): """Shows a letter list. """ return filtered_list_detail(request, Document.objects.get_for_content(Letter), fields=['code', 'author', 'created', 'owner'], page=page, paginate_by=paginate_by, template_name='partners/letter_list.html', **kwargs)
def poll_list(request, page=0, paginate_by=5, **kwargs): """Displays the list of all polls. """ return filtered_list_detail( request, Poll, fields=['title', 'description', 'author', 'created'], paginate_by=paginate_by, page=page, **kwargs)
def faq_list(request, page=0, paginate_by=5, **kwargs): """Displays the list of all FAQs. """ return filtered_list_detail( request, Faq, fields=['title', 'question', 'author', 'created'], paginate_by=paginate_by, page=page, **kwargs)
def page_list(request, page=0, paginate_by=5, **kwargs): """Displays the list of all wiki pages. """ return filtered_list_detail( request, WikiPage, fields=['slug', 'language', 'author', 'created'], paginate_by=paginate_by, page=page, **kwargs)
def poll_list(request, page=0, paginate_by=5, **kwargs): """Displays the list of all polls. """ return filtered_list_detail( request, Poll, fields=['title', 'description', 'author', 'created'], paginate_by=paginate_by, page=page, **kwargs )
def faq_list(request, page=0, paginate_by=5, **kwargs): """Displays the list of all FAQs. """ return filtered_list_detail( request, Faq, fields=['title', 'question', 'author', 'created'], paginate_by=paginate_by, page=page, **kwargs )
def expensevoucher_list(request, page=0, paginate_by=10, **kwargs): """Displays the list of all filtered expensevouchers. """ return filtered_list_detail( request, Document.objects.get_for_content(ExpenseVoucher), fields=['code', 'author', 'created', 'owner', 'status'], paginate_by=paginate_by, page=page, template_name='hr/expensevoucher_list.html', **kwargs)
def tag_list(request, page=0, paginate_by=5, **kwargs): """Displays the list of all tags. """ return filtered_list_detail( request, Tag.objects.all(), fields=['title'], paginate_by=paginate_by, page=page, **kwargs )
def category_list(request, page=0, paginate_by=5, **kwargs): """Displays the list of all categories. """ return filtered_list_detail( request, Category.objects.filter(parent=None), fields=['title', 'parent'], paginate_by=paginate_by, page=page, **kwargs )
def employee_list(request, page=0, paginate_by=10, **kwargs): """Displays the list of all filtered employees. """ return filtered_list_detail( request, Employee, paginate_by=paginate_by, page=page, template_name='hr/employee_list.html', **kwargs )
def page_list(request, page=0, paginate_by=5, **kwargs): """Displays the list of all wiki pages. """ return filtered_list_detail( request, WikiPage, fields=['slug', 'language', 'author', 'created'], paginate_by=paginate_by, page=page, **kwargs )
def task_list(request, page=0, paginate_by=10, **kwargs): """Displays the list of all filtered tasks. """ return filtered_list_detail( request, Task.objects.planned(user=request.user), paginate_by=paginate_by, page=page, fields=['title', 'start', 'end', 'created', 'closed'], **kwargs )
def contact_jobs(request, id, page=0, paginate_by=10, **kwargs): """Shows the contact's jobs. """ contact = get_object_or_404(Contact, pk=id) return filtered_list_detail(request, contact.job_set.all(), exclude=['id', 'contact'], paginate_by=paginate_by, page=page, extra_context={'object': contact}, template_name='partners/contact_jobs.html')
def contact_list(request, page=0, paginate_by=10, **kwargs): """Show all registered contacts. """ return filtered_list_detail(request, Contact, fields=[ 'id', 'firstname', 'lastname', 'language', 'timezone', 'email', 'main_phone_number' ], paginate_by=paginate_by, page=page, **kwargs)
def warehouse_list(request, page=0, paginate_by=10, **kwargs): """Shows a warehouse list. """ return filtered_list_detail( request, Warehouse, fields=['name', 'owner', 'address'], page=page, paginate_by=paginate_by, template_name='stock/warehouse_list.html', **kwargs )
def deliverynote_list(request, page=0, paginate_by=10, **kwargs): """Shows a delivery note list. """ return filtered_list_detail( request, Document.objects.get_for_content(DeliveryNote), fields=['code', 'author', 'created', 'owner'], page=page, paginate_by=paginate_by, template_name='stock/deliverynote_list.html', **kwargs )
def bankaccount_list(request, page=0, paginate_by=10, **kwargs): """Shows a bank account list. """ return filtered_list_detail( request, BankAccount, fields=['bank_name', 'bic', 'iban', 'owner'], page=page, paginate_by=paginate_by, template_name='sales/bankaccount_list.html', **kwargs )
def product_list(request, page=0, paginate_by=10, **kwargs): """Shows a product list. """ return filtered_list_detail( request, Product, fields=['name', 'code', 'ean13', 'description', 'is_consumable', 'is_service'], page=page, paginate_by=paginate_by, template_name='products/product_list.html', **kwargs )
def salesinvoice_list(request, page=0, paginate_by=10, **kwargs): """Shows a sales invoice list. """ return filtered_list_detail( request, Document.objects.get_for_content(SalesInvoice), fields=['code', 'author', 'created', 'owner'], page=page, paginate_by=paginate_by, template_name='sales/salesinvoice_list.html', **kwargs )
def user_list(request, page=0, paginate_by=10, **kwargs): """Displays the list of all active users. """ return filtered_list_detail( request, MyUser.objects.all(), fields=['username', 'first_name', 'last_name', 'is_active', 'is_staff', 'is_superuser', 'last_login'], paginate_by=paginate_by, page=page, template_name='auth/user_list.html', **kwargs )
def unplanned_task_list(request, page=0, paginate_by=10, **kwargs): """Displays the list of all filtered tasks. """ return filtered_list_detail( request, Task.objects.unplanned(user=request.user), paginate_by=paginate_by, page=page, fields=['title', 'created', 'closed'], template_name='todo/unplanned_task_list.html', **kwargs )
def partner_list(request, page=0, paginate_by=10, **kwargs): """Shows a partner list. """ return filtered_list_detail( request, Partner, fields=["name", "is_managed", "is_supplier", "is_customer", "lead_status", "vat_number", "email"], page=page, paginate_by=paginate_by, template_name="partners/partner_list.html", **kwargs )
def letter_list(request, page=0, paginate_by=10, **kwargs): """Shows a letter list. """ return filtered_list_detail( request, Document.objects.get_for_content(Letter), fields=['code', 'author', 'created', 'owner'], page=page, paginate_by=paginate_by, template_name='partners/letter_list.html', **kwargs )
def partner_list(request, page=0, paginate_by=10, **kwargs): """Shows a partner list. """ return filtered_list_detail( request, Partner, fields=['name', 'is_managed', 'is_supplier', 'is_customer', 'lead_status', 'vat_number', 'email'], page=page, paginate_by=paginate_by, template_name='partners/partner_list.html', **kwargs )
def expensevoucher_list(request, page=0, paginate_by=10, **kwargs): """Displays the list of all filtered expensevouchers. """ return filtered_list_detail( request, Document.objects.get_for_content(ExpenseVoucher), fields=['code', 'author', 'created', 'owner', 'status'], paginate_by=paginate_by, page=page, template_name='hr/expensevoucher_list.html', **kwargs )
def movement_list(request, page=0, paginate_by=10, **kwargs): """Shows a movement list. """ return filtered_list_detail( request, Movement, fields=['id', 'origin', 'destination', 'product_entry', 'created'], page=page, paginate_by=paginate_by, template_name='stock/movement_list.html', **kwargs )
def milestone_list(request, project, page=0, paginate_by=5, **kwargs): """Displays the list of all milestones of a specified project. """ project = get_object_or_404(Project, code=project) return filtered_list_detail( request, project.milestone_set.all(), fields=['code', 'title', 'parent', 'author', 'manager', 'created', 'deadline', 'closed'], paginate_by=paginate_by, page=page, extra_context={'object': project}, **kwargs )
def page_revisions(request, slug, page=0, paginate_by=10, **kwargs): """Displays the list of revisions for the selected page. """ object = get_object_or_404(WikiPage, slug=slug) return filtered_list_detail( request, object.revisions.all(), fields=['slug', 'body', 'author', 'created'], paginate_by=paginate_by, page=page, template_name='knowledge/wikipage_revisions.html', extra_context={'object': object}, **kwargs)
def product_list(request, page=0, paginate_by=10, **kwargs): """Shows a product list. """ return filtered_list_detail(request, Product, fields=[ 'name', 'code', 'ean13', 'description', 'is_consumable', 'is_service' ], page=page, paginate_by=paginate_by, template_name='products/product_list.html', **kwargs)
def page_revisions(request, slug, page=0, paginate_by=10, **kwargs): """Displays the list of revisions for the selected page. """ object = get_object_or_404(WikiPage, slug=slug) return filtered_list_detail( request, object.revisions.all(), fields=['slug', 'body', 'author', 'created'], paginate_by=paginate_by, page=page, template_name='knowledge/wikipage_revisions.html', extra_context={'object': object}, **kwargs )
def event_list(request, year=None, month=None, day=None, page=0, paginate_by=10, **kwargs): """Displays the list of all calendar for the request user. """ return filtered_list_detail( request, Event.objects.for_user(request.user), paginate_by=paginate_by, page=page, fields=['title', 'start', 'end', 'created'], extra_context={ 'current_day': _current_day(year, month, day), }, **kwargs )
def user_list(request, page=0, paginate_by=10, **kwargs): """Displays the list of all active users. """ return filtered_list_detail(request, MyUser.objects.all(), fields=[ 'username', 'first_name', 'last_name', 'is_active', 'is_staff', 'is_superuser', 'last_login' ], paginate_by=paginate_by, page=page, template_name='auth/user_list.html', **kwargs)
def partner_contacts(request, id, page=0, paginate_by=10, **kwargs): """Shows the partner's contacts. """ partner = get_object_or_404(Partner, pk=id) return filtered_list_detail( request, partner.job_set.all(), exclude=["id", "partner"], paginate_by=paginate_by, page=page, extra_context={"object": partner}, template_name="partners/partner_contacts.html", )
def partner_contacts(request, id, page=0, paginate_by=10, **kwargs): """Shows the partner's contacts. """ partner = get_object_or_404(Partner, pk=id) return filtered_list_detail( request, partner.job_set.all(), exclude=['id', 'partner'], paginate_by=paginate_by, page=page, extra_context={'object': partner}, template_name='partners/partner_contacts.html' )
def milestone_list(request, project, page=0, paginate_by=5, **kwargs): """Displays the list of all milestones of a specified project. """ project = get_object_or_404(Project, code=project) return filtered_list_detail(request, project.milestone_set.all(), fields=[ 'code', 'title', 'parent', 'author', 'manager', 'created', 'deadline', 'closed' ], paginate_by=paginate_by, page=page, extra_context={'object': project}, **kwargs)
def warehouse_movements(request, id, page=0, paginate_by=10, **kwargs): """Shows the warehouse's movements. """ warehouse = get_object_or_404(Warehouse, pk=id) return filtered_list_detail( request, Movement.objects.for_warehouse(warehouse), fields=['id', 'origin', 'destination', 'product_entry', 'created'], page=page, paginate_by=paginate_by, template_name='stock/warehouse_movements.html', extra_context={'object': warehouse}, **kwargs)
def product_supplies(request, id, page=0, paginate_by=10, **kwargs): """Shows the product's supplies. """ product = get_object_or_404(Product, pk=id) return filtered_list_detail( request, product.supply_set.all(), fields=['id', 'supplier', 'purchase_price', 'minimal_quantity', 'max_purchase_discount', 'payment_terms'], page=page, paginate_by=paginate_by, template_name='products/product_supplies.html', extra_context={'object': product}, **kwargs )
def warehouse_movements(request, id, page=0, paginate_by=10, **kwargs): """Shows the warehouse's movements. """ warehouse = get_object_or_404(Warehouse, pk=id) return filtered_list_detail( request, Movement.objects.for_warehouse(warehouse), fields=['id', 'origin', 'destination', 'product_entry', 'created'], page=page, paginate_by=paginate_by, template_name='stock/warehouse_movements.html', extra_context={'object': warehouse}, **kwargs )
def ticket_list(request, project, page=0, paginate_by=5, **kwargs): """Displays the list of all tickets of a specified project. """ project = get_object_or_404(Project, code=project) return filtered_list_detail( request, project.tickets.all(), fields=['code', 'title', 'parent', 'author', 'manager', 'created', 'closed', 'urgency', 'status'], paginate_by=paginate_by, page=page, extra_context={ 'object': project, }, **kwargs )
def bookmark_list(request, username, page=0, paginate_by=10, **kwargs): """Displays the list of all bookmarks for the current user. """ user = get_object_or_404(User, username=username) return filtered_list_detail( request, Bookmark.objects.filter(menu=user.get_profile().bookmarks), fields=['title', 'url', 'description', 'new_window'], paginate_by=paginate_by, page=page, extra_context={ 'object': user, }, template_name='menus/bookmark_list.html', **kwargs)
def bookmark_list(request, username, page=0, paginate_by=10, **kwargs): """Displays the list of all bookmarks for the current user. """ user = get_object_or_404(User, username=username) return filtered_list_detail( request, Bookmark.objects.filter(menu=user.get_profile().bookmarks), fields=['title', 'url', 'description', 'new_window'], paginate_by=paginate_by, page=page, extra_context={ 'object': user, }, template_name='menus/bookmark_list.html', **kwargs )
def product_supplies(request, id, page=0, paginate_by=10, **kwargs): """Shows the product's supplies. """ product = get_object_or_404(Product, pk=id) return filtered_list_detail(request, product.supply_set.all(), fields=[ 'id', 'supplier', 'purchase_price', 'minimal_quantity', 'max_purchase_discount', 'payment_terms' ], page=page, paginate_by=paginate_by, template_name='products/product_supplies.html', extra_context={'object': product}, **kwargs)
def hardcopy_list(request, id, page=0, paginate_by=10, **kwargs): """Displays the list of all hard copies of the given document. """ document = get_object_or_404(Document, id=id) return filtered_list_detail( request, HardCopy.objects.filter(document=document), paginate_by=paginate_by, page=page, fields=['file', 'language', 'created'], extra_context={ 'object': document, }, template_name=kwargs.pop('template_name', '%s/%s_hardcopies.html' % (document.content_type.app_label, document.content_type.model)), **kwargs )
def ticket_list(request, project, page=0, paginate_by=5, **kwargs): """Displays the list of all tickets of a specified project. """ project = get_object_or_404(Project, code=project) return filtered_list_detail(request, project.tickets.all(), fields=[ 'code', 'title', 'parent', 'author', 'manager', 'created', 'closed', 'urgency', 'status' ], paginate_by=paginate_by, page=page, extra_context={ 'object': project, }, **kwargs)
def milestone_tickets(request, project, code, page=0, paginate_by=5, **kwargs): """Displays the list of all tickets of a specified milestone. """ project = get_object_or_404(Project, code=project) milestone = get_object_or_404(Milestone, code=code) return filtered_list_detail( request, milestone.tickets.all(), fields=['id', 'title', 'parent', 'author', 'manager', 'created', 'closed', 'urgency', 'status'], paginate_by=paginate_by, page=page, extra_context={ 'project': project, 'object': milestone }, template_name='projects/milestone_tickets.html', **kwargs )
def hardcopy_list(request, id, page=0, paginate_by=10, **kwargs): """Displays the list of all hard copies of the given document. """ document = get_object_or_404(Document, id=id) return filtered_list_detail( request, HardCopy.objects.filter(document=document), paginate_by=paginate_by, page=page, fields=['file', 'language', 'created'], extra_context={ 'object': document, }, template_name=kwargs.pop( 'template_name', '%s/%s_hardcopies.html' % (document.content_type.app_label, document.content_type.model)), **kwargs)