Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.db import models
- class City(models.model):
- city_id = models.IntegerField('Айдишник города')
- city_name = models.CharField('Имя города', max_length= )
- class House(models.Model):
- id = models.IntegerField('Айди дома')#INTEGER
- address = models.CharField('Адрес', max_length=50)
- id_city = models.ForeignKey(City, 'Ключ на город') #INTEGER
- bed = models.IntegerField('Количество спален')#INTEGER
- bath = models.IntegerField('Количество ванных')#INTEGER
- square = models.DecimalField('Площадь в м^2', max_digits=8, decimal_places=3) #NUMERIC(5, 3)
- price = models.IntegerField('Цена в баксах')#INTEGER
- class PhotoCollection(models.Model):
- id_house = models.ForeignKey('Внешний ключ', House, to_field='id')
- photo = models.IntegerField('Номер фото')
Add Comment
Please, Sign In to add comment