Get the see only particular station which create by the login user in Django

I Tried to create Slot of station for EV Charging Booking Webiste. If i tried to creating slot of praticular station but I suggest all station which created by other of all. I should see the particular station has the created by login user in Slot in django Here is my Station list

Django reflate 3 station from my database My Station 2 and 3 but I can see all 3 station Help to Slove my Query

here my Slotviews.py

class SlotCreateView(LoginRequiredMixin, CreateView):
model = Slot
fields = ('slot_name', 'per_unit_price', 'current_status','station')

template_name = 'add_slot.html'

def form_valid(self, form):
    form.instance.user = self.request.user
    return super().form_valid(form)

def get_success_url(self):
    return reverse('view_slot')

here is slot models.py

class Slot(models.Model):
CURRENT_STATUS_CHOICE = (
    ("AVAILABLE", "AVAILABLE"),
    ("OCCUPIED", "OCCUPIED")
)
slot_id = models.AutoField(primary_key=True)
station = models.ForeignKey(Station, on_delete=models.CASCADE)
user = models.ForeignKey(User, on_delete=models.CASCADE)
slot_name = models.CharField(max_length=30)
per_unit_price = models.DecimalField(max_digits=7, decimal_places=2)
current_status = models.CharField(max_length=20, choices=CURRENT_STATUS_CHOICE, default="AVAILABLE")
deleted = models.IntegerField(default=0, unique=False)

def __str__(self):
    return f"{self.slot_name}"
Back to Top