Example #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='DeferredAction',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('token', models.CharField(max_length=40)),
                ('valid_until', models.DateTimeField(null=True)),
                ('confirmed', models.BooleanField(default=False)),
                ('form_class', models.CharField(max_length=255)),
                ('form_input',
                 generic_confirmation.fields.PickledObjectField(
                     editable=False)),
                ('form_prefix',
                 models.CharField(max_length=255, null=True, blank=True)),
                ('object_pk', models.TextField(null=True)),
                ('content_type',
                 models.ForeignKey(
                     to='contenttypes.ContentType',
                     null=True,
                     on_delete=django.db.models.deletion.CASCADE)),
            ],
            options={},
            bases=(models.Model, ),
        ),
    ]
Example #2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('admin', '0003_logentry_add_action_flag_choices'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='CustomLogEntry',
            fields=[
                ('logentry_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='admin.LogEntry')),
                ('changed_data', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
                ('request_meta', models.TextField(blank=True, null=True)),
                ('ipaddress', models.GenericIPAddressField(blank=True, null=True)),
            ],
            bases=('admin.logentry',),
            managers=[
                ('objects', django.contrib.admin.models.LogEntryManager()),
            ],
        ),
        migrations.CreateModel(
            name='TimeStampedModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Modified At')),
            ],
        ),
        migrations.CreateModel(
            name='TestApp',
            fields=[
                ('timestampedmodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='token_app.TimeStampedModel')),
                ('name', models.CharField(blank=True, max_length=100, null=True)),
                ('email', models.EmailField(blank=True, max_length=254, null=True)),
                ('phone_number', models.IntegerField(blank=True, null=True)),
                ('address', models.TextField(blank=True, null=True)),
            ],
            bases=('token_app.timestampedmodel',),
        ),
        migrations.CreateModel(
            name='UserToken',
            fields=[
                ('timestampedmodel_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='token_app.TimeStampedModel')),
                ('access_token', models.CharField(blank=True, max_length=200, null=True)),
                ('expiry_date', models.DateTimeField(default=token_app.models.token_expiry_date)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            bases=('token_app.timestampedmodel',),
        ),
    ]
Example #3
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='LogEntry',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('action_time', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='action time')),
                ('object_id', models.TextField(blank=True, null=True, verbose_name='object id')),
                ('object_repr', models.CharField(max_length=200, verbose_name='object repr')),
                ('action_flag', models.PositiveSmallIntegerField(choices=[(1, 'Addition'), (2, 'Change'), (3, 'Deletion')], verbose_name='action flag')),
                ('change_message', models.TextField(blank=True, verbose_name='change message')),
                ('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='contenttypes.contenttype', verbose_name='content type')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='user')),
            ],
            options={
                'verbose_name': 'log entry',
                'verbose_name_plural': 'log entries',
                'db_table': 'django_admin_log',
                'ordering': ['-action_time'],
            },
            managers=[
                ('objects', django.contrib.admin.models.LogEntryManager()),
            ],
        ),
    ]
Example #4
0
class Company(models.Model):
    name = models.CharField(max_length=100)
    total_employees = models.IntegerField(default=0)
    location = models.ForeignKey(Location)

    def __str__(self):  # __unicode__ on Python 2
        return self.name
Example #5
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('contenttypes', '__first__'),
    ]

    operations = [
        migrations.CreateModel(
            name='LogEntry',
            fields=[
                ('id',
                 models.AutoField(verbose_name='ID',
                                  serialize=False,
                                  auto_created=True,
                                  primary_key=True)),
                ('action_time',
                 models.DateTimeField(auto_now=True,
                                      verbose_name='action time')),
                ('object_id',
                 models.TextField(null=True,
                                  verbose_name='object id',
                                  blank=True)),
                ('object_repr',
                 models.CharField(max_length=200, verbose_name='object repr')),
                ('action_flag',
                 models.PositiveSmallIntegerField(verbose_name='action flag')),
                ('change_message',
                 models.TextField(verbose_name='change message', blank=True)),
                ('content_type',
                 models.ForeignKey(
                     to_field='id',
                     on_delete=models.SET_NULL,
                     blank=True,
                     null=True,
                     to='contenttypes.ContentType',
                     verbose_name='content type',
                 )),
                ('users',
                 models.ForeignKey(
                     to=settings.AUTH_USER_MODEL,
                     on_delete=models.CASCADE,
                     verbose_name='users',
                 )),
            ],
            options={
                'ordering': ('-action_time', ),
                'db_table': 'django_admin_log',
                'verbose_name': 'log entry',
                'verbose_name_plural': 'log entries',
            },
            bases=(models.Model, ),
            managers=[
                ('objects', django.contrib.admin.models.LogEntryManager()),
            ],
        ),
    ]
