cciw-website / cciw / bookings / anonymizers.py

from cciw.bookings.models import Price, BookingAccount, Booking, Payment, ChequePayment, RefundPayment
from anonymizer import Anonymizer

class BookingAccountAnonymizer(Anonymizer):

    model = BookingAccount

    attributes = [
        # Skipping field id
        ('email', "email"),
        ('name', "name"),
        ('address', "full_address"),
        ('post_code', "uk_postcode"),
        ('phone_number', "phonenumber"),
        ('share_phone_number', "bool"),
        #('total_received', "decimal"),
        #('first_login', "datetime"),
        #('last_login', "datetime"),
    ]


class BookingAnonymizer(Anonymizer):

    model = Booking

    attributes = [
         # Skipping field id
         # Skipping field account_id
         # Skipping field camp_id
        ('first_name', "first_name"),
        ('last_name', "last_name"),
        ('sex', "choice"),
        ('date_of_birth', "date"),
        ('address', "full_address"),
        ('post_code', "uk_postcode"),
        ('phone_number', "phonenumber"),
        ('email', "email"),
        ('church', "similar_lorem"),
        #('south_wales_transport', "bool"),
        ('contact_address', "address"),
        ('contact_post_code', "post_code"),
        ('contact_phone_number', "phonenumber"),
        ('dietary_requirements', "similar_lorem"),
        ('gp_name', "name"),
        ('gp_address', "full_address"),
        ('gp_phone_number', "phonenumber"),
        ('medical_card_number', lambda anon, obj, field, val: anon.faker.simple_pattern('####???##', field=field)),
        ('last_tetanus_injection', "date"),
        ('allergies', "similar_lorem"),
        ('regular_medication_required', "similar_lorem"),
        ('illnesses', "similar_lorem"),
        ('learning_difficulties', "similar_lorem"),
        ('serious_illness', "bool"),
        #('agreement', "bool"),
        #('price_type', "choice"),
        #('amount_due', "decimal"),
        #('shelved', "bool"),
        #('state', "choice"),
        #('created', "datetime"),
        #('booking_expires', "datetime"),
    ]
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.