コード例 #1
0
class Score(Base):
    __tablebname__ = "score"

    name = models.Column(models.String(32), unique=True)
    course_id = models.Column(models.Integer, models.ForeignKey("course.id"))
    students_id = models.Column(models.Integer,
                                models.ForeignKey("students.id"))
コード例 #2
0
class Grade(BaseModel):  #成绩表,课程、学员关联此表
    __tablename = "grade"
    grade = models.Column(models.Float)
    course_id = models.Column(models.Integer, models.ForeignKey("course.id"))
    # course_label = models.Column(models.String, models.ForeignKey("course.label"))
    student_id = models.Column(models.Integer,
                               models.ForeignKey("students.id"))
コード例 #3
0
ファイル: models.py プロジェクト: python-tian/flaskproject
class Grade(BaseModel):
    __tablename__ = 'grade'
    #id = models.Column(models.Integer, primary_key=True, autoincrement=True)
    grade = models.Column(models.Float, default=0)  #默认有的课程没有成绩
    course_id = models.Column(models.Integer, models.ForeignKey('course.id'))
    student_id = models.Column(models.Integer,
                               models.ForeignKey('students.id'))
コード例 #4
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='DRModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=40, unique=True)),
                ('date_added', models.DateTimeField(default=datetime.datetime.now)),
                ('model_type', models.PositiveIntegerField()),
                ('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='TestImage',
            fields=[
                ('name', models.CharField(max_length=100, primary_key=True, serialize=False, unique=True)),
                ('image', models.ImageField(upload_to=app.models.f)),
                ('pred_class', models.PositiveIntegerField()),
                ('preds', models.CharField(max_length=255, null=True)),
                ('uploaded_at', models.DateTimeField(default=datetime.datetime.now)),
                ('real_label', models.PositiveIntegerField()),
                ('eye_orientation', models.CharField(choices=[('L', 'LEFT'), ('R', 'RIGHT')], default=None, max_length=1, null=True)),
                ('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #5
0
class Migration(migrations.Migration):

    dependencies = [
        ('app', '0044_auto_20210105_0438'),
    ]

    operations = [
        migrations.CreateModel(
            name='OneTimeVerificationCode',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('code', models.CharField(db_index=True, max_length=16)),
                ('expired_at',
                 models.DateTimeField(db_index=True,
                                      default=app.models.two_hours_later)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('printer',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     to='app.Printer')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #6
0
class ChatModel(models.Model):
    """Chat History Model"""
    sender = models.ForeignKey(MyUser,
                               on_delete=models.CASCADE,
                               related_name="message_sender")
    receiver = models.ForeignKey(MyUser,
                                 on_delete=models.CASCADE,
                                 related_name="message_receiver")
    accepted_applied_job = models.ForeignKey(UserApplyJob,
                                             on_delete=models.CASCADE,
                                             related_name="user_applied_job")
    message = models.TextField("Employer or Job_seeker Message",
                               blank=True,
                               null=True)
    is_attachment = models.BooleanField(default=False)
    is_seen = models.BooleanField(default=False)
    created_at = models.DateTimeField("Created Date",
                                      auto_now_add=True,
                                      blank=True,
                                      null=True)

    def __str__(self):
        return "{} {}".format(self.sender.first_name, self.sender.last_name)

    class Meta:
        verbose_name_plural = "Chat"
コード例 #7
0
class Migration(migrations.Migration):

    dependencies = [
        ('app', '0002_auto_20180918_2121'),
    ]

    operations = [
        migrations.CreateModel(
            name='Products',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=50)),
                ('descriptions', models.TextField(blank=True)),
                ('image',
                 models.ImageField(blank=True,
                                   upload_to=app.models.image_folder)),
                ('price', models.DecimalField(decimal_places=2, max_digits=9)),
                ('available', models.BooleanField(default=True)),
                ('brand',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Brand')),
                ('category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Categories')),
            ],
        ),
    ]
コード例 #8
0
class UserApplyJob(models.Model):
    """Jobseeker Apply job Model"""
    user = models.ForeignKey(
        MyUser,
        on_delete=models.CASCADE,
        related_name='user_favourite',
    )
    job = models.ForeignKey(
        JobManagement,
        on_delete=models.CASCADE,
        related_name="company_job",
    )
    hire_question = RichTextField("why_should_we_hire_you",
                                  blank=True,
                                  null=True)
    resume = models.URLField("user_resume", blank=True, null=True)
    is_favourite = models.BooleanField(default=False)
    is_apply = models.BooleanField(default=False)
    is_accepted = models.BooleanField(default=False)
    is_approved = models.BooleanField(default=False)
    job_seeker_is_completed = models.BooleanField(default=False)
    employer_is_completed = models.BooleanField(default=False)

    def __str__(self):
        return self.user.email

    class Meta:
        verbose_name_plural = "User Apply Job"
コード例 #9
0
ファイル: 0001_initial.py プロジェクト: cloudhubs/py-pos-tb
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Cash',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=2, default=0, max_digits=7)),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('total_price', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('done', models.BooleanField(default=False)),
                ('last_change', models.DateTimeField(auto_now=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, validators=[app.models.validate_product_name])),
                ('price', models.DecimalField(decimal_places=2, max_digits=7)),
                ('stock_applies', models.BooleanField()),
                ('minimum_stock', models.PositiveSmallIntegerField(default=0)),
                ('stock', models.IntegerField(default=0)),
                ('code', models.CharField(blank=True, max_length=50, null=True, unique=True)),
                ('colour', models.CharField(choices=[('blue', 'Blue'), ('green', 'Green'), ('yellow', 'Yellow'), ('orange', 'Orange'), ('purple', 'Purple'), ('black', 'Black'), ('pink', 'Pink'), ('cyan', 'Cyan')], default='blue', max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Setting',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(max_length=50)),
                ('value', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Order_Item',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price', models.DecimalField(decimal_places=2, max_digits=7)),
                ('name', models.CharField(max_length=100)),
                ('timestamp', models.DateTimeField(auto_now=True)),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.Order')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.Product')),
            ],
        ),
    ]