class Stock(models.Model):
    ticker = models.CharField(max_length=10)
    open = models.FloatField()
    close = models.FloatField()
    volume = models.IntegerField()

    def __str__(self):

        return self.ticker
Example #7
0
class Employee(models.Model):
    name = models.CharField(max_length=100)
    role = models.CharField(max_length=50)
    age = models.IntegerField()
    company = models.ForeignKey(Company)
    __original_company = None

    def __str__(self):  # __unicode__ on Python 2
        return self.name

    def __init__(self, *args, **kwargs):
        super(Employee, self).__init__(*args, **kwargs)
        try:
            self.__original_company = self.company
        except:
            pass

    def save(self, force_insert=False, force_update=False, *args, **kwargs):
        if self.__original_company is None:
            super(Employee, self).save(force_insert, force_update * args,
                                       **kwargs)
            self.company.total_employees += 1
            self.company.save()
        else:
            if self.company != self.__original_company:
                self.__original_company.total_employees -= 1
                self.__original_company.save()
                super(Employee, self).save(force_insert, force_update * args,
                                           **kwargs)
                self.company.total_employees += 1
                self.company.save()
        self.__original_company = self.company

    # Wont work if used from admin panel
    def delete(self, *args, **kwargs):
        self.company.total_employees -= 1
        self.company.save()
        super(Employee, self).delete(*args, **kwargs)
Example #8
0
class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("contenttypes", "__first__"),
    ]

    operations = [
        migrations.CreateModel(
            name="LogEntry",
            fields=[
                (
                    "id",
                    models.AutoField(
                        verbose_name="ID",
                        serialize=False,
                        auto_created=True,
                        primary_key=True,
                    ),
                ),
                (
                    "action_time",
                    models.DateTimeField(auto_now=True,
                                         verbose_name="action time"),
                ),
                (
                    "object_id",
                    models.TextField(null=True,
                                     verbose_name="object id",
                                     blank=True),
                ),
                (
                    "object_repr",
                    models.CharField(max_length=200,
                                     verbose_name="object repr"),
                ),
                (
                    "action_flag",
                    models.PositiveSmallIntegerField(
                        verbose_name="action flag"),
                ),
                (
                    "change_message",
                    models.TextField(verbose_name="change message",
                                     blank=True),
                ),
                (
                    "content_type",
                    models.ForeignKey(
                        to_field="id",
                        on_delete=models.SET_NULL,
                        blank=True,
                        null=True,
                        to="contenttypes.ContentType",
                        verbose_name="content type",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        to=settings.AUTH_USER_MODEL,
                        on_delete=models.CASCADE,
                        verbose_name="user",
                    ),
                ),
            ],
            options={
                "ordering": ("-action_time", ),
                "db_table": "django_admin_log",
                "verbose_name": "log entry",
                "verbose_name_plural": "log entries",
            },
            bases=(models.Model, ),
            managers=[("objects",
                       django.contrib.admin.models.LogEntryManager())],
        )
    ]
