Re: Updating FK values for Stock Application

2021-06-07 Thread Shazia Nusrat
All I was asking to make FK editable. I can do it in views by making forms 
from "forms.Form" in Django and update models I needed to update.

Just thought that there might be a simpler way where I can choose an option 
from ManyToMany select box and then edit those values. 


On Monday, June 7, 2021 at 5:32:12 PM UTC+5 frds...@gmail.com wrote:

> If you want to have multiple chemicals in a single order then you'll have 
> to use ManyToManyField instead of ForeignKey field.
>
> On Mon, Jun 7, 2021 at 5:08 PM Shazia Nusrat  wrote:
>
>> Hi, 
>> I am developing a stock management application and I am stuck at simple 
>> use case.
>>
>> Following is my model for Stock:
>>
>> class LiquidChemicalML(Stock):
>> supplier_name = models.ManyToManyField(Supplier)
>> quantity_values = (
>> ('Ounces', 'Ounces'),
>> ('Millilitters', 'Millilitters'),
>> ('Pounds', 'Pounds'),
>> ('Liter', 'Liter'),
>> ('Galon', 'Galon'),
>> ('Kilogram', 'Kilogram'),
>> ('Grams', 'Grams')
>> )
>> chemical_name = models.CharField(max_length=200)
>> chemical_quantity = models.IntegerField()
>> unit_of_measurement = models.CharField(max_length=20, 
>> choices=quantity_values)
>> purchase_date = models.DateField()
>> expiry_date = models.DateField()class LiquidChemicalML(Stock):
>> supplier_name = models.ManyToManyField(Supplier)
>> quantity_values = (
>> ('Ounces', 'Ounces'),
>> ('Millilitters', 'Millilitters'),
>> ('Pounds', 'Pounds'),
>> ('Liter', 'Liter'),
>> ('Galon', 'Galon'),
>> ('Kilogram', 'Kilogram'),
>> ('Grams', 'Grams')
>> )
>> chemical_name = models.CharField(max_length=200)
>> chemical_quantity = models.IntegerField()
>> unit_of_measurement = models.CharField(max_length=20, 
>> choices=quantity_values)
>> purchase_date = models.DateField()
>>
>> I need to update my orders model with available quantity and literals. My 
>> Orders are:
>>
>> class Orders(models.Model):
>>  update_chemical = models.ForeignKey(…..
>>
>> I just need your help to give me idea that how I can update my orders 
>> with multiple fields from Stock. For instance if I create a foreignkey I 
>> will only be able to select one of the "id" in available stocks. I need to 
>> let the user select or update multiple values in a FK based key. Please 
>> advise. 
>>
>> Best 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-users...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/ed643b75-005f-484d-a004-a14449c7d372n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/ed643b75-005f-484d-a004-a14449c7d372n%40googlegroups.com?utm_medium=email_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/d58daa3e-ffaa-46f0-94af-bb81c8d2db3cn%40googlegroups.com.


Updating FK values for Stock Application

2021-06-07 Thread Shazia Nusrat
Hi, 
I am developing a stock management application and I am stuck at simple use 
case.

Following is my model for Stock:

class LiquidChemicalML(Stock):
supplier_name = models.ManyToManyField(Supplier)
quantity_values = (
('Ounces', 'Ounces'),
('Millilitters', 'Millilitters'),
('Pounds', 'Pounds'),
('Liter', 'Liter'),
('Galon', 'Galon'),
('Kilogram', 'Kilogram'),
('Grams', 'Grams')
)
chemical_name = models.CharField(max_length=200)
chemical_quantity = models.IntegerField()
unit_of_measurement = models.CharField(max_length=20, 
choices=quantity_values)
purchase_date = models.DateField()
expiry_date = models.DateField()class LiquidChemicalML(Stock):
supplier_name = models.ManyToManyField(Supplier)
quantity_values = (
('Ounces', 'Ounces'),
('Millilitters', 'Millilitters'),
('Pounds', 'Pounds'),
('Liter', 'Liter'),
('Galon', 'Galon'),
('Kilogram', 'Kilogram'),
('Grams', 'Grams')
)
chemical_name = models.CharField(max_length=200)
chemical_quantity = models.IntegerField()
unit_of_measurement = models.CharField(max_length=20, 
choices=quantity_values)
purchase_date = models.DateField()

I need to update my orders model with available quantity and literals. My 
Orders are:

class Orders(models.Model):
 update_chemical = models.ForeignKey(…..

I just need your help to give me idea that how I can update my orders with 
multiple fields from Stock. For instance if I create a foreignkey I will 
only be able to select one of the "id" in available stocks. I need to let 
the user select or update multiple values in a FK based key. Please advise. 

Best 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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ed643b75-005f-484d-a004-a14449c7d372n%40googlegroups.com.


Pipenv in Production

2021-01-12 Thread Shazia Nusrat
Hi,

I can deploy sites using virtualenv but having trouble with pipenv using 
Gunicorn + Nginx. Can someone provide me some guide or reference for 
deploying sites in production using Pipenv?

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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/101427a6-8ad6-4fab-b4b5-4d6691a7eb0dn%40googlegroups.com.


Re: How can I host my django project on my pc for someone to see it outside my WIFI network

2020-12-23 Thread Shazia Nusrat
You also need to add your url provided by Ngrok to your Django settings.py 
"ALLOWED_HOSTS". Only then it will present your site on that URL. 

On Thursday, December 24, 2020 at 4:27:00 AM UTC+5 Shazia Nusrat wrote:

> Ngrok will help you publish your site for development if you need to show 
> your work remotely. Remember you need to run two terminals on terminal 1 
> you will run your project as you normally do and on other terminal you need 
> to run ngrok. It will provide you with couple of URLs one for http and 
> another for https. Https is usually if you need to test it with social 
> authentication etc. 
>
> Hope this helps. 
>
> Cheers
> On Wednesday, December 23, 2020 at 10:46:22 PM UTC+5 joseenoc...@gmail.com 
> wrote:
>
>> Can some one pls explain what steps show I follow to host my django 
>> project on my pc and allow anyone outside my network WIFI to see the webiste
>
>

-- 
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/139389ef-c8dd-4f5e-8f5a-7d7c5c6830c4n%40googlegroups.com.


Re: How can I host my django project on my pc for someone to see it outside my WIFI network

2020-12-23 Thread Shazia Nusrat
Ngrok will help you publish your site for development if you need to show 
your work remotely. Remember you need to run two terminals on terminal 1 
you will run your project as you normally do and on other terminal you need 
to run ngrok. It will provide you with couple of URLs one for http and 
another for https. Https is usually if you need to test it with social 
authentication etc. 

Hope this helps. 

Cheers
On Wednesday, December 23, 2020 at 10:46:22 PM UTC+5 joseenoc...@gmail.com 
wrote:

> Can some one pls explain what steps show I follow to host my django 
> project on my pc and allow anyone outside my network WIFI to see the webiste

-- 
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/cba6c915-f660-43bd-b977-1a96285634e3n%40googlegroups.com.


Mobile social registration for Django Backend endpointe

2020-12-23 Thread Shazia Nusrat
Hi,
I am using Django for my web app and DRF to expose my API for mobile 
applications. I need users to sign in using social accounts at mobile side 
and need to authenticate via Django API. 

I've used couple of libraries but couldn't understand the workflow for 

1. https://github.com/RealmTeam/django-rest-framework-social-oauth2
2. https://github.com/wagnerdelima/drf-social-oauth2

If someone kindly guide me to the right direction it will be a great help. 
All I need is 3 to 4 simple step that what URLs I need to get user 
registered in orderly manner. 

Looking forward.

Cheers
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/17fcc724-ea85-4db7-b7e4-4f4837e6ee1dn%40googlegroups.com.


Re: Django - CreateView not saving form with nested formset

2020-03-03 Thread Shazia Nusrat
Hi,

Tried all suggestions above and nothing worked out.
To my surprise I heard Python/Django community is more robust and helping
before decided to pick my dev stack. But no contribution by the community.



On Sun, Feb 23, 2020 at 7:23 PM maninder singh Kumar <
maninder.s.ku...@gmail.com> wrote:

> Great thought
>
>
> [image: --]
>
> Maninder Kumar
> [image: http://]about.me/maninder.s.kumar
> <http://about.me/maninder.s.kumar?promo=email_sig>
>
>
>
>
> On Mon, Feb 24, 2020 at 7:00 AM bnmng  wrote:
>
>> One thing you can try for troubleshooting is an else clause to go with
>> your is_valid
>>
>> if education.is_valid():
>> education.save(commit=False)
>> education.instance = self.object
>> education.save()
>> else:
>> print('There was an error')
>> for err in education.errors:
>>   print(err)
>>
>>
>> On Sunday, February 23, 2020 at 2:01:37 AM UTC-5, Shazia Nusrat wrote:
>>>
>>> Hi,
>>>
>>> Can someone help to answer the question in link?
>>> Also I've been trying to get CreateView working with 5 inline formsets
>>> but couldn't make it work.
>>>
>>> Will really appreciate your help if someone can help me with working
>>> example.
>>>
>>> Question:
>>> https://stackoverflow.com/questions/60354976/django-createview-not-saving-form-with-nested-formset
>>>
>>> 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-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/86c26d31-485c-4e80-8c82-18eb4b602deb%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/86c26d31-485c-4e80-8c82-18eb4b602deb%40googlegroups.com?utm_medium=email_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/CABOHK3RgNPJkQc7Ro3%2BBMNuKzoAnCeXi20wEJUfsuAqhHe85tA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CABOHK3RgNPJkQc7Ro3%2BBMNuKzoAnCeXi20wEJUfsuAqhHe85tA%40mail.gmail.com?utm_medium=email_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/CAD83tOyVs4WQ%2B9rV6oQiiniAT4ZARGZxFvmkYhQWe-6mw0zu1A%40mail.gmail.com.


Django - CreateView not saving form with nested formset

2020-02-22 Thread Shazia Nusrat
Hi,

Can someone help to answer the question in link?
Also I've been trying to get CreateView working with 5 inline formsets but
couldn't make it work.

Will really appreciate your help if someone can help me with working
example.

Question:
https://stackoverflow.com/questions/60354976/django-createview-not-saving-form-with-nested-formset

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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOx%3D0DBWuGQT4c-zp0gK7PGm5JG2KQnKgCjOWD7q7NoscQ%40mail.gmail.com.


Re: FK forms in a Single CreateView

2019-10-10 Thread Shazia Nusrat
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,  > 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 > > wrote:
>>
>>> Just import and use it.. 
>>>
>>> On Thu, 10 Oct, 2019, 10:51 PM Shazia Nusrat, >> > wrote:
>>>
>>>> ForeignKey.
>>>>
>>>> On Thu, Oct 10, 2019 at 9:18 AM Mohammad yunus >>> > wrote:
>>>>
>>>>> What is mean FK Shaziya
>>>>>
>>>>> On Thu, 10 Oct 2019, 9:19 pm Shazia Nusrat, >>>> > 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_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_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%

Re: FK forms in a Single CreateView

2019-10-10 Thread Shazia Nusrat
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 
wrote:

> Just import and use it..
>
> On Thu, 10 Oct, 2019, 10:51 PM Shazia Nusrat, 
> wrote:
>
>> ForeignKey.
>>
>> On Thu, Oct 10, 2019 at 9:18 AM Mohammad yunus 
>> wrote:
>>
>>> What is mean FK Shaziya
>>>
>>> On Thu, 10 Oct 2019, 9:19 pm Shazia Nusrat, 
>>> 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-users+unsubscr...@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_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/CAEQiGcNtQwWgeBLZaLb%3DsToD6QRxFtm3Prv3Q2Lq9XaHONJ_XQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAEQiGcNtQwWgeBLZaLb%3DsToD6QRxFtm3Prv3Q2Lq9XaHONJ_XQ%40mail.gmail.com?utm_medium=email_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/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_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/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_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/CAD83tOw64VkK2oFgevxSUuJxVKCN%3D7y4Ke4taGmkS5j63GkqCg%40mail.gmail.com.


Re: FK forms in a Single CreateView

2019-10-10 Thread Shazia Nusrat
ForeignKey.

On Thu, Oct 10, 2019 at 9:18 AM Mohammad yunus  wrote:

> What is mean FK Shaziya
>
> On Thu, 10 Oct 2019, 9:19 pm Shazia Nusrat,  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-users+unsubscr...@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_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/CAEQiGcNtQwWgeBLZaLb%3DsToD6QRxFtm3Prv3Q2Lq9XaHONJ_XQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAEQiGcNtQwWgeBLZaLb%3DsToD6QRxFtm3Prv3Q2Lq9XaHONJ_XQ%40mail.gmail.com?utm_medium=email_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/CAD83tOxDdv7VBGhCJr%2BJ1fs66upZQxmVL6GPPV%2B%2B88v8z5HUGQ%40mail.gmail.com.


FK forms in a Single CreateView

2019-10-10 Thread Shazia Nusrat
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-users+unsubscr...@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.


Barcode 128Code generation with Django

2019-10-08 Thread Shazia Nusrat
Hi I am looking for some help to generate a barcode for my practice project
and I need commercial code128 generation help.

I need to add my customer ID and product ID in the barcode.

Any help would be 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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOzrBB5usL022V7roRQKeNyS3FLvhUW1L2opXeKtuzUJBA%40mail.gmail.com.


Re: Multiple user roles with permissions

2019-09-26 Thread Shazia Nusrat
So kind of you George. It worked for me in examples and thanks for adding
Python code example search engine.

You really made my life easier. :-)
Regards,

Shazia

On Thu, Sep 26, 2019 at 4:39 AM George Tantiras  wrote:

> Repositories using django-rules:
>
>
> https://github.com/dfunckt/django-rules/network/dependents?dependent_type=REPOSITORY
>
> Packages using django-rules:
>
>
> https://github.com/dfunckt/django-rules/network/dependents?dependent_type=PACKAGE
>
> Search engine for python code examples:
>
> https://www.programcreek.com/python/
>
>
>
> --
> 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/65001569497923%40myt3-daa25987f51b.qloud-c.yandex.net
> 
> .
>

-- 
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/CAD83tOzGxJV0A3gwjtePXBvPCOyvKd9UGZq0zwsvR%2B8jRWtM9w%40mail.gmail.com.


Re: Multiple user roles with permissions

2019-09-25 Thread Shazia Nusrat
I just needed a working example of added permissions system in a project I
can run.
Django-rules is good and I've tried it in my test-project. I was hoping a
project with bunch of user types and assigned permissions hardcoded.
I know I can do things from default admin dashboard.

Regards,

Shazia

On Wed, Sep 25, 2019 at 10:08 AM George Tantiras 
wrote:

> I would recommend django-rules:
>
> https://github.com/dfunckt/django-rules
>
>
>
> --
> 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/b99b5a2799661d0e418177af6c3c9200a9ec0fc6.camel%40yandex.com
> .
>

-- 
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/CAD83tOwB9XELzrjA5tQOYRUy1-wBgZ5RaHLP%2Btmb6SecWCEB2w%40mail.gmail.com.


Multiple user roles with permissions

2019-09-25 Thread Shazia Nusrat
Hi,

I need help to understand implementation of multiple user roles and
permissions on views/templates/objects. If someone can point me to really
nice project at GitHub I will be really thankful. I couldn't find one so
far.

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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOx6a4hftc9MAGeweDJ%3DfCuTBXSzc9VT8H6tGOZz%3DbuVQw%40mail.gmail.com.


Multiple roles Django 2

2019-07-06 Thread Shazia Nusrat
Hi All,
I am having hard time to get multiple roles for users in a project and I am
having errors.
I've added related_name but still getting error. Can please tell me how to
fix this?

***
from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.

class Role(models.Model):
 STUDENT = 1
 TEACHER = 2
 SECRETARY = 3
 SUPERVISOR = 4
 ADMIN = 5
 ROLE_CHOICES = (
  (STUDENT, 'student'),
  (TEACHER, 'teacher'),
  (SECRETARY, 'secretary'),
  (SUPERVISOR, 'supervisor'),
  (ADMIN, 'admin'),
 )
 id = models.PositiveSmallIntegerField(choices=ROLE_CHOICES,
primary_key=True)
 def __str__(self):
  return self.get_id_display()
class User(AbstractUser):
 roles = models.ManyToManyField(Role)
***

I am getting error below:

***
ERRORS:
auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes
with reverse accessor for 'User.groups'.
HINT: Add or change a related_name argument to the definition for
'User.groups' or 'User.groups'.
auth.User.user_permissions: (fields.E304) Reverse accessor for
'User.user_permissions' clashes with reverse accessor for
'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for
'User.user_permissions' or 'User.user_permissions'.
users.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes
with reverse accessor for 'User.groups'.
HINT: Add or change a related_name argument to the definition for
'User.groups' or 'User.groups'.
users.User.user_permissions: (fields.E304) Reverse accessor for
'User.user_permissions' clashes with reverse accessor for
'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for
'User.user_permissions' or 'User.user_permissions'.

***

Looking forward for your kind help.

Thanks,

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-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOyrfzvb3JCrgUFPUqTpxiaf-qLvy50nhgOLgA%2BpsjbURQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Itterate with Include Tag

2018-12-29 Thread Shazia Nusrat
Hi Guys,

I have a form created from foreignkey model. I have used "include" with
jinja for displaying my fields. But I don't know how to iterate through and
include tag.
%
Below is the code and I would appreciate if someone can help me to iterate
through following template code.

{% for field in form %}
{% include 'includes/form/form_fields.html' with form=field.myform %}
{% endfor %)
I can't get fields from the form. Please advise.
Looking forward to your feedback. :-)

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOy7tsenKtN8qNdP_0W1zn%2B%3DCM_4V-eguHoqP0K_f29A9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Subclassing Django Views Issue

2018-12-10 Thread Shazia Nusrat
Can someone help me with subclassing django-views as I couldn't understand
the pattern to work with.
Following is the link to see the code.

https://github.com/AndrewIngram/django-extra-views/issues/187

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-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOwouuGW2fTO2Wvn_nobfcBuZO41u-H3jDGxBfT6OGDL3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to populate DB from PDF extracted data

2018-03-09 Thread Shazia Nusrat
Hi,

I am trying to work around with PDF's where user uploads PDF in image or
filefield and then way to extract it for Django and finally update DB table
based on it. Following are the models:

class StudentFee(models.Model):
   class_name = models.CharField(choices=CLASSES, max_lenght=200)
   fee_deposit_slip = models.ImageField(upload_to="students/")

   def __unicode__(self):
 return unicode(self.class_name)

All I need is to design a view where I can extract data from the PDF
uploaded in the model below:

class StudentInfo(models.Model):
first_name = models.CharField(max_length=200)
last_name = models.CharField(max_length=200)
email=models.EmailField()
phone = PhoneField() #using phoneField custom field
def __unicode__(self):
   return unicode(self.first_name)

All the fields in second model does exist in the PDF. In my Views.py

class StudentPDFReader(FormView):
  template_name = 'pdfdata.html'
  form_class = PDFForm
  success_url = '/success/'

  def form_valid(self, form):
   # here I need to extract and add entries to modelform
  return super(StudentPDFReader, self).form_valid(form)

Looking for kind help.

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-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOyHABrpfn48EwMgjbvCB5y1U4AwwL_%2BS1EnCb6WebyWKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Saving Json data from javascript

2018-02-13 Thread Shazia Nusrat
Can you please show me any example about the structure of code I've
provided?

Thanks

On Tue, Feb 13, 2018 at 2:27 AM, Etienne Robillard <tkad...@yandex.com>
wrote:

> Hi Shazia,
>
> You can make a XHR (Ajax) request in javascript to send the data to a
> django callback.
>
> HTH,
>
> Etienne
>
> Le 2018-02-12 à 18:04, Shazia Nusrat a écrit :
>
> Hi,
>
> Below is the code for Javascript from Django template Google Maps API. I
> need to be able to save this in my Django models with JSON response. I am
> new user so an example will be really a great help.
>
> Precisely I need to be able to save coordinates like latitude and
> longitude and then convert it to an address.
>
> Thanks
>
> var map, infoWindow;
>   function initMap() {
> map = new google.maps.Map(document.getElementById('map'), {
>   center: {lat: -34.397, lng: 150.644},
>   zoom: 6
> });
> infoWindow = new google.maps.InfoWindow;
>
> // Try HTML5 geolocation.
> if (navigator.geolocation) {
>   navigator.geolocation.getCurrentPosition(function(position) {
> var pos = {
>   lat: position.coords.latitude,
>   lng: position.coords.longitude
> };
>
> infoWindow.setPosition(pos);
> infoWindow.setContent('Location found.');
> infoWindow.open(map);
> map.setCenter(pos);
>   }, function() {
> handleLocationError(true, infoWindow, map.getCenter());
>   });
> } else {
>   // Browser doesn't support Geolocation
>   handleLocationError(false, infoWindow, map.getCenter());
> }
>   }
>
>   function handleLocationError(browserHasGeolocation, infoWindow, pos) {
> infoWindow.setPosition(pos);
> infoWindow.setContent(browserHasGeolocation ?
>   'Error: The Geolocation service failed.' :
>   'Error: Your browser doesn\'t support 
> geolocation.');
> infoWindow.open(map);
>   }
>
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAD83tOzabkiPgniqofN6BH2tLogei
> GE9JaZ5rppi3f44Hb0ybA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAD83tOzabkiPgniqofN6BH2tLogeiGE9JaZ5rppi3f44Hb0ybA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> Etienne Robillardtkadm30@yandex.comhttps://www.isotopesoftware.ca/
>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOyZn16gV7%3D2am9W8je-Q4mQALNNR5TAgPwYvVs%2B_n%2B9aQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Saving Json data from javascript

2018-02-12 Thread Shazia Nusrat
Hi,

Below is the code for Javascript from Django template Google Maps API. I
need to be able to save this in my Django models with JSON response. I am
new user so an example will be really a great help.

Precisely I need to be able to save coordinates like latitude and longitude
and then convert it to an address.

Thanks

var map, infoWindow;
  function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
  center: {lat: -34.397, lng: 150.644},
  zoom: 6
});
infoWindow = new google.maps.InfoWindow;