コード例 #10
0
class Teachers(BaseModel):  #教师表
    __tablename__ = "teacher"
    username = models.Column(models.String(32))
    age = models.Column(models.Integer)
    gender = models.Column(models.String(32))
    course_id = models.Column(models.Integer, models.ForeignKey("course.id"))
    teacher_id = models.Column(models.Integer,
                               models.ForeignKey("user.identify_id"))
コード例 #11
0
ファイル: models.py プロジェクト: Ownwill/MyFlask
class Grade(BaseModel):
    """
    课程,学员
    """
    __tablename__ = 'grade'
    grade = models.Column(models.Float, default=0)
    course_id = models.Column(models.Integer, models.ForeignKey('course.id'))
    student_id = models.Column(models.Integer,
                               models.ForeignKey('students.id'))
コード例 #12
0
class Grade(BaseModel):
    """
    成绩表
    课程,学员关联此表
    """
    __tablename__ = "grade"
    grade = models.Column(models.Float, default=0)
    course_id = models.Column(models.Integer, models.ForeignKey("course.id"))
    student_id = models.Column(models.Integer, models.ForeignKey("students.id"))
コード例 #13
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Task',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=64)),
                ('description', models.CharField(max_length=512)),
                ('building', models.CharField(max_length=32)),
                ('floor', models.CharField(max_length=32)),
                ('room', models.CharField(blank=True, max_length=32,
                                          null=True)),
                ('create_date', models.DateTimeField(auto_now_add=True)),
                ('done_date', models.DateTimeField(blank=True, null=True)),
                ('status',
                 models.CharField(blank=True,
                                  choices=[('1', 'รับเรื่อง'),
                                           ('2', 'ดำเนินการ'),
                                           ('3', 'เสร็จสิ้น')],
                                  max_length=1)),
                ('division',
                 models.CharField(blank=True,
                                  choices=[('1', 'ฝ่ายเทคโนโลยีสารสนเทศ'),
                                           ('2', 'ฝ่ายอาคารและสถานที่')],
                                  max_length=2,
                                  null=True)),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=app.models.get_upload_path)),
                ('operator',
                 models.ForeignKey(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='task_set',
                     to=settings.AUTH_USER_MODEL)),
                ('requester',
                 models.ForeignKey(blank=True,
                                   on_delete=django.db.models.deletion.PROTECT,
                                   related_name='request_set',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #14
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='HotelImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(blank=True,
                                   null=True,
                                   upload_to=app.models.upload_path,
                                   verbose_name='Image')),
            ],
        ),
        migrations.AddField(
            model_name='hotel',
            name='city',
            field=models.CharField(default='tehran',
                                   max_length=255,
                                   verbose_name='City'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='hotel',
            name='country',
            field=models.CharField(default='iran',
                                   max_length=255,
                                   verbose_name='Country'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='hotelimage',
            name='rel',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='app.Hotel',
                verbose_name='Hotel'),
        ),
        migrations.AddField(
            model_name='hotelimage',
            name='user',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to=settings.AUTH_USER_MODEL,
                verbose_name='User'),
        ),
    ]
