• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gcivil-nyu-org / INET-Wednesday-Spring2024-Team-2 / 234

01 Apr 2024 04:01AM UTC coverage: 81.553% (-8.1%) from 89.701%
234

cron

travis-pro

web-flow
Merge pull request #76 from gcivil-nyu-org/develop

merging latest develop into master

104 of 159 new or added lines in 7 files covered. (65.41%)

8 existing lines in 3 files now uncovered.

336 of 412 relevant lines covered (81.55%)

0.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.01
/users/models.py
1
from django.contrib.auth.models import AbstractUser
1✔
2
from django.db import models
1✔
3

4

5
class CustomUser(AbstractUser):
1✔
6
    USER = "user"
1✔
7
    LANDLORD = "landlord"
1✔
8
    USER_TYPES = [
1✔
9
        (USER, "User"),
10
        (LANDLORD, "Landlord"),
11
    ]
12
    user_type = models.CharField(max_length=20, choices=USER_TYPES, default=USER)
1✔
13
    full_name = models.CharField(max_length=255)
1✔
14
    phone_number = models.CharField(max_length=15)
1✔
15
    city = models.CharField(max_length=100)
1✔
16
    verified = models.BooleanField(default=True)
1✔
17
    s3_doclink = models.CharField(max_length=255, blank=True, null=True)
1✔
18

19
    # user_type = models.CharField(max_length=20, choices=USER_TYPES, default=LANDLORD)
20
    # city = models.CharField(max_length=100)
21
    # full_name = models.CharField(max_length=100)
22
    # phone_number = models.CharField(max_length=100)
23
    # email = models.CharField(max_length=100)
24
    # verified = models.CharField(max_length=100, default="false")
25
    # s3_doclink = models.URLField(max_length=255, blank=True, null=True)
26

27
    def save(self, *args, **kwargs):
1✔
28
        if self.user_type == CustomUser.USER:
1✔
29
            self.verified = True
1✔
30
        else:
31
            self.verified = False
1✔
32
        super().save(*args, **kwargs)
1✔
33

34

35
class Rental_Listings(models.Model):
1✔
36
    address = models.CharField(max_length=255)
1✔
37
    price = models.DecimalField(max_digits=10, decimal_places=2)
1✔
38
    link = models.URLField(max_length=2048, blank=True, null=True)
1✔
39
    sq_ft = models.IntegerField(blank=True, null=True)
1✔
40
    rooms = models.DecimalField(max_digits=5, decimal_places=1, blank=True, null=True)
1✔
41
    beds = models.DecimalField(max_digits=5, decimal_places=1, blank=True, null=True)
1✔
42
    baths = models.DecimalField(max_digits=3, decimal_places=1)
1✔
43
    unit_type = models.CharField(max_length=100, blank=True, null=True)
1✔
44
    neighborhood = models.CharField(max_length=100, blank=True, null=True)
1✔
45
    central_air_conditioning = models.BooleanField(default=False)
1✔
46
    dishwasher = models.BooleanField(default=False)
1✔
47
    doorman = models.BooleanField(default=False)
1✔
48
    elevator = models.BooleanField(default=False)
1✔
49
    furnished = models.BooleanField(default=False)
1✔
50
    parking_available = models.BooleanField(default=False)
1✔
51
    washer_dryer_in_unit = models.BooleanField(default=False)
1✔
52
    A = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
53
    C = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
54
    E = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
55
    B = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
56
    D = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
57
    F = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
58
    M = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
59
    G = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
60
    L = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
61
    J = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
62
    Z = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
63
    N = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
64
    Q = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
65
    R = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
66
    one = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
67
    two = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
68
    three = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
69
    four = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
70
    five = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
71
    six = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
72
    seven = models.DecimalField(max_digits=10, decimal_places=6, blank=True, null=True)
1✔
73
    latitude = models.FloatField(blank=True, null=True)
1✔
74
    longitude = models.FloatField(blank=True, null=True)
1✔
75
    zipcode = models.CharField(max_length=20, blank=True, null=True)
1✔
76
    borough = models.CharField(max_length=100, blank=True, null=True)
1✔
77
    broker_fee = models.DecimalField(
1✔
78
        max_digits=10, decimal_places=2, blank=True, null=True
79
    )
80
    # landlord = models.ForeignKey(CustomUser, on_delete=models.CASCADE, related_name='rental_listings', null=True,
81
    #                              blank=True)
82

83
    def _str_(self):
1✔
NEW
84
        return self.address
×
85

86

87
class RentalImage(models.Model):
1✔
88
    rental_listing = models.ForeignKey(Rental_Listings, on_delete=models.CASCADE, related_name='images')
1✔
89
    image_url = models.URLField(max_length=2048)
90

91
    def __str__(self):
1✔
92
        return self.image_url
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc