假设我有以下模型:
class House(models.Model):
name = models.CharField(max_length=50)
# Other attributes
class Booking(models.Model):
house = models.ForeignKey(House, on_delete=models.CASCADE)
arrival_date = models.DateField()
departure_date = models.DateField()
序列化程序:
class HouseSerializ
我希望通过比较来自不同模型类的两个I来获得特定的数据。
我想从“预订”DeskId类中得到“-Model”。我不知道如何从DeskController到达订票班。
DeskController:
[HttpGet("available/{start}&{end}")]
public async Task<IEnumerable<Desk>> GetAvailableDesks(DateTime start, DateTime end)
{
var availableDesks = new List<Desk>();
f
好吧,又一个烦人的问题。
我有一个GuestsController,它的索引操作如下:
def index
@booking = Booking.find(session[:booking_id]) #i have also hard coded values to make sure the session isn't the issue
@guest = Guest.find(session[:guest_id])
end
以及个人行为(执行更新)如下:
def personal
@guest = Guest.find(session[:guest_id])
if
我想从表活动中删除行(在一条语句中), eventid是PK,订票是FK, studentid是FK,eventid是FK。我试过这个:
delete bo from bookings as bo inner join activities as ac on ac.eventid=bo.eventid where bo.eventid=3
但它只在预订中删除行。
我要换什么?