コード例 #15
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone', models.IntegerField(default=0)),
                ('city', models.CharField(blank=True, max_length=255, null=True)),
                ('avatar', models.ImageField(default='avt.png', null=True, upload_to=app.models.content_file_name)),
                ('isAdmin', models.BooleanField(default=False)),
                ('token', models.CharField(blank=True, max_length=255, null=True)),
                ('user', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Information',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('city', models.CharField(blank=True, max_length=255, null=True)),
                ('sq_ft', models.IntegerField(default=0)),
                ('price', models.FloatField(blank=True, default=None, null=True)),
                ('option', models.CharField(choices=[('buy', 'Buy'), ('rent', 'Rent')], default='buy', max_length=9)),
                ('fields', models.CharField(choices=[('resi', 'Residential'), ('land', 'Land'), ('comm', 'Commercial')], default='buy', max_length=9)),
            ],
        ),
        migrations.CreateModel(
            name='Locality',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=255, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Society',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=255, null=True)),
                ('locality', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.Locality')),
            ],
        ),
        migrations.DeleteModel(
            name='City',
        ),
        migrations.AddField(
            model_name='information',
            name='society',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.Society'),
        ),
    ]
コード例 #16
0
class PostJobSkillModel(models.Model):
    """Posted job skill Model"""
    job = models.ForeignKey(JobManagement,
                            on_delete=models.CASCADE,
                            related_name="post_job_skill")
    skills = models.ForeignKey(ToolsAndLanguageModel,
                               on_delete=models.CASCADE,
                               related_name="skills_required")

    def __str__(self):
        return self.job.jobTitle
コード例 #17
0
class PostJobPreferenceLanguageModel(models.Model):
    """Posted job preference languag Model"""
    job = models.ForeignKey(JobManagement,
                            on_delete=models.CASCADE,
                            related_name="post_job_preference_language")
    preferenceLanguage = models.ForeignKey(SpeakingLanguageModel,
                                           on_delete=models.CASCADE,
                                           related_name="preference_language")

    def __str__(self):
        return self.job.jobTitle
コード例 #18
0
class PostJobPreferenceLocationModel(models.Model):
    """Posted job of preference Location Model"""
    job = models.ForeignKey(JobManagement,
                            on_delete=models.CASCADE,
                            related_name="post_job_preference_location")
    preferenceLocation = models.ForeignKey(Location,
                                           on_delete=models.CASCADE,
                                           related_name="preference_Location")

    def __str__(self):
        return self.job.jobTitle
