Пример #1
0
    def handle(self, *args, **options):

        # make sure we're at project root
        chdir_dmd()

        dps_name = options.get('dps')
        if not dps_name:
            logger.error("Unable to match DPS with name `{}`".format(dps_name))
            return 1

        rdc = Entity.get_root()
        dps = Entity.lookup_at(parent=rdc, name=dps_name)[0]
        if dps is None:
            logger.error("Unable to match DPS with name `{}`".format(dps_name))
            return 1

        logger.info("Generating XLS dataentry tool for `{}`".format(dps_name))

        generate_dataentry_for(dps, 'dataentry.xlsx')
Пример #2
0
    def handle(self, *args, **options):

        # make sure we're at project root
        chdir_dmd()

        dps_name = options.get('dps')
        if not dps_name:
            logger.error("Unable to match DPS with name `{}`"
                         .format(dps_name))
            return 1

        rdc = Entity.get_root()
        dps = Entity.lookup_at(parent=rdc, name=dps_name)[0]
        if dps is None:
            logger.error("Unable to match DPS with name `{}`"
                         .format(dps_name))
            return 1

        logger.info("Generating XLS dataentry tool for `{}`"
                    .format(dps_name))

        generate_dataentry_for(dps, 'dataentry.xlsx')
Пример #3
0
def upload_guide_download(request, uuid, *args, **kwargs):

    dps = Entity.get_or_none(uuid)
    if dps is None:
        return Http404(_("No Entity to match `{uuid}`").format(uuid=uuid))

    file_name = dataentry_fname_for(dps)
    file_content = generate_dataentry_for(dps).getvalue()

    response = HttpResponse(file_content,
                            content_type='application/'
                                         'vnd.openxmlformats-officedocument'
                                         '.spreadsheetml.sheet')
    response['Content-Disposition'] = 'attachment; filename="%s"' % file_name
    response['Content-Length'] = len(file_content)

    return response
Пример #4
0
def upload_guide_download(request, uuid, *args, **kwargs):

    dps = Entity.get_or_none(uuid)
    if dps is None:
        return Http404(_("No Entity to match `{uuid}`").format(uuid=uuid))

    file_name = dataentry_fname_for(dps)
    file_content = generate_dataentry_for(dps).getvalue()

    response = HttpResponse(file_content,
                            content_type='application/'
                            'vnd.openxmlformats-officedocument'
                            '.spreadsheetml.sheet')
    response['Content-Disposition'] = 'attachment; filename="%s"' % file_name
    response['Content-Length'] = len(file_content)

    return response