It's the same... Thing
You should read the django official docs....

Class myview()
   def post()
          model.objects.create
          model2.objects.create

On Fri, 11 Oct, 2019, 5:00 AM Shazia Nusrat, <shazianu...@gmail.com> wrote:

> I am not trying to use Function based Views. I need to use Generic views.
> Thanks.
> Shazia
>
> On Thursday, October 10, 2019 at 4:13:56 PM UTC-7, Suraj Thapa FC wrote:
>>
>> What do you want to do... With it...
>> Use Create it for creating object..
>>
>>
>> def view() :
>> model.objects.create()
>> model2.objects.create()
>>
>> On Fri, 11 Oct, 2019, 4:33 AM Shazia Nusrat, <shazi...@gmail.com> wrote:
>>
>>> Again I need to use multiple models in one CreateView. I couldn't make
>>> it work by just importing and using it.
>>> @Suraj can you share an example.
>>>
>>> Regards,
>>>
>>> Shazia
>>>
>>> On Thu, Oct 10, 2019 at 3:27 PM Suraj Thapa FC <surajt...@gmail.com>
>>> wrote:
>>>
>>>> Just import and use it..
>>>>
>>>> On Thu, 10 Oct, 2019, 10:51 PM Shazia Nusrat, <shazi...@gmail.com>
>>>> wrote:
>>>>
>>>>> ForeignKey.
>>>>>
>>>>> On Thu, Oct 10, 2019 at 9:18 AM Mohammad yunus <yunu...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> What is mean FK Shaziya
>>>>>>
>>>>>> On Thu, 10 Oct 2019, 9:19 pm Shazia Nusrat, <shazi...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi I have a situation to manage multiple models with FK for a single
>>>>>>> CreateView.
>>>>>>>
>>>>>>> Can someone give me a solution for the below.
>>>>>>>
>>>>>>> class Client(models.Model):
>>>>>>>      name = models.CharField(max_length=100)
>>>>>>>      email = models.EmailField()
>>>>>>>      phone = models.CharField(max_length=100)
>>>>>>>      business = models.ForeignKey(Business,
>>>>>>> on_delete=models.CASCADE, related_name = 'user_business')
>>>>>>>     contact = models.ForeignKey(Contact,
>>>>>>> on_delete=models.CASCADE,related_name='client_contact')
>>>>>>> class Business(models.Model):
>>>>>>>       name= models.CharField(max_length=100)
>>>>>>>       #some other fields
>>>>>>> class Contact(models.Model):
>>>>>>>       #some fields
>>>>>>>
>>>>>>>
>>>>>>> class ClientCreateView(CreateView):
>>>>>>>         # I need help to get related models in create view. Please
>>>>>>> advise.
>>>>>>>
>>>>>>>
>>>>>>> Help is much appreciated.
>>>>>>>
>>>>>>> Regards,
>>>>>>> Shazia
>>>>>>>
>>>>>>> --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Django users" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to django...@googlegroups.com.
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/django-users/CAD83tOy3%3DfE2ZM18E6MNTLE%2BOdsKY4F_de1rR-TGVsSy3%3DNU6w%40mail.gmail.com
>>>>>>> <https://groups.google.com/d/msgid/django-users/CAD83tOy3%3DfE2ZM18E6MNTLE%2BOdsKY4F_de1rR-TGVsSy3%3DNU6w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Django users" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to django...@googlegroups.com.
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/django-users/CAEQiGcNtQwWgeBLZaLb%3DsToD6QRxFtm3Prv3Q2Lq9XaHONJ_XQ%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/django-users/CAEQiGcNtQwWgeBLZaLb%3DsToD6QRxFtm3Prv3Q2Lq9XaHONJ_XQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Django users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to django...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/django-users/CAD83tOxDdv7VBGhCJr%2BJ1fs66upZQxmVL6GPPV%2B%2B88v8z5HUGQ%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/django-users/CAD83tOxDdv7VBGhCJr%2BJ1fs66upZQxmVL6GPPV%2B%2B88v8z5HUGQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/CAPjsHcHf%3Dc4R_ADVn9k%3DJaiLmL-ux2RqOwDMkRfb_9W%3DAqmtew%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAPjsHcHf%3Dc4R_ADVn9k%3DJaiLmL-ux2RqOwDMkRfb_9W%3DAqmtew%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAD83tOw64VkK2oFgevxSUuJxVKCN%3D7y4Ke4taGmkS5j63GkqCg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAD83tOw64VkK2oFgevxSUuJxVKCN%3D7y4Ke4taGmkS5j63GkqCg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/dec8db1b-8976-46c7-9086-45aae973d2f2%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/dec8db1b-8976-46c7-9086-45aae973d2f2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPjsHcHD1UASK3yDdWR9OtdTTbz_FXUTk0QNkaVm4hWa6BeUXA%40mail.gmail.com.

Reply via email to