forked from nivishnaa-sri/SHEshield
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
15 lines (13 loc) · 675 Bytes
/
models.py
File metadata and controls
15 lines (13 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from django.db import models
from django.contrib.auth.models import User
class EmergencyContact(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="contacts")
name = models.CharField(max_length=100)
phone_number = models.CharField(max_length=15) # Format: +919876543210
class UnsafeAreaReport(models.Model):
reported_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
latitude = models.FloatField()
longitude = models.FloatField()
description = models.TextField()
risk_level = models.IntegerField(default=1) # 1-5 scale
timestamp = models.DateTimeField(auto_now_add=True)