コード例 #19
0
class PostJobAreaModel(models.Model):
    """Model creation for post job area."""
    job = models.ForeignKey(JobManagement,
                            on_delete=models.CASCADE,
                            related_name="post_job_area")
    area = models.ForeignKey(AreaModel,
                             on_delete=models.CASCADE,
                             related_name="post_job_area_of_work")

    def __str__(self):

        return self.job.jobTitle
コード例 #20
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Album',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome', models.CharField(max_length=100)),
                ('foto', models.ImageField(upload_to=app.models.get_album_path)),
                ('ano', models.IntegerField(validators=[django.core.validators.MinValueValidator(1899), django.core.validators.MaxValueValidator(2999)])),
            ],
        ),
        migrations.CreateModel(
            name='Artista',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome', models.CharField(max_length=100)),
                ('foto', models.ImageField(upload_to=app.models.get_artista_path)),
            ],
        ),
        migrations.CreateModel(
            name='Categoria',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Musica',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome', models.CharField(max_length=100)),
                ('duracao', models.DurationField()),
                ('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.Album')),
            ],
        ),
        migrations.AddField(
            model_name='album',
            name='artista',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='app.Artista'),
        ),
        migrations.AddField(
            model_name='album',
            name='categoria',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='app.Categoria'),
        ),
    ]
コード例 #21
0
ファイル: 0001_initial.py プロジェクト: CitooZz/Todo-App
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Attachment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('filename', models.CharField(max_length=100)),
                ('file', models.FileField(upload_to=app.models.upload_path)),
                ('created_at',
                 models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.CreateModel(
            name='Todo',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('description', models.TextField()),
                ('created_at',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('owner',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='todos',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='attachment',
            name='todo',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name='attachments',
                to='app.Todo'),
        ),
    ]
コード例 #22
0
ファイル: models.py プロジェクト: python-tian/flaskproject
class Ask(BaseModel):
    __tablename__ = "ask"
    student_name = models.Column(models.String(32))  #请假学生姓名
    reason = models.Column(models.Text)  #请假原因
    asktime = models.Column(models.DateTime)  #请假时间
    subtime = models.Column(models.DateTime)  #线上申请时间
    course_name = models.Column(models.String(32))  #请假课程
    teacher_name = models.Column(models.String(32))  #相关课程老师
    status = models.Column(models.Integer,
                           default=0)  #请假状态,0代表正在审核1代表老师批准2代表老师拒绝
    student_id = models.Column(models.Integer,
                               models.ForeignKey('students.id'))  #假条与学生是多对一关系
    teacher_id = models.Column(models.Integer,
                               models.ForeignKey('teacher.id'))  #假条与老师是多对易关系
コード例 #23
0
class JobManagement(models.Model):
    """Model Creation for posting job."""
    uuid = models.UUIDField(default=uuid.uuid4, editable=False)
    user = models.ForeignKey(MyUser,
                             on_delete=models.CASCADE,
                             related_name="company",
                             blank=True,
                             null=True)
    jobTitle = models.CharField("Job Title", max_length=100)
    jobDiscription = RichTextField("Job Description")
    requiredAnalytics = models.IntegerField("Number of Employee",
                                            blank=True,
                                            null=True)
    approved_employee = models.IntegerField("Number of approvd employee",
                                            default=0)
    TYPE_OF_PROJECT = (("One Time Project", "One Time Project"),
                       ("On going Project", "On going Project"),
                       ("To be decided", "To be decided"))
    type_of_project = models.CharField("What type of project you have?",
                                       default="One Time Project",
                                       max_length=50,
                                       choices=TYPE_OF_PROJECT)
    PAYMENT = (("Pay by Hour", "Pay by Hour"), ("Pay by Fixed Price",
                                                "Pay by Fixed Price"))
    payment = models.CharField("How would you like to pay?",
                               default="Pay by Hour",
                               max_length=50,
                               choices=PAYMENT)
    DURATION_PROJECT = (
        ("0-3", "0-3"),
        ("3-6", "3-6"),
        ("6-12", "6-12"),
        ("12+", "12+"),
    )
    desiredSalary = models.ForeignKey(Salary,
                                      on_delete=models.CASCADE,
                                      related_name="salary_per_hour",
                                      blank=True,
                                      null=True)
    duration = models.CharField("Month",
                                max_length=10,
                                default="0-3",
                                choices=DURATION_PROJECT)

    is_active = models.BooleanField(default=True)
    created_at = models.DateTimeField("Created Date", auto_now_add=True)

    def __str__(self):
        return self.jobTitle
コード例 #24
0
class ReviewAndRating(models.Model):
    """Review and rating model for both jobseeker and Company"""
    receiver_user = models.ForeignKey(MyUser,
                                      related_name="user_review_rating",
                                      on_delete=models.CASCADE)
    applied_job = models.ForeignKey(UserApplyJob,
                                    related_name="user_applied_job_completion",
                                    on_delete=models.CASCADE)
    rating = models.IntegerField('Rating', default=0)
    review = RichTextField("Review", blank=True, null=True)

    def __str__(self):
        return self.receiver_user.email

    class Meta:
        verbose_name_plural = "User Review And Rating"
コード例 #25
0
class Migration(migrations.Migration):

    dependencies = [
        ('app', '0003_fichas'),
    ]

    operations = [
        migrations.AddField(
            model_name='estagio',
            name='fichas',
            field=models.ForeignKey(
                default=1,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='Estagio',
                to='app.Fichas',
                verbose_name=app.models.Fichas),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='fichas',
            name='modelo8',
            field=models.FileField(blank=True,
                                   null=True,
                                   upload_to=None,
                                   verbose_name=b'modelo de certificados'),
        ),
    ]
コード例 #26
0
class Migration(migrations.Migration):

    dependencies = [
        ('app', '0015_auto_20190311_1402'),
    ]

    operations = [
        migrations.CreateModel(
            name='ProductImages',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 django_resized.forms.ResizedImageField(
                     crop=None,
                     force_format=None,
                     keep_meta=True,
                     max_length=200,
                     quality=0,
                     size=[200, 200],
                     upload_to=app.models.product_image_path)),
                ('product_id',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='app.Products',
                                   verbose_name='Cliente')),
            ],
        ),
    ]
