Changeset - 7fac10241ec7
[Not reviewed]
0 3 0
Joel Addison - 4 years ago 2020-01-10 12:49:17
joel@addison.net.au
Improve attendee reports

Display attendee profile data in normal table without DataTables so
sorting is not applied, causing data to be confusing to read.
Include item quantity in attendee data report for accurate schwag packing.
3 files changed with 15 insertions and 8 deletions:
0 comments (0 inline, 0 general)
pinaxcon/registrasion/models.py
Show inline comments
...
 
@@ -80,8 +80,9 @@ class AttendeeProfile(rego.AttendeeProfileBase):
 
        max_length=64,
 
        help_text="Your name, as you'd like it to appear on your badge. ",
 
    )
 
    company = models.CharField(
 
        verbose_name="Company",
 
        max_length=64,
 
        help_text="The name of your company, as you'd like it on your badge",
 
        blank=True,
 
    )
...
 
@@ -132,8 +133,9 @@ class AttendeeProfile(rego.AttendeeProfileBase):
 
        max_length=1024,
 
        blank=True,
 
    )
 
    country = CountryField(
 
        verbose_name="Country",
 
        default="AU",
 
    )
 
    state = models.CharField(
 
        max_length=256,
...
 
@@ -158,14 +160,16 @@ class AttendeeProfile(rego.AttendeeProfileBase):
 
        max_length=256,
 
        blank=True,
 
    )
 
    gender = models.CharField(
 
        verbose_name="Gender",
 
        help_text="Gender data will only be used for demographic purposes.",
 
        max_length=64,
 
        blank=True,
 
    )
 

	
 
    children = models.CharField(
 
        verbose_name="Child Ages and Information",
 
        max_length=256,
 
        help_text="Linux.conf.au is a family friendly conference and provides "
 
            "free child-care for pre-school children from 6 months up to 5 years. We "
 
            "hope to also provide a programme for older children and will let you "
pinaxcon/templates/registrasion/report.html
Show inline comments
...
 
@@ -23,25 +23,23 @@
 
{% for report in reports %}
 
<h3>{{ report.title }}</h3>
 
{% if report.headings %}
 
<table class="table table-striped table-reportdata">
 
{% else %}
 
<table class="table table-striped">
 
{% endif %}
 
  <thead>
 
    <tr>
 
      {% for heading in report.headings %}
 
      <th>{{ heading }}</th>
 
      {% endfor %}
 
    </tr>
 
  </thead>
 
{% else %}
 
<table class="table table-striped">
 
{% endif %}
 
  <tbody>
 
    {% for line in report.rows %}
 
    <tr>
 
      {% for item in line %}
 
            <td>
 
                {{ item|safe }}
 
            </td>
 
      <td>{{ item|safe }}</td>
 
      {% endfor %}
 
    </tr>
 
    {% endfor %}
 
  </tbody>
vendor/registrasion/registrasion/reporting/views.py
Show inline comments
...
 
@@ -597,17 +597,21 @@ def attendee(request, form, user_id=None):
 
                value = "Bad value for %s" % field.name
 

	
 
        profile_data.append((field.verbose_name, value))
 

	
 
    profile_data.insert(1, ("Email", attendee.user.email))
 

	
 
    cart = CartController.for_user(attendee.user)
 
    try:
 
        reservation = cart.cart.reservation_duration + cart.cart.time_last_updated
 
    except AttributeError:  # No reservation_duration set -- default to 24h
 
        reservation = datetime.datetime.now() + datetime.timedelta(hours=24)
 

	
 
    profile_data.append(("Current cart reserved until", reservation))
 

	
 
    reports.append(ListReport("Profile", ["", ""], profile_data))
 
    # No column headings, as this has row headings instead and sorting makes
 
    # everything confusing.
 
    reports.append(ListReport("Profile", None, profile_data))
 

	
 
    links = []
 
    links.append((
 
        reverse(views.badge, args=[user_id]),
...
 
@@ -886,9 +890,9 @@ def attendee_data(request, form, user_id=None):
 
                return bleach.clean(str(attr))
 
            except TypeError:
 
                return "Bad value found for %s" % attr
 

	
 
    headings = ["User ID", "Name", "Email", "Product", "Item Status"]
 
    headings = ["User ID", "Name", "Email", "Product", "Quantity", "Item Status"]
 
    headings.extend(field_names)
 
    data = []
 
    for item in items:
 
        profile = by_user[item.cart.user]
...
 
@@ -896,8 +900,9 @@ def attendee_data(request, form, user_id=None):
 
            item.cart.user.id,
 
            getattr(profile, name_field),
 
            profile.attendee.user.email,
 
            item.product,
 
            item.quantity,
 
            status_display[item.cart.status],
 
        ] + [
 
            display_field(profile, field) for field in fields
 
        ]
0 comments (0 inline, 0 general)