Example #9
0
class Migration(migrations.Migration):

    replaces = [('admin', '0001_initial'),
                ('admin', '0002_logentry_remove_auto_add'),
                ('admin', '0003_auto_20171018_1022'),
                ('admin', '0004_auto_20171018_1023'),
                ('admin', '0005_auto_20171021_0910'),
                ('admin', '0006_auto_20171021_0957'),
                ('admin', '0007_auto_20171021_0959')]

    initial = True

    dependencies = [
        ('contenttypes', '__first__'),
        ('aklub', '0045_auto_20171020_1506'),
        ('auth', '__first__'),
        ('aklub', '0046_auto_20171020_1510'),
    ]

    operations = [
        migrations.CreateModel(
            name='LogEntry',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('action_time',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      editable=False,
                                      verbose_name='action time')),
                ('object_id',
                 models.TextField(blank=True,
                                  null=True,
                                  verbose_name='object id')),
                ('object_repr',
                 models.CharField(max_length=200, verbose_name='object repr')),
                ('action_flag',
                 models.PositiveSmallIntegerField(verbose_name='action flag')),
                ('change_message',
                 models.TextField(blank=True, verbose_name='change message')),
                ('content_type',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='contenttypes.ContentType',
                     verbose_name='content type')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL,
                                   verbose_name='user')),
            ],
            options={
                'verbose_name_plural': 'log entries',
                'db_table': 'django_admin_log',
                'ordering': ('-action_time', ),
                'verbose_name': 'log entry',
            },
            managers=[
                ('objects', django.contrib.admin.models.LogEntryManager()),
            ],
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Call',
            fields=[
                ('created', models.DateTimeField(blank=True, default=edc_base.utils.get_utcnow)),
                ('modified', models.DateTimeField(blank=True, default=edc_base.utils.get_utcnow)),
                ('user_created', edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user created')),
                ('user_modified', edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user modified')),
                ('hostname_created', models.CharField(blank=True, default=_socket.gethostname, help_text='System field. (modified on create only)', max_length=60)),
                ('hostname_modified', edc_base.model_fields.hostname_modification_field.HostnameModificationField(blank=True, help_text='System field. (modified on every save)', max_length=50)),
                ('revision', django_revision.revision_field.RevisionField(blank=True, editable=False, help_text='System field. Git repository tag:branch:commit.', max_length=75, null=True, verbose_name='Revision')),
                ('device_created', models.CharField(blank=True, max_length=10)),
                ('device_modified', models.CharField(blank=True, max_length=10)),
                ('id', edc_base.model_fields.uuid_auto_field.UUIDAutoField(blank=True, editable=False, help_text='System auto field. UUID primary key.', primary_key=True, serialize=False)),
                ('subject_identifier', models.CharField(max_length=25)),
                ('label', models.CharField(max_length=25)),
                ('scheduled', models.DateField(default=datetime.date.today)),
                ('repeats', models.BooleanField(default=False)),
                ('call_datetime', models.DateTimeField(editable=False, help_text='last call datetime updated by call log entry', null=True)),
                ('first_name', django_crypto_fields.fields.firstname_field.FirstnameField(blank=True, editable=False, help_text=' (Encryption: RSA local)', max_length=71, null=True, verbose_name='First name')),
                ('initials', models.CharField(editable=False, max_length=3, null=True, verbose_name='Initials')),
                ('consent_datetime', models.DateTimeField(help_text='From Subject Consent.', null=True, validators=[edc_protocol.validators.datetime_not_before_study_start, edc_base.model_validators.date.datetime_not_future], verbose_name='Consent date and time')),
                ('call_attempts', models.IntegerField(default=0)),
                ('call_outcome', models.TextField(max_length=150, null=True)),
                ('call_status', models.CharField(choices=[('NEW', 'New'), ('open', 'Open'), ('closed', 'Closed')], default='NEW', max_length=15)),
                ('auto_closed', models.BooleanField(default=False, editable=False, help_text='If True call status was changed to CLOSED by EDC.')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='HistoricalCall',
            fields=[
                ('created', models.DateTimeField(blank=True, default=edc_base.utils.get_utcnow)),
                ('modified', models.DateTimeField(blank=True, default=edc_base.utils.get_utcnow)),
                ('user_created', edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user created')),
                ('user_modified', edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user modified')),
                ('hostname_created', models.CharField(blank=True, default=_socket.gethostname, help_text='System field. (modified on create only)', max_length=60)),
                ('hostname_modified', edc_base.model_fields.hostname_modification_field.HostnameModificationField(blank=True, help_text='System field. (modified on every save)', max_length=50)),
                ('revision', django_revision.revision_field.RevisionField(blank=True, editable=False, help_text='System field. Git repository tag:branch:commit.', max_length=75, null=True, verbose_name='Revision')),
                ('device_created', models.CharField(blank=True, max_length=10)),
                ('device_modified', models.CharField(blank=True, max_length=10)),
                ('id', edc_base.model_fields.uuid_auto_field.UUIDAutoField(blank=True, db_index=True, editable=False, help_text='System auto field. UUID primary key.')),
                ('subject_identifier', models.CharField(max_length=25)),
                ('label', models.CharField(max_length=25)),
                ('scheduled', models.DateField(default=datetime.date.today)),
                ('repeats', models.BooleanField(default=False)),
                ('call_datetime', models.DateTimeField(editable=False, help_text='last call datetime updated by call log entry', null=True)),
                ('first_name', django_crypto_fields.fields.firstname_field.FirstnameField(blank=True, editable=False, help_text=' (Encryption: RSA local)', max_length=71, null=True, verbose_name='First name')),
                ('initials', models.CharField(editable=False, max_length=3, null=True, verbose_name='Initials')),
                ('consent_datetime', models.DateTimeField(help_text='From Subject Consent.', null=True, validators=[edc_protocol.validators.datetime_not_before_study_start, edc_base.model_validators.date.datetime_not_future], verbose_name='Consent date and time')),
                ('call_attempts', models.IntegerField(default=0)),
                ('call_outcome', models.TextField(max_length=150, null=True)),
                ('call_status', models.CharField(choices=[('NEW', 'New'), ('open', 'Open'), ('closed', 'Closed')], default='NEW', max_length=15)),
                ('auto_closed', models.BooleanField(default=False, editable=False, help_text='If True call status was changed to CLOSED by EDC.')),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_id', edc_base.model_fields.uuid_auto_field.UUIDAutoField(primary_key=True, serialize=False)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical call',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
        ),
        migrations.CreateModel(
            name='HistoricalLog',
            fields=[
                ('created', models.DateTimeField(blank=True, default=edc_base.utils.get_utcnow)),
                ('modified', models.DateTimeField(blank=True, default=edc_base.utils.get_utcnow)),
                ('user_created', edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user created')),
                ('user_modified', edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user modified')),
                ('hostname_created', models.CharField(blank=True, default=_socket.gethostname, help_text='System field. (modified on create only)', max_length=60)),
                ('hostname_modified', edc_base.model_fields.hostname_modification_field.HostnameModificationField(blank=True, help_text='System field. (modified on every save)', max_length=50)),
                ('revision', django_revision.revision_field.RevisionField(blank=True, editable=False, help_text='System field. Git repository tag:branch:commit.', max_length=75, null=True, verbose_name='Revision')),
                ('device_created', models.CharField(blank=True, max_length=10)),
                ('device_modified', models.CharField(blank=True, max_length=10)),
                ('id', edc_base.model_fields.uuid_auto_field.UUIDAutoField(blank=True, db_index=True, editable=False, help_text='System auto field. UUID primary key.')),
                ('log_datetime', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('locator_information', django_crypto_fields.fields.encrypted_text_field.EncryptedTextField(blank=True, help_text='This information has been imported from the previous locator. You may update as required. (Encryption: AES local)', max_length=71, null=True)),
                ('contact_notes', django_crypto_fields.fields.encrypted_text_field.EncryptedTextField(blank=True, help_text=' (Encryption: AES local)', max_length=71, null=True)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_id', edc_base.model_fields.uuid_auto_field.UUIDAutoField(primary_key=True, serialize=False)),
                ('call', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='edc_call_manager.Call')),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical log',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
        ),
        migrations.CreateModel(
            name='HistoricalLogEntry',
            fields=[
                ('created', models.DateTimeField(blank=True, default=edc_base.utils.get_utcnow)),
                ('modified', models.DateTimeField(blank=True, default=edc_base.utils.get_utcnow)),
                ('user_created', edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user created')),
                ('user_modified', edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user modified')),
                ('hostname_created', models.CharField(blank=True, default=_socket.gethostname, help_text='System field. (modified on create only)', max_length=60)),
                ('hostname_modified', edc_base.model_fields.hostname_modification_field.HostnameModificationField(blank=True, help_text='System field. (modified on every save)', max_length=50)),
                ('revision', django_revision.revision_field.RevisionField(blank=True, editable=False, help_text='System field. Git repository tag:branch:commit.', max_length=75, null=True, verbose_name='Revision')),
                ('device_created', models.CharField(blank=True, max_length=10)),
                ('device_modified', models.CharField(blank=True, max_length=10)),
                ('id', edc_base.model_fields.uuid_auto_field.UUIDAutoField(blank=True, db_index=True, editable=False, help_text='System auto field. UUID primary key.')),
                ('call_reason', models.CharField(choices=[('schedule_appt', 'Schedule an appointment'), ('reminder', 'Remind participant of scheduled appointment'), ('missed_appt', 'Follow-up with participant on missed appointment')], max_length=25, verbose_name='Reason for this call')),
                ('call_datetime', models.DateTimeField(verbose_name='Date of this call')),
                ('contact_type', models.CharField(choices=[('direct', 'Direct contact with participant'), ('indirect', 'Contact with person other than participant'), ('no_contact', 'No contact made')], help_text='If no contact made. STOP. Save form.', max_length=15)),
                ('survival_status', models.CharField(choices=[('alive', 'Alive'), ('dead', 'Deceased'), ('unknown', 'Unknown')], default='alive', max_length=10, null=True, verbose_name='Survival status of the participant')),
                ('time_of_week', models.CharField(blank=True, choices=[('weekdays', 'Weekdays'), ('weekends', 'Weekends'), ('anytime', 'Anytime')], max_length=25, null=True, verbose_name='Time of week when participant will be available')),
                ('time_of_day', models.CharField(blank=True, choices=[('morning', 'Morning'), ('afternoon', 'Afternoon'), ('evening', 'Evening'), ('anytime', 'Anytime')], max_length=25, null=True, verbose_name='Time of day when participant will be available')),
                ('appt', models.CharField(blank=True, choices=[('Yes', 'Yes'), ('No', 'No')], max_length=7, null=True, verbose_name='Is the participant willing to schedule an appointment')),
                ('appt_reason_unwilling', models.CharField(blank=True, choices=[('not_interested', 'Not interested in participating'), ('busy', 'Busy during the suggested times'), ('away', 'Out of town during the suggested times'), ('unavailable', 'Not available during the suggested times'), ('DWTA', 'Prefer not to say why I am unwilling.'), ('OTHER', 'Other reason ...')], max_length=25, null=True, verbose_name='What is the reason the participant is unwilling to schedule an appointment')),
                ('appt_reason_unwilling_other', models.CharField(blank=True, max_length=50, null=True, verbose_name='Other reason, please specify ...')),
                ('appt_date', models.DateField(blank=True, help_text='This can only come from the participant.', null=True, validators=[edc_base.model_validators.date.date_is_future], verbose_name='Appointment Date')),
                ('appt_grading', models.CharField(blank=True, choices=[('firm', 'Firm appointment'), ('weak', 'Possible appointment'), ('guess', 'Estimated by RA')], max_length=25, null=True, verbose_name='Is this appointment...')),
                ('appt_location', models.CharField(blank=True, choices=[('home', 'At home'), ('work', 'At work'), ('telephone', 'By telephone'), ('clinic', 'At clinic'), ('OTHER', 'Other location')], max_length=50, null=True, verbose_name='Appointment location')),
                ('appt_location_other', edc_base.model_fields.custom_fields.OtherCharField(blank=True, max_length=50, null=True, verbose_name='Other location, please specify ...')),
                ('delivered', models.NullBooleanField(default=False, editable=False)),
                ('may_call', models.CharField(blank=True, choices=[('Yes', 'Yes, we may continue to contact the participant.'), ('No', 'No, participant has asked NOT to be contacted again.')], default='Yes', max_length=10, null=True, verbose_name='May we continue to contact the participant?')),
                ('history_date', models.DateTimeField()),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_id', edc_base.model_fields.uuid_auto_field.UUIDAutoField(primary_key=True, serialize=False)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical log entry',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
        ),
        migrations.CreateModel(
            name='Log',
            fields=[
                ('created', models.DateTimeField(blank=True, default=edc_base.utils.get_utcnow)),
                ('modified', models.DateTimeField(blank=True, default=edc_base.utils.get_utcnow)),
                ('user_created', edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user created')),
                ('user_modified', edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user modified')),
                ('hostname_created', models.CharField(blank=True, default=_socket.gethostname, help_text='System field. (modified on create only)', max_length=60)),
                ('hostname_modified', edc_base.model_fields.hostname_modification_field.HostnameModificationField(blank=True, help_text='System field. (modified on every save)', max_length=50)),
                ('revision', django_revision.revision_field.RevisionField(blank=True, editable=False, help_text='System field. Git repository tag:branch:commit.', max_length=75, null=True, verbose_name='Revision')),
                ('device_created', models.CharField(blank=True, max_length=10)),
                ('device_modified', models.CharField(blank=True, max_length=10)),
                ('id', edc_base.model_fields.uuid_auto_field.UUIDAutoField(blank=True, editable=False, help_text='System auto field. UUID primary key.', primary_key=True, serialize=False)),
                ('log_datetime', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('locator_information', django_crypto_fields.fields.encrypted_text_field.EncryptedTextField(blank=True, help_text='This information has been imported from the previous locator. You may update as required. (Encryption: AES local)', max_length=71, null=True)),
                ('contact_notes', django_crypto_fields.fields.encrypted_text_field.EncryptedTextField(blank=True, help_text=' (Encryption: AES local)', max_length=71, null=True)),
                ('call', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='edc_call_manager.Call')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='LogEntry',
            fields=[
                ('created', models.DateTimeField(blank=True, default=edc_base.utils.get_utcnow)),
                ('modified', models.DateTimeField(blank=True, default=edc_base.utils.get_utcnow)),
                ('user_created', edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user created')),
                ('user_modified', edc_base.model_fields.userfield.UserField(blank=True, help_text='Updated by admin.save_model', max_length=50, verbose_name='user modified')),
                ('hostname_created', models.CharField(blank=True, default=_socket.gethostname, help_text='System field. (modified on create only)', max_length=60)),
                ('hostname_modified', edc_base.model_fields.hostname_modification_field.HostnameModificationField(blank=True, help_text='System field. (modified on every save)', max_length=50)),
                ('revision', django_revision.revision_field.RevisionField(blank=True, editable=False, help_text='System field. Git repository tag:branch:commit.', max_length=75, null=True, verbose_name='Revision')),
                ('device_created', models.CharField(blank=True, max_length=10)),
                ('device_modified', models.CharField(blank=True, max_length=10)),
                ('id', edc_base.model_fields.uuid_auto_field.UUIDAutoField(blank=True, editable=False, help_text='System auto field. UUID primary key.', primary_key=True, serialize=False)),
                ('call_reason', models.CharField(choices=[('schedule_appt', 'Schedule an appointment'), ('reminder', 'Remind participant of scheduled appointment'), ('missed_appt', 'Follow-up with participant on missed appointment')], max_length=25, verbose_name='Reason for this call')),
                ('call_datetime', models.DateTimeField(verbose_name='Date of this call')),
                ('contact_type', models.CharField(choices=[('direct', 'Direct contact with participant'), ('indirect', 'Contact with person other than participant'), ('no_contact', 'No contact made')], help_text='If no contact made. STOP. Save form.', max_length=15)),
                ('survival_status', models.CharField(choices=[('alive', 'Alive'), ('dead', 'Deceased'), ('unknown', 'Unknown')], default='alive', max_length=10, null=True, verbose_name='Survival status of the participant')),
                ('time_of_week', models.CharField(blank=True, choices=[('weekdays', 'Weekdays'), ('weekends', 'Weekends'), ('anytime', 'Anytime')], max_length=25, null=True, verbose_name='Time of week when participant will be available')),
                ('time_of_day', models.CharField(blank=True, choices=[('morning', 'Morning'), ('afternoon', 'Afternoon'), ('evening', 'Evening'), ('anytime', 'Anytime')], max_length=25, null=True, verbose_name='Time of day when participant will be available')),
                ('appt', models.CharField(blank=True, choices=[('Yes', 'Yes'), ('No', 'No')], max_length=7, null=True, verbose_name='Is the participant willing to schedule an appointment')),
                ('appt_reason_unwilling', models.CharField(blank=True, choices=[('not_interested', 'Not interested in participating'), ('busy', 'Busy during the suggested times'), ('away', 'Out of town during the suggested times'), ('unavailable', 'Not available during the suggested times'), ('DWTA', 'Prefer not to say why I am unwilling.'), ('OTHER', 'Other reason ...')], max_length=25, null=True, verbose_name='What is the reason the participant is unwilling to schedule an appointment')),
                ('appt_reason_unwilling_other', models.CharField(blank=True, max_length=50, null=True, verbose_name='Other reason, please specify ...')),
                ('appt_date', models.DateField(blank=True, help_text='This can only come from the participant.', null=True, validators=[edc_base.model_validators.date.date_is_future], verbose_name='Appointment Date')),
                ('appt_grading', models.CharField(blank=True, choices=[('firm', 'Firm appointment'), ('weak', 'Possible appointment'), ('guess', 'Estimated by RA')], max_length=25, null=True, verbose_name='Is this appointment...')),
                ('appt_location', models.CharField(blank=True, choices=[('home', 'At home'), ('work', 'At work'), ('telephone', 'By telephone'), ('clinic', 'At clinic'), ('OTHER', 'Other location')], max_length=50, null=True, verbose_name='Appointment location')),
                ('appt_location_other', edc_base.model_fields.custom_fields.OtherCharField(blank=True, max_length=50, null=True, verbose_name='Other location, please specify ...')),
                ('delivered', models.NullBooleanField(default=False, editable=False)),
                ('may_call', models.CharField(blank=True, choices=[('Yes', 'Yes, we may continue to contact the participant.'), ('No', 'No, participant has asked NOT to be contacted again.')], default='Yes', max_length=10, null=True, verbose_name='May we continue to contact the participant?')),
                ('log', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='edc_call_manager.Log')),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.admin.models.LogEntryManager()),
            ],
        ),
        migrations.AddField(
            model_name='historicallogentry',
            name='log',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='edc_call_manager.Log'),
        ),
        migrations.AlterUniqueTogether(
            name='call',
            unique_together=set([('subject_identifier', 'label', 'scheduled')]),
        ),
        migrations.AlterUniqueTogether(
            name='logentry',
            unique_together=set([('call_datetime', 'log')]),
        ),
        migrations.AlterUniqueTogether(
            name='log',
            unique_together=set([('log_datetime', 'call')]),
        ),
    ]
Example #11
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('admin', '0003_logentry_add_action_flag_choices'),
    ]

    operations = [
        migrations.CreateModel(
            name='ActionLog',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('app_name',
                 models.CharField(blank=True, max_length=30, null=True)),
                ('model_name',
                 models.CharField(blank=True, max_length=30, null=True)),
                ('object_id', models.PositiveIntegerField(blank=True,
                                                          null=True)),
                ('object_instance', models.JSONField()),
                ('action_type',
                 models.PositiveSmallIntegerField(choices=[(1, 'Update'),
                                                           (2, 'Create'),
                                                           (3, 'Delete')],
                                                  default=1)),
                ('action_tag',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('comment', models.TextField(blank=True, null=True)),
            ],
            options={
                'verbose_name': 'Action Log',
                'verbose_name_plural': 'Action Log',
                'ordering': ('-created_at', ),
            },
        ),
        migrations.CreateModel(
            name='EmailLog',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('from_email', models.EmailField(blank=True, max_length=75)),
                ('recipients', models.TextField(blank=True, null=True)),
                ('subject',
                 models.CharField(blank=True, max_length=255, null=True)),
                ('body', models.TextField(blank=True, null=True)),
                ('sent', models.BooleanField(default=False)),
            ],
            options={
                'verbose_name': 'email Log',
                'verbose_name_plural': 'email Log',
                'ordering': ('-created_at', ),
            },
        ),
        migrations.CreateModel(
            name='AdminLog',
            fields=[],
            options={
                'verbose_name': 'Admin Log',
                'verbose_name_plural': 'Admin Log',
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('admin.logentry', ),
            managers=[
                ('objects', django.contrib.admin.models.LogEntryManager()),
            ],
        ),
        migrations.CreateModel(
            name='VisitLog',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('uuid',
                 models.UUIDField(default=uuid.uuid4,
                                  editable=False,
                                  unique=True)),
                ('session_key', models.CharField(max_length=40)),
                ('timestamp',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('path',
                 models.CharField(blank=True, max_length=2048, null=True)),
                ('remote_addr',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('ua_string', models.TextField(blank=True, null=True)),
                ('hash', models.CharField(max_length=32, unique=True)),
                ('user',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='visit_log',
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='User')),
            ],
            options={
                'verbose_name': 'Visit Log',
                'verbose_name_plural': 'Visit Log',
                'ordering': ('-created_at', ),
            },
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('admin', '0003_logentry_add_action_flag_choices'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('wamytmapp', '0009_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='KLogEntry',
            fields=[
                ('logentry_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to='admin.LogEntry')),
            ],
            bases=('admin.logentry', ),
            managers=[
                ('objects', django.contrib.admin.models.LogEntryManager()),
            ],
        ),
        migrations.AlterModelOptions(
            name='orgunitdelegate',
            options={
                'permissions': [('assign_delegates', 'Can assign delegates')],
                'verbose_name': 'Delegate for an organizational unit',
                'verbose_name_plural': 'Delegate for organizational units'
            },
        ),
        migrations.CreateModel(
            name='HistoricalTimeRange',
            fields=[
                ('id',
                 models.IntegerField(auto_created=True,
                                     blank=True,
                                     db_index=True,
                                     verbose_name='ID')),
                ('start', models.DateField(verbose_name='Start')),
                ('end', models.DateField(blank=True, verbose_name='End')),
                ('kind',
                 models.CharField(choices=[('a', 'absent'), ('p', 'present'),
                                           ('m', 'mobile')],
                                  default='a',
                                  max_length=1,
                                  verbose_name='Kind of time range')),
                ('data',
                 django.contrib.postgres.fields.jsonb.JSONField(
                     encoder=django.core.serializers.json.DjangoJSONEncoder)),
                ('history_id',
                 models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField()),
                ('history_change_reason',
                 models.CharField(max_length=100, null=True)),
                ('history_type',
                 models.CharField(choices=[('+', 'Created'), ('~', 'Changed'),
                                           ('-', 'Deleted')],
                                  max_length=1)),
                ('history_user',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL)),
                ('orgunit',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to='wamytmapp.OrgUnit',
                     verbose_name='Organizational unit')),
                ('user',
                 models.ForeignKey(
                     blank=True,
                     db_constraint=False,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     related_name='+',
                     to=settings.AUTH_USER_MODEL,
                     verbose_name='User')),
            ],
            options={
                'verbose_name': 'historical time range',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': 'history_date',
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
Example #13
0
class Location(models.Model):
    name = models.CharField(max_length=100)

    def __str__(self):  # __unicode__ on Python 2
        return self.name
Example #14
0
class JobOpening(models.Model):
    role_name = models.CharField(max_length=50)
    associated_company = models.ForeignKey(Company)
Example #15
0
class Room(models.Model):
    name = models.CharField('Name', max_length=20)
    created_at = models.DateTimeField('Created at', auto_now_add=True)
    updated_at = models.DateTimeField('Updated at', auto_now=True)