PageRenderTime 80ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/mysite/ealan/migrations/0001_initial.py

https://gitlab.com/alfadil/my
Python | 53 lines | 45 code | 6 blank | 2 comment | 0 complexity | 084bf56bbcbd8ef3c44a16ee880971b0 MD5 | raw file
  1. # -*- coding: utf-8 -*-
  2. # Generated by Django 1.9.5 on 2016-04-06 09:36
  3. from __future__ import unicode_literals
  4. import django.core.validators
  5. from django.db import migrations, models
  6. import django.db.models.deletion
  7. class Migration(migrations.Migration):
  8. initial = True
  9. dependencies = [
  10. ]
  11. operations = [
  12. migrations.CreateModel(
  13. name='Category',
  14. fields=[
  15. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  16. ('name', models.CharField(max_length=140)),
  17. ],
  18. ),
  19. migrations.CreateModel(
  20. name='Post',
  21. fields=[
  22. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  23. ('title', models.CharField(max_length=140)),
  24. ('details', models.TextField()),
  25. ('date', models.DateTimeField()),
  26. ('image', models.ImageField(upload_to=b'')),
  27. ('price', models.FloatField()),
  28. ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ealan.Category')),
  29. ],
  30. ),
  31. migrations.CreateModel(
  32. name='Vender',
  33. fields=[
  34. ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
  35. ('name', models.CharField(max_length=140)),
  36. ('Address', models.TextField()),
  37. ('Phone1', models.CharField(blank=True, max_length=9, validators=[django.core.validators.RegexValidator(message=b"Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed.", regex=b'^\\+?1?\\d{9,15}$')])),
  38. ('Phone2', models.CharField(blank=True, max_length=9, validators=[django.core.validators.RegexValidator(message=b"Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed.", regex=b'^\\+?1?\\d{9,15}$')])),
  39. ('email', models.CharField(max_length=140)),
  40. ],
  41. ),
  42. migrations.AddField(
  43. model_name='post',
  44. name='vender',
  45. field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ealan.Vender'),
  46. ),
  47. ]