コード例 #27
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='PostImage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image',
                 models.ImageField(upload_to=app.models.get_image_filename,
                                   verbose_name='Image')),
                ('post',
                 models.ForeignKey(default=None,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='app.post')),
            ],
        ),
    ]
コード例 #28
0
class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Reimbursement',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('amount', models.FloatField()),
                ('description', models.CharField(max_length=256)),
                ('attachment',
                 models.ImageField(upload_to=app.models.user_directory_path)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('reimbursed_flag', models.BooleanField(default=False)),
                ('date_reimbursed', models.DateTimeField(null=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
コード例 #29
0
ファイル: 0001_initial.py プロジェクト: mikefromru/totalk
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Topic',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('topic', models.CharField(max_length=100, unique=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('slug', models.SlugField(blank=True, max_length=100, null=True, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=650)),
                ('sound', models.FileField(blank=True, null=True, upload_to=app.models.content_file_name)),
                ('topic', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='question', to='app.topic')),
            ],
        ),
    ]
コード例 #30
0
class Migration(migrations.Migration):

    dependencies = [
        ('app', '0020_auto_20200918_1039'),
    ]

    operations = [
        migrations.CreateModel(
            name='Statistiche',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('lab_avviati',
                 models.IntegerField(default=0,
                                     validators=[app.models.validate_flag])),
                ('flag_trovate',
                 models.IntegerField(default=0,
                                     validators=[app.models.validate_flag])),
                ('guide_lette',
                 models.IntegerField(default=0,
                                     validators=[app.models.validate_flag])),
                ('user_id',
                 models.ForeignKey(blank=True,
                                   default=None,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='user_id_stat',
                                   to='app.User')),
            ],
        ),
    ]