// Try HTML5 geolocation.
if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(function(position) {
var pos = {
  lat: position.coords.latitude,
  lng: position.coords.longitude
};

infoWindow.setPosition(pos);
infoWindow.setContent('Location found.');
infoWindow.open(map);
map.setCenter(pos);
  }, function() {
handleLocationError(true, infoWindow, map.getCenter());
  });
} else {
  // Browser doesn't support Geolocation
  handleLocationError(false, infoWindow, map.getCenter());
}
  }

  function handleLocationError(browserHasGeolocation, infoWindow, pos) {
infoWindow.setPosition(pos);
infoWindow.setContent(browserHasGeolocation ?
  'Error: The Geolocation service failed.' :
  'Error: Your browser doesn\'t support
geolocation.');
infoWindow.open(map);
  }

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOzabkiPgniqofN6BH2tLogeiGE9JaZ5rppi3f44Hb0ybA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


GIS Address Form Creation

2018-02-09 Thread Shazia Nusrat
 Hi,

I am trying to create a simple location form from GIS models and following
GeoDjango tutorial and after completing the tutorial I am still confused
about how to go for it.

What I need is that users come in on my page and they select their location
from the map and it should save in the database. So I am looking for
ModelForm based form so I can save it. I tried to use Django-Map-Widgets
and found that it does not support python 3.


Your assistance is appreciated.
Regard,
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-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOzkHo7Lh3BteNgLH%2Bu7oVYE-yB9HvrvOmARUEfXTYGDRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: GeoDjango GIS Model Fieldset Usage

2018-01-10 Thread Shazia Nusrat
For Instance...lets say I need to let customer calculate Azimuth for the
home roof with ModelForm.
Its not a simple one single direction. If you can do it let me know with
example.

Regards,
Shazia.

On Wed, Jan 10, 2018 at 11:30 PM, Jani Tiainen <rede...@gmail.com> wrote:

> Hi.
>
> So what is your actual problem?
>
> 11.1.2018 3.04 "Shazia Nusrat" <shazianu...@gmail.com> kirjoitti:
>
>> Hi,
>>
>> I need quick help about using the fields in the following model:
>>
>> class Size(models.Model):
>>azimuth = models.CharField(max_length=200, blank=True, null=True)
>>tilt = models.CharField(max_length=200, blank=True, null=True)
>>boundary_coordinates = models.CharField(max_length=200, blank=True)
>>height = models.CharField(max_length=200, blank=True)
>>width = models.CharField(max_length=200, blank=True)
>>
>> I know there is a function reference for it but I don't know how to use
>> it as per the link below because I am newbie.
>>
>> https://docs.djangoproject.com/en/2.0/ref/contrib/gis/functions/
>>
>> Please advise.
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/CAD83tOz2xe4mHbbd1Xyag-Tad%2B3zsRjtQyTgC1C4
>> Q35V1Wf4gg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAD83tOz2xe4mHbbd1Xyag-Tad%2B3zsRjtQyTgC1C4Q35V1Wf4gg%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAHn91oeB9c1axU-p7hyXZz5tD8sSbAskK7d%
> 3DpVWTUvEsJwNHrA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHn91oeB9c1axU-p7hyXZz5tD8sSbAskK7d%3DpVWTUvEsJwNHrA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOwpUu9xy4Qo4FiFO6OB4_8ocFt6sjuk3dB_tqV_Zm5nhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


GeoDjango GIS Model Fieldset Usage

2018-01-10 Thread Shazia Nusrat
Hi,

I need quick help about using the fields in the following model:

class Size(models.Model):
   azimuth = models.CharField(max_length=200, blank=True, null=True)
   tilt = models.CharField(max_length=200, blank=True, null=True)
   boundary_coordinates = models.CharField(max_length=200, blank=True)
   height = models.CharField(max_length=200, blank=True)
   width = models.CharField(max_length=200, blank=True)

I know there is a function reference for it but I don't know how to use it
as per the link below because I am newbie.

https://docs.djangoproject.com/en/2.0/ref/contrib/gis/functions/

Please advise.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOz2xe4mHbbd1Xyag-Tad%2B3zsRjtQyTgC1C4Q35V1Wf4gg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Video Chat with Django

2017-09-29 Thread Shazia Nusrat
Hi,

I am trying to collect some information about implementing Video Chat in a
Django project. Is there some working repo where WebRTC is implemented for
video chat using Django?

Some link or web resource would be a great help.

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-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOzFKEf%2BOrkQ9OGRw5%3DUx7QMGCWLkfS%3DuQEfgQ2nq_iV6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Create ModelForms to create ModelForms

2017-08-01 Thread Shazia Nusrat
I need to create a frontend app where I can use forms to create forms such
as Google Surveys or Survey Monkey kind of application. Can someone point
me to any reusable app or something similar or someone can guide me that
would be a great help.

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-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOzVsD004ZO%3Ddu%3DGZnpPnAScKxqm9mdks%2BjLCmhV4x1BKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Creating Forms from frontend like Google Survey Forms

2017-07-26 Thread Shazia Nusrat
Hi,

I need to develop a view that can help end-users create forms from the
frontend like SurveyMonkey or Google Survey Forms. Basically I need to get
admin forms at frontend and let the user's create forms on given set of
fields.

Can anyone point me to right direction please?

Thanks.
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-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOxbP2khsHygoMC3ue7F5GCC93GQ7z%3DZWWB3kL%3Docm_Y3w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dynamic Model ID cannot be called

2017-07-26 Thread Shazia Nusrat
Thank you it worked.
Much appreciated.

Regards,

Shazia

On Wed, Jul 26, 2017 at 5:47 AM, M Hashmi <mhashmi1...@gmail.com> wrote:

> Nothing wrong with your function based view. Just try to fill data in DB
> field. It will work. Because you don't have any record in DB. Try to use
> 'get_or_create' function.
>
>
> M
>
> On Wed, Jul 26, 2017 at 4:50 AM, Shazia Nusrat <shazianu...@gmail.com>
> wrote:
>
>> Hi,
>>
>> I have a simple model like below:
>>
>> class Artists(models.Model):
>>name = models.CharField(max_length=200)
>>description = models.TextField()
>>
>>def __unicode__(self):
>>  return self.name
>>
>> I am trying to call it in my view like below:
>>
>> def artistdetail(request, id):
>>artista = Artist.objects.get(id=id # this line is giving me
>> error.
>>
>>
>> Can someone explain me how to get the id in operational mode. I can call
>> IDs with filtering by name in shell. But how to set it up for the user who
>> uses it.
>>
>>
>> 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-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/CAD83tOyL_Sdi3eeuManMXnsNBXHhvpwzGA0Tt2qXX_
>> MgAbOUaQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAD83tOyL_Sdi3eeuManMXnsNBXHhvpwzGA0Tt2qXX_MgAbOUaQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CANoUts5nmSEeqNVa-%2B-vZ%3DPtmndnkDG%
> 2B5gehMjA1r208u6ggxQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CANoUts5nmSEeqNVa-%2B-vZ%3DPtmndnkDG%2B5gehMjA1r208u6ggxQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOyGW03%3DLEYF28tHD6hEL1NfH3soY01sSYSNxwCrswaJ0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Dynamic Model ID cannot be called

2017-07-26 Thread Shazia Nusrat
Hi,

I have a simple model like below:

class Artists(models.Model):
   name = models.CharField(max_length=200)
   description = models.TextField()

   def __unicode__(self):
 return self.name

I am trying to call it in my view like below:

def artistdetail(request, id):
   artista = Artist.objects.get(id=id # this line is giving me
error.


Can someone explain me how to get the id in operational mode. I can call
IDs with filtering by name in shell. But how to set it up for the user who
uses it.


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-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOyL_Sdi3eeuManMXnsNBXHhvpwzGA0Tt2qXX_MgAbOUaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Forms HorizontalRadioSelect Renderer not working.

2017-07-26 Thread Shazia Nusrat
Thank you so much for help.

Regards,

Shazia

On Tue, Jul 25, 2017 at 12:27 PM, Tim Graham <timogra...@gmail.com> wrote:

> Replace renderer=HorizontalRadioRenderer with attrs={'class': 'inline'}
> and then style radio elements using CSS. contrib.admin uses this
> approach. Here's the CSS:
>
> https://github.com/django/django/blob/d17eaa868cd6911197dcd8b096c4f0
> 418c47007e/django/contrib/admin/static/admin/css/forms.css#L42-L66
>
> On Tuesday, July 25, 2017 at 8:10:58 AM UTC-4, Shazia Nusrat wrote:
>>
>> I am using Djnago 1.11.1. I've tried template approach but perhaps I've
>> missed out something.
>>
>> If you can provide me some workable example I will be really really
>> thankful.
>>
>> Regards,
>> Shazia
>>
>> On Tue, Jul 25, 2017 at 1:57 AM, ecas <eloi@gmail.com> wrote:
>>
>>> Which version of Django are you using? From 1.11 the widgets changed to
>>> a template mechanism.
>>>
>>> https://docs.djangoproject.com/en/1.11/ref/forms/widgets/#radioselect
>>>
>>> Maybe this can help:
>>> https://stackoverflow.com/questions/44187640/django-1-11-
>>> horizontal-choice-field
>>>
>>> El dimarts, 25 juliol de 2017 9:53:13 UTC+2, Shazia Nusrat va escriure:
>>>
>>>> Hi,
>>>>
>>>> I need to select form values horizontally but couldn't get it work.
>>>>
>>>> Following is the code:
>>>>
>>>> class HorizontalRadioRenderer(forms.RadioSelect.renderer):
>>>>   def render(self):
>>>> return mark_safe(u'\n'.join([u'%s\n' % w for w in self]))
>>>>
>>>> class ResponseForm(models.ModelForm):
>>>> class Meta:
>>>> model = Response
>>>> fields = ('interviewer', 'interviewee', 'conditions',
>>>> 'comments')
>>>> def __init__(self, *args, **kwargs):
>>>> # expects a survey object to be passed in initially
>>>> survey = kwargs.pop('survey')
>>>> self.survey = survey
>>>> super(ResponseForm, self).__init__(*args, **kwargs)
>>>> self.uuid = random_uuid = uuid.uuid4().hex
>>>> # add a field for each survey question, corresponding to the
>>>> question
>>>> # type as appropriate.
>>>> data = kwargs.get('data')
>>>> for q in survey.questions():
>>>> if q.question_type == Question.TEXT:
>>>> self.fields["question_%d" % q.pk] =
>>>> forms.CharField(label=q.text,
>>>> widget=forms.Textarea)
>>>> elif q.question_type == Question.RADIO:
>>>> question_choices = q.get_choices()
>>>> self.fields["question_%d" % q.pk] =
>>>> forms.ChoiceField(label=q.text,
>>>> widget=forms.RadioSelect(rende
>>>> rer=HorizontalRadioRenderer),
>>>> choices = question_choices)
>>>>
>>>> Error:
>>>>
>>>> class HorizontalRadioRenderer(forms.RadioSelect.renderer):
>>>> AttributeError: type object 'RadioSelect' has no attribute 'renderer'
>>>>
>>>> Please advise
>>>>
>>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/django-users/d7280ade-f0c0-4c31-813f-1747f1f3cd29%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/d7280ade-f0c0-4c31-813f-1747f1f3cd29%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/90e4c5c4-00a0-48d8-a662-9c6fd6a4818e%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/90e4c5c4-00a0-48d8-a662-9c6fd6a4818e%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOz3VW3Wd2Kcg1RkaXmvDSequsuN7AxUGZdsoMZzyPVV6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Forms HorizontalRadioSelect Renderer not working.

2017-07-25 Thread Shazia Nusrat
I am using Djnago 1.11.1. I've tried template approach but perhaps I've
missed out something.

If you can provide me some workable example I will be really really
thankful.

Regards,
Shazia

On Tue, Jul 25, 2017 at 1:57 AM, ecas <eloi.cas...@gmail.com> wrote:

> Which version of Django are you using? From 1.11 the widgets changed to a
> template mechanism.
>
> https://docs.djangoproject.com/en/1.11/ref/forms/widgets/#radioselect
>
> Maybe this can help:
> https://stackoverflow.com/questions/44187640/django-1-
> 11-horizontal-choice-field
>
> El dimarts, 25 juliol de 2017 9:53:13 UTC+2, Shazia Nusrat va escriure:
>
>> Hi,
>>
>> I need to select form values horizontally but couldn't get it work.
>>
>> Following is the code:
>>
>> class HorizontalRadioRenderer(forms.RadioSelect.renderer):
>>   def render(self):
>> return mark_safe(u'\n'.join([u'%s\n' % w for w in self]))
>>
>> class ResponseForm(models.ModelForm):
>> class Meta:
>> model = Response
>> fields = ('interviewer', 'interviewee', 'conditions', 'comments')
>> def __init__(self, *args, **kwargs):
>> # expects a survey object to be passed in initially
>> survey = kwargs.pop('survey')
>> self.survey = survey
>> super(ResponseForm, self).__init__(*args, **kwargs)
>> self.uuid = random_uuid = uuid.uuid4().hex
>> # add a field for each survey question, corresponding to the
>> question
>> # type as appropriate.
>> data = kwargs.get('data')
>> for q in survey.questions():
>> if q.question_type == Question.TEXT:
>> self.fields["question_%d" % q.pk] =
>> forms.CharField(label=q.text,
>> widget=forms.Textarea)
>> elif q.question_type == Question.RADIO:
>> question_choices = q.get_choices()
>> self.fields["question_%d" % q.pk] =
>> forms.ChoiceField(label=q.text,
>> widget=forms.RadioSelect(rende
>> rer=HorizontalRadioRenderer),
>> choices = question_choices)
>>
>> Error:
>>
>> class HorizontalRadioRenderer(forms.RadioSelect.renderer):
>> AttributeError: type object 'RadioSelect' has no attribute 'renderer'
>>
>> Please advise
>>
>> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/d7280ade-f0c0-4c31-813f-1747f1f3cd29%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d7280ade-f0c0-4c31-813f-1747f1f3cd29%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOz%2BTEn1bB80vv--OTvygQNKC%3DOi_mz2vMCj9hHoMFR-Jw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django Forms HorizontalRadioSelect Renderer not working.

2017-07-25 Thread Shazia Nusrat
Hi,

I need to select form values horizontally but couldn't get it work.

Following is the code:

class HorizontalRadioRenderer(forms.RadioSelect.renderer):
  def render(self):
return mark_safe(u'\n'.join([u'%s\n' % w for w in self]))

class ResponseForm(models.ModelForm):
class Meta:
model = Response
fields = ('interviewer', 'interviewee', 'conditions', 'comments')
def __init__(self, *args, **kwargs):
# expects a survey object to be passed in initially
survey = kwargs.pop('survey')
self.survey = survey
super(ResponseForm, self).__init__(*args, **kwargs)
self.uuid = random_uuid = uuid.uuid4().hex
# add a field for each survey question, corresponding to the
question
# type as appropriate.
data = kwargs.get('data')
for q in survey.questions():
if q.question_type == Question.TEXT:
self.fields["question_%d" % q.pk] =
forms.CharField(label=q.text,
widget=forms.Textarea)
elif q.question_type == Question.RADIO:
question_choices = q.get_choices()
self.fields["question_%d" % q.pk] =
forms.ChoiceField(label=q.text,

widget=forms.RadioSelect(renderer=HorizontalRadioRenderer),
choices = question_choices)

Error:

class HorizontalRadioRenderer(forms.RadioSelect.renderer):
AttributeError: type object 'RadioSelect' has no attribute 'renderer'

Please advise

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOy6AMDmVZ9WmEY7Z9zhzqswSpa%2BejZiGUvrUkwW1y8Tuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Need help to catch "cart_id" based on session.

2016-11-05 Thread Shazia Nusrat
Hi,

I am using doorsale repo for building ecommerce site due to it's simplicity
but I am stuck at the error while trying to catch cart session ID.

The repo link is:

https://github.com/mysteryjeans/doorsale

Error traceback is below:


Request Method: POST
Request URL: http://localhost:8000/sales/checkout/order/

Django Version: 1.9.11
Python Version: 2.7.12
Installed Applications:
('django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'doorsale',
 'doorsale.geo',
 'doorsale.pages',
 'doorsale.accounts',
 'doorsale.catalog',
 'doorsale.sales',
 'doorsale.financial',
 'doorsale.payments',
 'sorl.thumbnail',
 'pipeline')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware')



Traceback:

File
"/home/osboxes/Desktop/doorsaleproj/local/lib/python2.7/site-packages/django/core/handlers/base.py"
in get_response
  149. response =
self.process_exception_by_middleware(e, request)

File
"/home/osboxes/Desktop/doorsaleproj/local/lib/python2.7/site-packages/django/core/handlers/base.py"
in get_response
  147. response = wrapped_callback(request,
*callback_args, **callback_kwargs)

File
"/home/osboxes/Desktop/doorsaleproj/local/lib/python2.7/site-packages/django/utils/decorators.py"
in inner
  184. return func(*args, **kwargs)

File
"/home/osboxes/Desktop/doorsaleproj/local/lib/python2.7/site-packages/django/views/generic/base.py"
in view
  68. return self.dispatch(request, *args, **kwargs)

File
"/home/osboxes/Desktop/doorsaleproj/local/lib/python2.7/site-packages/django/views/generic/base.py"
in dispatch
  88. return handler(request, *args, **kwargs)

File
"/home/osboxes/Desktop/doorsaleproj/local/lib/python2.7/site-packages/doorsale/sales/views.py"
in post
  351. cart_id = request.session['cart_id']

File
"/home/osboxes/Desktop/doorsaleproj/local/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py"
in __getitem__
  50. return self._session[key]

Exception Type: KeyError

Please advice.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOzsSY%3D%2BkW6bSTWfR2ea17JgOOy%3DVNWunLR6P%3DxJDF9xRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple Types of Account with Abstract User

2016-10-23 Thread Shazia Nusrat
I will try it but I have a question that how can I link this to
Django-regisration-redux app. Like if somebody tries to sign in they should
have registration choices within registration app to save my time.

As I visualize it that I should be able to login as supplier from
registration redux template system as supplier/designer or whatever role as
user I chose.


Thank you for your help and will try and let you know about the update.

Regards,
Shazia

On Sun, Oct 23, 2016 at 9:26 PM, Asad Jibran Ahmed <surfer...@gmail.com>
wrote:

> In that case I suggest you create multiple models, one for each type of
> user. For example, you could have a SupplierProfile, DesignerProfile, etc...
>
> The reason I suggest multiple profile models, instead of just one model
> with a configurable account type field, is that I assume each of these user
> types will have it's own data. For example the SupplierProfile might need a
> bank account details field, whereas a designer probably does not.
>
> So create multiple models, named similar to SupplierProfile,
> DesignerProfile, etc and have each of those link to the Django user model
> via a OneToOne key. This is similar to what you're doing with your
> UserDetails models.
>
> Hope that helps.
>
> Asad Jibran Ahmed <surfer...@gmail.com>
> http://blog.asadjb.com
>
> On Mon, Oct 24, 2016 at 7:18 AM, Shazia Nusrat <shazianu...@gmail.com>
> wrote:
>
>> I've deleted DB and migrations I had previously.
>> But still can't figure this out. What I need isthat multiple shops
>> needs to get registered with my ecommerce store as well as designers and as
>> well as referrers to sell products and then simple registration while
>> checkout is in progress.
>>
>> I have simple idea that I need to somehow create submodel from built-in
>> User model with abstract model. Then I want that if user selects Customer
>> then customer form should appear, if user says Designer it should present
>> designer and so on except the checkout user that I figured out to complete
>> the order with guest user by catching session ID and user's email upon
>> checkout.
>>
>> This part I can't figure out. Moreover all these account should have
>> access to relevant content. Like Supplier should be able to manage
>> inventory or his/her products. Designer only should sell their products in
>> bulk etc. So if I fix this issue then I can move forward otherwise its a
>> dead lock for me from 4 last hours.
>>
>> Please advise.
>>
>> Regards,
>>
>> Shazia
>>
>> On Sun, Oct 23, 2016 at 7:53 PM, Asad Jibran Ahmed <surfer...@gmail.com>
>> wrote:
>>
>>> Did you change the AUTH_USER_MODEL setting *after *you had already run 
>>> python
>>> manage.py migrate once (or more) before? From the error I guess what's
>>> happening is that you already have a User model in place. It was
>>> probably created when you first ran Django migrations without specifying a
>>> custom user model.
>>>
>>> If that is the case, and you *really *want a custom user model, you'll
>>> have to ensure that the user model is the first model create in your app.
>>> For details look at the warning given at https://docs.djangoproject.
>>> com/en/1.10/topics/auth/customizing/#substituting-a-custom-user-model.
>>>
>>> From what I'm seeing of your models, you only seem to want to add extra
>>> fields to each user. You can also do that by just pointing your
>>> UserDetails model to the existing django.contrib.auth.models.User model,
>>> and adding the type information in your UserDetails model instead. That
>>> might work for you. Otherwise you'll have to remove your existing database
>>> and run migrations from start.
>>>
>>> Asad Jibran Ahmed <surfer...@gmail.com>
>>> http://blog.asadjb.com
>>>
>>> On Mon, Oct 24, 2016 at 4:37 AM, Shazia Nusrat <shazianu...@gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>> I am trying to create multiple types of users in my django e-commerce
>>>> project by extending built-in Django user model but I am having issue.
>>>>
>>>> Would appreciate if someone can guide me to right direction.
>>>> Following is the code in my "accounts" app.
>>>>
>>>> from __future__ import unicode_literals
>>>> from django.db import models
>>>> from django.contrib.auth.models import AbstractUser
>>>>
>>>> class CustomUser(AbstractUser):
>>>> type_choices = (
>>>> ('Supplie

Re: Multiple Types of Account with Abstract User

2016-10-23 Thread Shazia Nusrat
I've deleted DB and migrations I had previously.
But still can't figure this out. What I need isthat multiple shops
needs to get registered with my ecommerce store as well as designers and as
well as referrers to sell products and then simple registration while
checkout is in progress.

I have simple idea that I need to somehow create submodel from built-in
User model with abstract model. Then I want that if user selects Customer
then customer form should appear, if user says Designer it should present
designer and so on except the checkout user that I figured out to complete
the order with guest user by catching session ID and user's email upon
checkout.

This part I can't figure out. Moreover all these account should have access
to relevant content. Like Supplier should be able to manage inventory or
his/her products. Designer only should sell their products in bulk etc. So
if I fix this issue then I can move forward otherwise its a dead lock for
me from 4 last hours.

Please advise.

Regards,

Shazia

On Sun, Oct 23, 2016 at 7:53 PM, Asad Jibran Ahmed <surfer...@gmail.com>
wrote:

> Did you change the AUTH_USER_MODEL setting *after *you had already run python
> manage.py migrate once (or more) before? From the error I guess what's
> happening is that you already have a User model in place. It was probably
> created when you first ran Django migrations without specifying a custom
> user model.
>
> If that is the case, and you *really *want a custom user model, you'll
> have to ensure that the user model is the first model create in your app.
> For details look at the warning given at https://docs.djangoproject.
> com/en/1.10/topics/auth/customizing/#substituting-a-custom-user-model.
>
> From what I'm seeing of your models, you only seem to want to add extra
> fields to each user. You can also do that by just pointing your
> UserDetails model to the existing django.contrib.auth.models.User model,
> and adding the type information in your UserDetails model instead. That
> might work for you. Otherwise you'll have to remove your existing database
> and run migrations from start.
>
> Asad Jibran Ahmed <surfer...@gmail.com>
> http://blog.asadjb.com
>
> On Mon, Oct 24, 2016 at 4:37 AM, Shazia Nusrat <shazianu...@gmail.com>
> wrote:
>
>> Hi,
>> I am trying to create multiple types of users in my django e-commerce
>> project by extending built-in Django user model but I am having issue.
>>
>> Would appreciate if someone can guide me to right direction.
>> Following is the code in my "accounts" app.
>>
>> from __future__ import unicode_literals
>> from django.db import models
>> from django.contrib.auth.models import AbstractUser
>>
>> class CustomUser(AbstractUser):
>> type_choices = (
>> ('Supplier', 'Supplier'),
>> ('Designer', 'Designer'),
>> ('Shop', 'Shop'),
>> ('Referrer', 'Referrer'),
>> ('User', 'User'),
>> )
>> user_type = models.CharField(max_length=2,
>>  choices=type_choices,
>>  default='User')
>>
>> class UserDetails(models.Model):
>> type = models.OneToOneField(CustomUser)
>> extra_info = models.CharField(max_length=200)
>>
>> My settings.py includes 'accounts' in installed app and variable included
>> for extending models in settings.py:
>>
>> AUTH_USER_MODEL = 'accounts.Customer'
>>
>> Error:
>>
>>
>> ERRORS:
>> accounts.CustomUser.groups: (fields.E304) Reverse accessor for
>> 'CustomUser.group
>> s' clashes with reverse accessor for 'User.groups'.
>> HINT: Add or change a related_name argument to the definition for
>> 'Custo
>> mUser.groups' or 'User.groups'.
>> accounts.CustomUser.user_permissions: (fields.E304) Reverse accessor for
>> 'Custom
>> User.user_permissions' clashes with reverse accessor for
>> 'User.user_permissions'
>> .
>> HINT: Add or change a related_name argument to the definition for
>> 'Custo
>> mUser.user_permissions' or 'User.user_permissions'.
>> auth.User.groups: (fields.E304) Reverse accessor for 'User.groups'
>> clashes with
>> reverse accessor for 'CustomUser.groups'.
>> HINT: Add or change a related_name argument to the definition for
>> 'User.
>> groups' or 'CustomUser.groups'.
>> auth.User.user_permissions: (fields.E304) Reverse accessor for
>> 'User.user_permis
>> sions' clashes with reverse accessor for 'CustomUser.user_permissions'.
>> HINT: Add or change a related_name argument to the definition for
>> 'User.
>> user_permissions' o

Multiple Types of Account with Abstract User

2016-10-23 Thread Shazia Nusrat
Hi,
I am trying to create multiple types of users in my django e-commerce
project by extending built-in Django user model but I am having issue.

Would appreciate if someone can guide me to right direction.
Following is the code in my "accounts" app.

from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import AbstractUser

class CustomUser(AbstractUser):
type_choices = (
('Supplier', 'Supplier'),
('Designer', 'Designer'),
('Shop', 'Shop'),
('Referrer', 'Referrer'),
('User', 'User'),
)
user_type = models.CharField(max_length=2,
 choices=type_choices,
 default='User')

class UserDetails(models.Model):
type = models.OneToOneField(CustomUser)
extra_info = models.CharField(max_length=200)

My settings.py includes 'accounts' in installed app and variable included
for extending models in settings.py:

AUTH_USER_MODEL = 'accounts.Customer'

Error:


ERRORS:
accounts.CustomUser.groups: (fields.E304) Reverse accessor for
'CustomUser.group
s' clashes with reverse accessor for 'User.groups'.
HINT: Add or change a related_name argument to the definition for
'Custo
mUser.groups' or 'User.groups'.
accounts.CustomUser.user_permissions: (fields.E304) Reverse accessor for
'Custom
User.user_permissions' clashes with reverse accessor for
'User.user_permissions'
.
HINT: Add or change a related_name argument to the definition for
'Custo
mUser.user_permissions' or 'User.user_permissions'.
auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes
with
reverse accessor for 'CustomUser.groups'.
HINT: Add or change a related_name argument to the definition for
'User.
groups' or 'CustomUser.groups'.
auth.User.user_permissions: (fields.E304) Reverse accessor for
'User.user_permis
sions' clashes with reverse accessor for 'CustomUser.user_permissions'.
HINT: Add or change a related_name argument to the definition for
'User.
user_permissions' or 'CustomUser.user_permissions'.

Please advise.

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-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOxKnQCeWyWjYmbxo7iaxmsysk8WJs-zy44GZbDXr93iEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Kind Attention Requested] Django Zinnia blog error for entries

2016-09-27 Thread Shazia Nusrat
Thank you so much. It worked.

On Tue, Sep 27, 2016 at 2:08 AM, M Hashmi <mhashmi1...@gmail.com> wrote:

> Try registering django_comments after zinnia in the INSTALLED_APPS setting
> not before.
>
> INSTALLED_APPS = (
>   'django.contrib.auth',
>   'django.contrib.admin',
>   'django.contrib.sites',
>   'django.contrib.sessions',
>   'django.contrib.messages',
>   'django.contrib.staticfiles',
>   'django.contrib.contenttypes',
>   'mptt',
>   'tagging',
>   'zinnia',
>   'django_comments',)
>
> Got this solution from the owner of repo. Check the issue on Github.
>
> On Tue, Sep 27, 2016 at 12:27 AM, Shazia Nusrat <shazianu...@gmail.com>
> wrote:
>
>> I am trying to fix issue with Zinnia blog application and its popping up
>> error related to aggregator and entries. Following is the code if someone
>> have a suggestion:
>>
>> def get_authors(context, template='zinnia/tags/authors.html'):
>> """
>> Return the published authors.
>> """
>> entries = Entry.objects.all()
>> return {'template': template,
>> 'authors': Author.published.all().annotate(
>> count_entries_published=Count('entries')),
>> 'context_author': context.get('author')}
>>
>> Above I don't think causing any issue but below is the code that might be
>> causing all the fuss in second last line.
>>
>> def get_queryset(self):
>> """
>> Return a queryset containing published entries.
>> """
>> now = timezone.now()
>> return super(
>> EntryRelatedPublishedManager, self).get_queryset().filter(
>> models.Q(entries__start_publication__lte=now) |
>> models.Q(entries__start_publication=None),
>> models.Q(entries__end_publication__gt=now) |
>> models.Q(entries__end_publication=None),
>> entries__status=PUBLISHED,
>> entries__sites=Site.objects.get_current()
>> ).distinct()
>>
>> Please suggest a solution because overall Zinnia is an impressive app but
>> with one error its almost useless. Owner of the repo already got plenty of
>> users with same complain. Error is same with both Python2 and PYthon3.
>>
>> For generous coders willing to work on this, repo is located at
>> https://github.com/Fantomas42/django-blog-zinnia/issues.
>>
>>
>> Traceback:
>> File 
>> "C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\core\handlers\exception.py"
>>  in inner
>>   39. response = get_response(request)
>> File 
>> "C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\core\handlers\base.py"
>>  in _legacy_get_response
>>   249. response = self._get_response(request)
>> File 
>> "C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\core\handlers\base.py"
>>  in _get_response
>>   217. response = self.process_exception_by_middleware(e, 
>> request)
>> File 
>> "C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\core\handlers\base.py"
>>  in _get_response
>>   215. response = response.render()
>> File 
>> "C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\response.py"
>>  in render
>>   109. self.content = self.rendered_content
>> File 
>> "C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\response.py"
>>  in rendered_content
>>   86. content = template.render(context, self._request)
>> File 
>> "C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\backends\django.py"
>>  in render
>>   66. return self.template.render(context)
>> File 
>> "C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\base.py"
>>  in render
>>   208. return self._render(context)
>> File 
>> "C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\base.py"
>>  in _render
>>   199. return self.nodelist.render(context)
>> File 
>> "C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\base.py"
>>  in render
>>   994. bit = node.render_annotated(context)
>> File 
>> "C:\Users\Shazia\zinb

[Kind Attention Requested] Django Zinnia blog error for entries

2016-09-27 Thread Shazia Nusrat
I am trying to fix issue with Zinnia blog application and its popping up
error related to aggregator and entries. Following is the code if someone
have a suggestion:

def get_authors(context, template='zinnia/tags/authors.html'):
"""
Return the published authors.
"""
entries = Entry.objects.all()
return {'template': template,
'authors': Author.published.all().annotate(
count_entries_published=Count('entries')),
'context_author': context.get('author')}

Above I don't think causing any issue but below is the code that might be
causing all the fuss in second last line.

def get_queryset(self):
"""
Return a queryset containing published entries.
"""
now = timezone.now()
return super(
EntryRelatedPublishedManager, self).get_queryset().filter(
models.Q(entries__start_publication__lte=now) |
models.Q(entries__start_publication=None),
models.Q(entries__end_publication__gt=now) |
models.Q(entries__end_publication=None),
entries__status=PUBLISHED,
entries__sites=Site.objects.get_current()
).distinct()

Please suggest a solution because overall Zinnia is an impressive app but
with one error its almost useless. Owner of the repo already got plenty of
users with same complain. Error is same with both Python2 and PYthon3.

For generous coders willing to work on this, repo is located at
https://github.com/Fantomas42/django-blog-zinnia/issues.


Traceback:
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\core\handlers\exception.py"
in inner
  39. response = get_response(request)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\core\handlers\base.py"
in _legacy_get_response
  249. response = self._get_response(request)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\core\handlers\base.py"
in _get_response
  217. response =
self.process_exception_by_middleware(e, request)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\core\handlers\base.py"
in _get_response
  215. response = response.render()
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\response.py"
in render
  109. self.content = self.rendered_content
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\response.py"
in rendered_content
  86. content = template.render(context, self._request)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\backends\django.py"
in render
  66. return self.template.render(context)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\base.py"
in render
  208. return self._render(context)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\base.py"
in _render
  199. return self.nodelist.render(context)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\base.py"
in render
  994. bit = node.render_annotated(context)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\base.py"
in render_annotated
  961. return self.render(context)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\loader_tags.py"
in render
  174. return compiled_parent._render(context)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\base.py"
in _render
  199. return self.nodelist.render(context)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\base.py"
in render
  994. bit = node.render_annotated(context)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\base.py"
in render_annotated
  961. return self.render(context)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\loader_tags.py"
in render
  174. return compiled_parent._render(context)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\base.py"
in _render
  199. return self.nodelist.render(context)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\base.py"
in render
  994. bit = node.render_annotated(context)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\base.py"
in render_annotated
  961. return self.render(context)
File 
"C:\Users\Shazia\zinblog\lib\site-packages\django-1.10.1-py2.7.egg\django\template\loader_tags.py"
in render
  174. return compiled_parent._render(context)
File 

Can someone help me to fix ForeignKey related filter issues

2016-09-25 Thread Shazia Nusrat
Hi,

Following is the link and kindly assist as I've been trying to do this for
hours now.

http://stackoverflow.com/questions/39685833/django-filter-with-foreignkey-not-working?noredirect=1#comment66671635_39685833

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-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOyWTTm5sV5uYtBCjis62oDawfvEnf2NtFWWoLDd3kvPNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


ForeignKey filters are not working

2016-09-25 Thread Shazia Nusrat
Hi,
Can someone please help me with the question in link.

I've been trying to get it done from hours now please assist to get my
processed orders displayed on dashboard.

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-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOwphrNL%3DnMWH8cyYAQ-nA4Mqeyd4X%3DLn0nL8RiU0NAjQQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error: int() argument must be a string or a number, not 'SimpleLazyObject'

2016-08-31 Thread Shazia Nusrat
Following is the dispatch function:

 def dispatch(self, request, *args, **kwargs):
try:
user_check_id = self.request.session.get("user_checkout_id")
user_checkout = UserCheckout.objects.get(id=user_check_id)
except UserCheckout.DoesNotExist:
user_checkout = UserCheckout.objects.get(user=request.user)
except:
user_checkout = None

obj = self.get_object()
if obj.user == user_checkout and user_checkout is not None:
return super(OrderDetail, self).dispatch(request, *args,
**kwargs)
else:
raise Http404

On line 27 color is red. Usually the error related to SimpleLazyObject
means that it's not able to grab the field with reference. I don't know
what to replace it with.

On Wed, Aug 31, 2016 at 5:31 AM, Andromeda Yelton <
andromeda.yel...@gmail.com> wrote:

> I think the key line of the traceback is this -
> > File "C:\Users\Shazia\dd\src\orders\views.py" in dispatch
> >   27. user_checkout = UserCheckout.objects.get(user=
> request.user)
>
> And the error is being thrown during your redirect to /orders/4/ at the
> end of the post. What does your orders/views.py look like around line 27?
>
> Unrelated to this error, but I'm also wondering what happens in
> CheckoutFinalView if the paymethod is CashOnDelivery or CreditCard -
> neither of those branches of your if statement actually return any sort of
> http response.
>
> On Wed, Aug 31, 2016 at 7:27 AM, Shazia Nusrat <shazianu...@gmail.com>
> wrote:
>
>> Hi I am having this error while I am trying to delete session and cart by
>> IDs after order fulfillment.
>>
>> carts/views.py
>>
>> class CheckoutFinalView(CartOrderMixin, View):
>>> def post(self, request, *args, **kwargs):
>>> order = self.get_order()
>>> order_id = order.id
>>> print order_id
>>>
>>> pay_method = request.POST.get("paymethod")
>>> print pay_method
>>> order.save()
>>>
>>> if request.POST.get('paymethod') == "CashOnDelivery":
>>> order.mark_completed(order_id)
>>> messages.success(request, "Thank you for your order")
>>> del request.session["cart_id"]
>>> del request.session["order_id"]
>>> elif request.POST.get("paymethod") == 'CreditCard':
>>> order.mark_completed(order_id)
>>> messages.success(request, "Thank you for your order")
>>> del request.session['order_id']
>>> del request.session['cart_id']
>>> else:
>>> return redirect("order_detail", pk=order.pk)
>>>
>>
>> In my orders/models.py:
>>
>> order_id = models.CharField(max_length=20, null=True, blank=True)
>> paymethod = models.CharField(max_length=16, choices=CHOICES,
>> default='CashOnDelivery')
>>
>>
>> My orders/views.py:
>>
>> class CashOnDelivery(FormView):
>>> model = Order
>>> form_class = PaymentForm
>>> template_name = 'orders/payment_method.html'
>>> success_url = '/checkout/final'
>>>
>>> My orders/forms.py:
>>
>> class PaymentForm(forms.ModelForm):
>>> class Meta:
>>> model = Order
>>> fields = [
>>> 'paymethod'
>>> ]
>>>
>>
>> My carts/checkout.html:
>>
>> {% extends 'base.html' %}
>>> {% load crispy_forms_tags %}
>>> {% block content %}
>>>
>>> {% csrf_token %}
>>>  
>>> 
>>>
>>> {{ paymentform|crispy }}
>>>
>>>
>>>  Complete Order
>>> 
>>>
>>> 
>>> {% endblock %}.
>>>
>>
>> Finally my complete traceback:
>>
>> > Traceback:
>> > File "C:\Users\Shazia\dd\lib\site-packages\django\core\handlers\base.py"
>> in get_response
>> >   132. response = wrapped_callback(request,
>> *callback_args, **callback_kwargs)
>> > File "C:\Users\Shazia\dd\lib\site-packages\django\views\generic\base.py"
>> in view
>> >   71. return self.dispatch(request, *args, **kwargs)
>> > File "C:\Users\Shazia\dd\src\orders\views.py" in dispatch
>> >   27. user_checkout = UserCheckout.objects.get(user=
>> request.user)
>> > File "C:\Users\Shazi

Error: int() argument must be a string or a number, not 'SimpleLazyObject'

2016-08-31 Thread Shazia Nusrat
Hi I am having this error while I am trying to delete session and cart by
IDs after order fulfillment.

carts/views.py

class CheckoutFinalView(CartOrderMixin, View):
> def post(self, request, *args, **kwargs):
> order = self.get_order()
> order_id = order.id
> print order_id
>
> pay_method = request.POST.get("paymethod")
> print pay_method
> order.save()
>
> if request.POST.get('paymethod') == "CashOnDelivery":
> order.mark_completed(order_id)
> messages.success(request, "Thank you for your order")
> del request.session["cart_id"]
> del request.session["order_id"]
> elif request.POST.get("paymethod") == 'CreditCard':
> order.mark_completed(order_id)
> messages.success(request, "Thank you for your order")
> del request.session['order_id']
> del request.session['cart_id']
> else:
> return redirect("order_detail", pk=order.pk)
>

In my orders/models.py:

order_id = models.CharField(max_length=20, null=True, blank=True)
paymethod = models.CharField(max_length=16, choices=CHOICES,
default='CashOnDelivery')


My orders/views.py:

class CashOnDelivery(FormView):
> model = Order
> form_class = PaymentForm
> template_name = 'orders/payment_method.html'
> success_url = '/checkout/final'
>
> My orders/forms.py:

class PaymentForm(forms.ModelForm):
> class Meta:
> model = Order
> fields = [
> 'paymethod'
> ]
>

My carts/checkout.html:

{% extends 'base.html' %}
> {% load crispy_forms_tags %}
> {% block content %}
>
> {% csrf_token %}
>  
> 
>
> {{ paymentform|crispy }}
>
>
>  Complete Order
> 
>
> 
> {% endblock %}.
>

Finally my complete traceback:

> Traceback:
> File "C:\Users\Shazia\dd\lib\site-packages\django\core\handlers\base.py"
in get_response
>   132. response = wrapped_callback(request,
*callback_args, **callback_kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\views\generic\base.py"
in view
>   71. return self.dispatch(request, *args, **kwargs)
> File "C:\Users\Shazia\dd\src\orders\views.py" in dispatch
>   27. user_checkout =
UserCheckout.objects.get(user=request.user)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\manager.py"
in manager_method
>   127. return getattr(self.get_queryset(), name)(*args,
**kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\query.py" in
get
>   325. clone = self.filter(*args, **kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\query.py" in
filter
>   679. return self._filter_or_exclude(False, *args, **kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\query.py" in
_filter_or_exclude
>   697. clone.query.add_q(Q(*args, **kwargs))
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\sql\query.py"
in add_q
>   1310. clause, require_inner = self._add_q(where_part,
self.used_aliases)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\sql\query.py"
in _add_q
>   1338. allow_joins=allow_joins,
split_subq=split_subq,
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\sql\query.py"
in build_filter
>   1200. lookups,
value)
> File
"C:\Users\Shazia\dd\lib\site-packages\django\db\models\fields\related.py"
in get_lookup_constraint
>   1745. lookup_class(target.get_col(alias, source),
val), AND)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\lookups.py"
in __init__
>   101. self.rhs = self.get_prep_lookup()
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\lookups.py"
in get_prep_lookup
>   139. return
self.lhs.output_field.get_prep_lookup(self.lookup_name, self.rhs)
> File
"C:\Users\Shazia\dd\lib\site-packages\django\db\models\fields\__init__.py"
in get_prep_lookup
>   727. return self.get_prep_value(value)
> File
"C:\Users\Shazia\dd\lib\site-packages\django\db\models\fields\__init__.py"
in get_prep_value
>   985. return int(value)
>
> Exception Type: TypeError at /orders/4/
> Exception Value: int() argument must be a string or a number, not
'SimpleLazyObject'

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOxhgfQGucutTQ%2BFScou0VORFJPhSXUnhFeiwqUD2TyETg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Non Admin Dashboard/Shop Login for Suppliers

2016-08-20 Thread Shazia Nusrat
Hi,

I am using Django-registration for registration process in my django
project. Now I need to add a shop login for resellers. Can some one provide
me the process to add Shop-Dashboard in NLP like in non coding format just
to give me idea how to go for it.

Do I need to build form from my Shop models and then present it in view and
that's it?
Kindly give me benefit out of your experience that what are the
considerations I should work with.

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-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD83tOwJyaez71o8bQFXwvqG6opwU_wv_Kmd26ChJMx%3Dn8k3Og%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.