简体   繁体   English

如何在Django中连接两个注册用户

[英]How to connect two registered users in Django

I have a Django 2.1.5 app in which I have created two different forms, onto which registered users can post their requirements, for example : "I need a vehicle to go from point A to B" , or "I need to go from D to E tomorrow" . 我有一个Django 2.1.5应用,其中我创建了两种不同的表单,注册用户可以在其上发布他们的要求,例如: “我需要从A点到B点的车辆”“我需要 从A点到B点的车辆 ”从明天D到E” And, other users can post their services as in "I have a truck free that can go from A to B" etc. So, I have 2 boards, one is for people who need vehicles, and other where people are posting they have free vehicles. 而且,其他用户可以像在“我有一辆可以从A到B的免费卡车”中那样发布服务。因此,我有2个论坛,一个是供需要车辆的人使用的,另一个则是在人们发布免费服务的地方车辆。 Now, I have two different pages for both boards, and two different forms for each board. 现在,两个板都有两个不同的页面,每个板有两个不同的表单。 Now, if I find a requirement which I can fulfil, then there is a button which says 'Bid your price'. 现在,如果我找到可以满足的要求,那么会有一个按钮显示“出价”。 After which, I provide my details and a bidding price for the person asking. 之后,我会向要问的人提供我的详细信息和出价。 Then, this information is to be sent to the original author of that requirement. 然后,将此信息发送给该要求的原始作者。 I need to figure out how to connect these two registered people. 我需要弄清楚如何联系这两个注册人员。 Should I just give every requirement and service offer a unique URL? 我是否应该只提供每个需求,并且服务提供唯一的URL? and same for every user ? 每个用户都一样吗? Or is there any other method ? 还是有其他方法吗? I am really stumped here on what is the best way to do this. 我真的很困惑如何做到这一点的最佳方法。

It looks to me that you should have a model Requirement with fields, but more specifically type = [PASSENGER, DRIVER] . 在我看来,您应该有一个带有字段的Requirement模型,但更具体地说是type = [PASSENGER, DRIVER] You show those Requirement s on different listings for different types of users and once they find what they're looking for they click on a button Bid your price which links them to a view /bids/new where they fill the form or whatever and as the end product there's an instance of Bid (fields you need + fk Requirement bid was created for). 您可以针对不同类型的用户在不同的列表上显示这些Requirement ,一旦他们找到了他们想要的东西,请单击按钮Bid your price ,将他们链接到一个视图/bids/new ,他们在其中填写表格或其他内容最终产品中有一个Bid实例(您需要的字段+ fk Requirement投标已创建)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM