Re: Please help me to add button functionality in django admin panel for filter list of objects

2021-08-08 Thread MR INDIA
This article can help 
: 
https://hakibenita.medium.com/how-to-add-custom-action-buttons-to-django-admin-8d266f5b0d41
 

On Thursday, 5 August 2021 at 18:31:52 UTC+5:30 arvind@gmail.com wrote:

> hey guys i want to add the action on click the list will be filter of 
> objects
>
> here the on click of view client task i want to filter task which author 
> type is client
> Here its my try.
>
> *inherit html*
> {% extends 'admin/change_list.html' %}
>
> {% block object-tools %}
> 
> 
> {% csrf_token %}
> View Client Task
> 
>
> 
> 
>
>
>
> *admin.py*
>
>
> *task admin*
> from django.conf.urls import patterns, url
> from django.core.urlresolvers import reverse
> class TaskAdmin(SimpleHistoryAdmin, ExportActionModelAdmin):
> change_list_template = "admin/client_task_change_list.html"
> fieldsets = (
> (
> None,
> {'fields': ('title', 'amount','word','status', 'manager', 'executive', 
> 'assignee','owner','timezone','moved_to_freelancer_portal', 
> 'can_send_without_payment', 
> 'start_date','deadline_soft','deadline_hard','client','team_lead','quality_manager','referencing_style',
>  
> 'tags')}
> ),
> (
> _('Content'),
> {'fields': ('description','author')}
> ),
> (
> _('Tracking'),
> {'fields': ('accepted_by_manager', 'accepted_by_manager_at', 
> 'completed_by_employee', 'completed_by_employee_at',\
>
> 'verified_by_manager','verified_by_manager_at','verified_by_quality','verified_by_quality_at',\
> 'sent_to_client','sent_to_client_at','completed_on')}
> ),
> )
>
> inlines = (PaymentInline,RatingInline,) 
> list_display = ('title', 'status', 'client', 'manager', 'assignee', 
> 'executive', 'team_lead', 
> 'quality_manager','get_payment_status','author','created_at','deadline_soft','deadline_hard','word')
> list_filter = ('status', 'author__type', 
> 'client__clientprofile__email_to_use', OverdueTaskListFilter,('manager', 
> admin.RelatedOnlyFieldListFilter), ('team_lead', 
> admin.RelatedOnlyFieldListFilter), ('quality_manager', 
> admin.RelatedOnlyFieldListFilter),PaymentStatusCategoryListFilter,('deadline_soft',
>  
> DateRangeFilter),('deadline_hard', DateRangeFilter), ('start_date', 
> DateRangeFilter), ('completed_on', DateRangeFilter), AuthorFilter, 
> ('owner', admin.RelatedOnlyFieldListFilter), 'moved_to_freelancer_portal')
> search_fields = ('key', 'title', 'client__username', 'client__email', 
> 'manager__email',)
> date_hierarchy = ('deadline_hard')
> resource_class = TaskResource
>
> # def get_urls(self):
>
> # urls = super(TaskAdmin,self).get_urls()
> # extra_url = patterns('',
> # # url(r'^Client/$',self.get_client_task, 
> name='get_client_task'),#self.admin_site.admin_view(self.do_evil_view))
> # url(r'^client/$',self.admin_site.admin_view(self.get_client_task)),
> # )
> # return urls + extra_url
> # def get_client_task(self, request):
> # # if 'get_client' in request.POST:
> # Task.objects.filter(author__type = UserAccount.LEVEL0)
> # # if self.model.objects.filter(author__type = 
> UserAccount.LEVEL0).exists():
> # self.message_user(request, "Here Its all Clients Tasks")
> # # else:
> # # self.message_user(request, "NO Clients Tasks")
>
> # return reverse('../')
>
> formats = (
> base_formats.CSV,
> base_formats.XLS,
> )
> raw_id_fields = ('author','assignee', 
> 'team_lead','executive','quality_manager', 'manager', 'client', 'owner', 
> 'executive', 'specification')
> history_list_display = ["history_change_reason", "word", 
> "deadline_hard","moved_to_freelancer_portal", "status"]
> #filter_horizontal = ('equipment',)
>
> # def render_change_form(self, request, context, *args, **kwargs):
> # """We need to update the context to show the button."""
> # context.update({'show_client_task': True})
> # return super().render_change_form(request, context, *args, **kwargs)
>
>
> def get_payment_status(self, obj):
> return obj.payment.get_status()
> get_payment_status.short_description = 'Payment'
> def get_queryset(self, request):
> queryset = super(TaskAdmin, self).get_queryset(
> request).annotate(feedback_count=Count('feedback'))
> # if 'get_client' in request.POST:
> # queryset.filter(author__type = UserAccount.LEVEL0)
> # return queryset
> # return queryset
> {{ block.super }}
> {% endblock %}
>

-- 
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/a4abd021-7623-4c41-aaa4-ecd35b519b67n%40googlegroups.com.


Re: help me

2021-08-08 Thread MR INDIA
You can use any hosting provider who provides you the root access, so that 
you can ssh into the server and host your django 

On Thursday, 5 August 2021 at 11:44:24 UTC+5:30 satyajit...@gmail.com wrote:

> Good Morning Guys, I'm from India. I'm an open source engineer. Having 2 
> years of professional experience in software development.
> I can help you with deploying your local application to the server. 
>
> On Wed, Aug 4, 2021 at 6:41 PM Badr Gamal  wrote:
>
>> Good morning guys,
>>
>> I am new web developer and start to code with python django  framwork
>>
>> I only made a web site at my local machine .
>>
>> What i do after that to make this website published on web ?
>>
>> On Wednesday, July 28, 2021 at 3:43:51 PM UTC+2 skyli...@gmail.com wrote:
>>
>>> You can. Use name cheap, cpanel
>>>
>>> On Wednesday, July 28, 2021, David Crandell  
>>> wrote:
>>>
>>>> Try deploying to a PaaS platform like Heroku or DigitalOceans Apps 
>>>> service.
>>>>
>>>> They can be very cost effective and are an excellent way to host a 
>>>> Django app.
>>>>
>>>> On Tuesday, July 27, 2021 at 11:26:13 AM UTC-5 kossit...@gmail.com 
>>>> wrote:
>>>>
>>>>>
>>>>> I need a video who explains how to host a site on ionos 
>>>>> -- 
>>>>> theodoros17@python-developer
>>>>>
>>>> -- 
>>>> 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/80f577f9-5731-4b4b-82db-51da1e695ff1n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/django-users/80f577f9-5731-4b4b-82db-51da1e695ff1n%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...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/d7a0d0d1-03ca-4189-a5f7-af74ccd638d0n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/d7a0d0d1-03ca-4189-a5f7-af74ccd638d0n%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/c0255a82-9866-4f85-8aa4-0c6e249b5a7cn%40googlegroups.com.


Re: help me

2021-08-05 Thread Satyajit Barik
Good Morning Guys, I'm from India. I'm an open source engineer. Having 2
years of professional experience in software development.
I can help you with deploying your local application to the server.

On Wed, Aug 4, 2021 at 6:41 PM Badr Gamal  wrote:

> Good morning guys,
>
> I am new web developer and start to code with python django  framwork
>
> I only made a web site at my local machine .
>
> What i do after that to make this website published on web ?
>
> On Wednesday, July 28, 2021 at 3:43:51 PM UTC+2 skyli...@gmail.com wrote:
>
>> You can. Use name cheap, cpanel
>>
>> On Wednesday, July 28, 2021, David Crandell  wrote:
>>
>>> Try deploying to a PaaS platform like Heroku or DigitalOceans Apps
>>> service.
>>>
>>> They can be very cost effective and are an excellent way to host a
>>> Django app.
>>>
>>> On Tuesday, July 27, 2021 at 11:26:13 AM UTC-5 kossit...@gmail.com
>>> wrote:
>>>
>>>>
>>>> I need a video who explains how to host a site on ionos
>>>> --
>>>> theodoros17@python-developer
>>>>
>>> --
>>> 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/80f577f9-5731-4b4b-82db-51da1e695ff1n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/80f577f9-5731-4b4b-82db-51da1e695ff1n%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/d7a0d0d1-03ca-4189-a5f7-af74ccd638d0n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d7a0d0d1-03ca-4189-a5f7-af74ccd638d0n%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/CANd-%2BoDmT%2BE_JgVGepVrE4SZ61i7TE2n486e3c%3DTmFrRhZf_aw%40mail.gmail.com.


Re: help me

2021-08-04 Thread Badr Gamal
Good morning guys,

I am new web developer and start to code with python django  framwork

I only made a web site at my local machine .

What i do after that to make this website published on web ?

On Wednesday, July 28, 2021 at 3:43:51 PM UTC+2 skyli...@gmail.com wrote:

> You can. Use name cheap, cpanel
>
> On Wednesday, July 28, 2021, David Crandell  wrote:
>
>> Try deploying to a PaaS platform like Heroku or DigitalOceans Apps 
>> service.
>>
>> They can be very cost effective and are an excellent way to host a Django 
>> app.
>>
>> On Tuesday, July 27, 2021 at 11:26:13 AM UTC-5 kossit...@gmail.com wrote:
>>
>>>
>>> I need a video who explains how to host a site on ionos 
>>> -- 
>>> theodoros17@python-developer
>>>
>> -- 
>> 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/80f577f9-5731-4b4b-82db-51da1e695ff1n%40googlegroups.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/d7a0d0d1-03ca-4189-a5f7-af74ccd638d0n%40googlegroups.com.


Re: Can anyone help me

2021-07-28 Thread DJANGO DEVELOPER
Hi nagaraju, if you're new to django then you should go for a CRUD
functionality to understand django. you can also build a blog post web app
then you will be able to build this form by yourself. well if you don't
want to build other ideas and want to work on this form then you should
search for formsets and then you can develop the form

On Wed, Jul 28, 2021 at 10:42 PM Sebastian Jung 
wrote:

> Hello,
>
> I have start with django girls tutorial. This is a relative easy start
> with a simple app. But i think after this you are able to develop your app.
> https://tutorial.djangogirls.org/en/
>
> Regards
>
> Nagaraju Singothu  schrieb am Mi., 28. Juli
> 2021, 15:51:
>
>> Dear friends,
>>
>> I'm new to django, plz help me how to develop this page and send me the
>> source code.
>>
>> This task only using bootstrap and Django
>>
>> --
>> 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/CAMyGuAayru0Zg-imwncZasP36Ur5%3DQFLbi%2BWV8RARrN5qPfKTA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAMyGuAayru0Zg-imwncZasP36Ur5%3DQFLbi%2BWV8RARrN5qPfKTA%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/CAKGT9my3R3n5rF%2B%2Baj9DqfCN%3DkL7jmPCJd%3D612qcea5ZmNk_3g%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAKGT9my3R3n5rF%2B%2Baj9DqfCN%3DkL7jmPCJd%3D612qcea5ZmNk_3g%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/CAKPY9pkz3ShbhGJGh8Umc%2B%3DBE3y_1-tNruMBcF1y%3Dt0fMJarYQ%40mail.gmail.com.


Re: Can anyone help me

2021-07-28 Thread Sebastian Jung
Hello,

I have start with django girls tutorial. This is a relative easy start with
a simple app. But i think after this you are able to develop your app.
https://tutorial.djangogirls.org/en/

Regards

Nagaraju Singothu  schrieb am Mi., 28. Juli
2021, 15:51:

> Dear friends,
>
> I'm new to django, plz help me how to develop this page and send me the
> source code.
>
> This task only using bootstrap and Django
>
> --
> 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/CAMyGuAayru0Zg-imwncZasP36Ur5%3DQFLbi%2BWV8RARrN5qPfKTA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMyGuAayru0Zg-imwncZasP36Ur5%3DQFLbi%2BWV8RARrN5qPfKTA%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/CAKGT9my3R3n5rF%2B%2Baj9DqfCN%3DkL7jmPCJd%3D612qcea5ZmNk_3g%40mail.gmail.com.


Re: HELP

2021-07-28 Thread Sebastian Jung
Hello,

I have take a root server with 2 cores, 40 gb ssd and 6 gb ram on netcup
for 6,99€ per month. for trial is heroku good but for live systems are
netcup less expensive. You get a ssh root access to ubuntu or debian and
can setup django with this tutorial
https://dev.to/cindyachieng/-how-to-set-up-django-environment-in-linux-for-beginners-35am

Regards

Sebastian Jung  schrieb am Mi., 28. Juli 2021,
19:30:

> Hello,
>
> You need login page. Tutorial here
> https://learndjango.com/tutorials/django-login-and-logout-tutorial
>
> Regards
>
> Toure Said  schrieb am Mi., 28. Juli 2021, 18:42:
>
>> I have connection data in my mysql database and I want to connect with
>> credentials in the database using django
>>
>> --
>> 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/f6925aed-9824-42f1-894e-76f9618dceben%40googlegroups.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/CAKGT9mwJqeR_haR7Cmu97%3Dhc6kn8RC9Uwcyb4gF82dszF30UpQ%40mail.gmail.com.


Re: HELP

2021-07-28 Thread Sebastian Jung
Hello,

You need login page. Tutorial here
https://learndjango.com/tutorials/django-login-and-logout-tutorial

Regards

Toure Said  schrieb am Mi., 28. Juli 2021, 18:42:

> I have connection data in my mysql database and I want to connect with
> credentials in the database using django
>
> --
> 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/f6925aed-9824-42f1-894e-76f9618dceben%40googlegroups.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/CAKGT9mxh67Wo2KM_6FhXuDse6LkeAwE4ENxgCJGSG49Vfpsjtg%40mail.gmail.com.


HELP

2021-07-28 Thread Toure Said
I have connection data in my mysql database and I want to connect with 
credentials in the database using django

-- 
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/f6925aed-9824-42f1-894e-76f9618dceben%40googlegroups.com.


Re: Can anyone help me

2021-07-28 Thread Sharif Mehedi
Here's the django-official tutorial: 
https://docs.djangoproject.com/en/3.2/intro/tutorial01/   On Wednesday, July 
28, 2021, 8:58:25 PM GMT+6, Nagaraju Singothu  
wrote:  
 
 Sir, please send me one tutorial.

On Wed, Jul 28, 2021 at 8:04 PM Sebastian Jung  
wrote:

Hello Nagaruj,
Here in this forum you get help on specific problem but when you search a 
people how help you develop such a page then you find on upwork developer fast 
and cheap.
If you want to make it self then several tutorials exists.
Regards
Nagaraju Singothu  schrieb am Mi., 28. Juli 2021, 
15:51:

Dear friends,
I'm new to django, plz help me how to develop this page and send me the source 
code. 
This task only using bootstrap and Django 

-- 
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/CAMyGuAayru0Zg-imwncZasP36Ur5%3DQFLbi%2BWV8RARrN5qPfKTA%40mail.gmail.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/CAKGT9mynS-1huwqSq0ch%3DhpKc%3DguZ_of_FFxmB4G-EW3V8kiWA%40mail.gmail.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/CAMyGuAYB__ninjWjwSMdLwas00ds0PUpcHdrHoK84bckwb03Mg%40mail.gmail.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/128551395.674636.1627484412834%40mail.yahoo.com.


Re: Can anyone help me

2021-07-28 Thread Nagaraju Singothu
Sir, please send me one tutorial.


On Wed, Jul 28, 2021 at 8:04 PM Sebastian Jung 
wrote:

> Hello Nagaruj,
>
> Here in this forum you get help on specific problem but when you search a
> people how help you develop such a page then you find on upwork developer
> fast and cheap.
>
> If you want to make it self then several tutorials exists.
>
> Regards
>
> Nagaraju Singothu  schrieb am Mi., 28. Juli
> 2021, 15:51:
>
>> Dear friends,
>>
>> I'm new to django, plz help me how to develop this page and send me the
>> source code.
>>
>> This task only using bootstrap and Django
>>
>> --
>> 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/CAMyGuAayru0Zg-imwncZasP36Ur5%3DQFLbi%2BWV8RARrN5qPfKTA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAMyGuAayru0Zg-imwncZasP36Ur5%3DQFLbi%2BWV8RARrN5qPfKTA%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/CAKGT9mynS-1huwqSq0ch%3DhpKc%3DguZ_of_FFxmB4G-EW3V8kiWA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAKGT9mynS-1huwqSq0ch%3DhpKc%3DguZ_of_FFxmB4G-EW3V8kiWA%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/CAMyGuAYB__ninjWjwSMdLwas00ds0PUpcHdrHoK84bckwb03Mg%40mail.gmail.com.


Re: Can anyone help me

2021-07-28 Thread Sebastian Jung
Hello Nagaruj,

Here in this forum you get help on specific problem but when you search a
people how help you develop such a page then you find on upwork developer
fast and cheap.

If you want to make it self then several tutorials exists.

Regards

Nagaraju Singothu  schrieb am Mi., 28. Juli
2021, 15:51:

> Dear friends,
>
> I'm new to django, plz help me how to develop this page and send me the
> source code.
>
> This task only using bootstrap and Django
>
> --
> 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/CAMyGuAayru0Zg-imwncZasP36Ur5%3DQFLbi%2BWV8RARrN5qPfKTA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMyGuAayru0Zg-imwncZasP36Ur5%3DQFLbi%2BWV8RARrN5qPfKTA%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/CAKGT9mynS-1huwqSq0ch%3DhpKc%3DguZ_of_FFxmB4G-EW3V8kiWA%40mail.gmail.com.


Can anyone help me

2021-07-28 Thread Nagaraju Singothu
Dear friends,

I'm new to django, plz help me how to develop this page and send me the
source code.

This task only using bootstrap and Django

-- 
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/CAMyGuAayru0Zg-imwncZasP36Ur5%3DQFLbi%2BWV8RARrN5qPfKTA%40mail.gmail.com.


Re: help me

2021-07-28 Thread SKYLINE TV
You can. Use name cheap, cpanel

On Wednesday, July 28, 2021, David Crandell 
wrote:

> Try deploying to a PaaS platform like Heroku or DigitalOceans Apps service.
>
> They can be very cost effective and are an excellent way to host a Django
> app.
>
> On Tuesday, July 27, 2021 at 11:26:13 AM UTC-5 kossit...@gmail.com wrote:
>
>>
>> I need a video who explains how to host a site on ionos
>> --
>> theodoros17@python-developer
>>
> --
> 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/80f577f9-5731-4b4b-82db-51da1e695ff1n%
> 40googlegroups.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/CABoT6ifGRu6f8U%2B4rxbqdXUTDctT1u4qj_JggRSzpQy_q%2BCY6g%40mail.gmail.com.


Re: help me

2021-07-28 Thread David Crandell
Try deploying to a PaaS platform like Heroku or DigitalOceans Apps service.

They can be very cost effective and are an excellent way to host a Django 
app.

On Tuesday, July 27, 2021 at 11:26:13 AM UTC-5 kossit...@gmail.com wrote:

>
> I need a video who explains how to host a site on ionos 
> -- 
> theodoros17@python-developer
>

-- 
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/80f577f9-5731-4b4b-82db-51da1e695ff1n%40googlegroups.com.


Re: help me

2021-07-27 Thread Théodore KOSSI
Propose me a hosting that support python

Le mar. 27 juil. 2021 à 17:24, Théodore KOSSI  a
écrit :

>
> I need a video who explains how to host a site on ionos
> --
> theodoros17@python-developer
>


-- 
theodoros17@python-developer

-- 
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/CAKiMjQHUpCo-zEkmg7d%2Bo2P58Tr-v_%2BQdkX_fwVsiznsPPH4TQ%40mail.gmail.com.


help me

2021-07-27 Thread Théodore KOSSI
I need a video who explains how to host a site on ionos
-- 
theodoros17@python-developer

-- 
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/CAKiMjQFCRHAMzFmeLruWAihCLwWswGNHtu2Wejw%3D67svzG0UWQ%40mail.gmail.com.


Re : help in updating multiple objects in a single template

2021-07-16 Thread Avi shah
I have a query which returns multiple objects , so how to update those
values in a single page , currently i am only getting one form with one
object , I want all the objects and one submit button , please help

Views.py
[image: image.png]

Form
[image: image.png]

Current form loook
[image: image.png]

-- 
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/CALa7AFMeBDNFrXih8V6bZZdfbT8dK3Cp0BBpqqz-JPgdwX79Dg%40mail.gmail.com.


Re: Looking for help to add quantity field in my food ordering project

2021-07-16 Thread Derek
>From your Order model, it seems that all the user would need to do is 
supply the value of "count" representing multiples of one item in a single 
order.

On Thursday, 15 July 2021 at 15:35:37 UTC+2 tiwar...@gmail.com wrote:

> Hello community!
> I hope you all are in best health. I've been working on developing a food 
> ordering site in Django, pretty much of the work is done, but I can't 
> figure out how to let a user select multiple quantity of a same item in a 
> single order. 
> The code is available on GitHub 
> <https://github.com/tiwari1302/EasyOrders/tree/master> and to add the 
> quantity feature, there are two more active branches on the site.
> Since it is only my second Django project, I really wish it gets completed.
> If you feel you can help, please let me know.
> Any kind of help will be highly appreciable.
> Thanks!
>

-- 
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/7a36ed5a-88af-4287-92ef-c7008b0fd87bn%40googlegroups.com.


Re: Help me for user connection message error

2021-07-16 Thread Théodore KOSSI
thanks you very much for your attention. I have already fund it


Le ven. 16 juil. 2021 à 04:04, Gabriel Araya Garcia <
gabrielaraya2...@gmail.com> a écrit :

> How? with a message. It's very simple.
> It's is in authentication page that you had build.
>
>
> Gabriel Araya Garcia
> GMI - Desarrollo de Sistemas Informáticos
>
>
>
>
> El jue, 15 jul 2021 a las 14:04, Kasper Laudrup ()
> escribió:
>
>> On 15/07/2021 19.14, Théodore KOSSI wrote:
>> >
>> > I want to know how to transmit an error message when user try to
>> connect
>>
>> That's very simple. Just make sure there's nothing the user can connect
>> to, then the user will get an error message. You don't even have to
>> transmit anything.
>>
>> If that's not what you mean, try to describe what you're trying to
>> achieve a bit more in detail.
>>
>> Kind regards,
>>
>> Kasper Laudrup
>>
>> --
>> 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/04798171-8bd3-004d-f4c0-d0ccb0d70c84%40stacktrace.dk
>> .
>>
> --
> 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/CAKVvSDB%3DDR9hjro4MHoFvVwj0sSHTeTM%3DSVPdGvfqxgXjS-7xg%40mail.gmail.com
> 
> .
>


-- 
theodoros17@python-developer

-- 
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/CAKiMjQH_2FQHHe5XvnYP2EM%2BV%2Bzcmf8HVQzTLpMTZEwCAJxXCw%40mail.gmail.com.


Re: Help me for user connection message error

2021-07-15 Thread Gabriel Araya Garcia
How? with a message. It's very simple.
It's is in authentication page that you had build.


Gabriel Araya Garcia
GMI - Desarrollo de Sistemas Informáticos




El jue, 15 jul 2021 a las 14:04, Kasper Laudrup ()
escribió:

> On 15/07/2021 19.14, Théodore KOSSI wrote:
> >
> > I want to know how to transmit an error message when user try to connect
>
> That's very simple. Just make sure there's nothing the user can connect
> to, then the user will get an error message. You don't even have to
> transmit anything.
>
> If that's not what you mean, try to describe what you're trying to
> achieve a bit more in detail.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/04798171-8bd3-004d-f4c0-d0ccb0d70c84%40stacktrace.dk
> .
>

-- 
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/CAKVvSDB%3DDR9hjro4MHoFvVwj0sSHTeTM%3DSVPdGvfqxgXjS-7xg%40mail.gmail.com.


Re: Help me for user connection message error

2021-07-15 Thread Kasper Laudrup
On 15/07/2021 19.14, Théodore KOSSI wrote:
> 
> I want to know how to transmit an error message when user try to connect 

That's very simple. Just make sure there's nothing the user can connect
to, then the user will get an error message. You don't even have to
transmit anything.

If that's not what you mean, try to describe what you're trying to
achieve a bit more in detail.

Kind regards,

Kasper Laudrup

-- 
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/04798171-8bd3-004d-f4c0-d0ccb0d70c84%40stacktrace.dk.


OpenPGP_signature
Description: OpenPGP digital signature


Help me for user connection message error

2021-07-15 Thread Théodore KOSSI
I want to know how to transmit an error message when user try to connect
theodoros17@python-developer

-- 
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/CAKiMjQFm0%2Bht9%2B7usRF96%2BwRReOywZB-HsjHKDB4vubA9KZ1rw%40mail.gmail.com.


Looking for help to add quantity field in my food ordering project

2021-07-15 Thread Shashank Tiwari
Hello community!
I hope you all are in best health. I've been working on developing a food 
ordering site in Django, pretty much of the work is done, but I can't 
figure out how to let a user select multiple quantity of a same item in a 
single order. 
The code is available on GitHub 
<https://github.com/tiwari1302/EasyOrders/tree/master> and to add the 
quantity feature, there are two more active branches on the site.
Since it is only my second Django project, I really wish it gets completed.
If you feel you can help, please let me know.
Any kind of help will be highly appreciable.
Thanks!

-- 
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/2f830df0-1ef0-4b0e-bb89-ae2978734697n%40googlegroups.com.


Re: Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-09 Thread Tree Chip Net
let suppose I have 2 models:
*class String(models.model):*
*string = models.textarea(null = True, blank = True)*
*user = models.ForeignKey(user, on_delete=models.CASCADE)*
*def __str__(self):*
*return self.string*

and


*class Song_Words_Count(models.model):*
*song = models.ForeignKey(user, on_delete=models.SET_NULL)*
*def __str__(self):*
*return self.song*

now what I want to do at django admin side that the string added in
* "String" *model should be saved in Song_Wors_count model and string
should be splitted in a single word and frequency should be counted this
way:

word word_freq
word1 10
word2 15
word3 20

I need Urgent help please.

Em qui, 8 de jul de 2021 18:51, DJANGO DEVELOPER 
escreveu:

> let suppose I have 2 models:
> *class String(models.model):*
> *string = models.textarea(null = True, blank = True)*
> *user = models.ForeignKey(user, on_delete=models.CASCADE)*
> *def __str__(self):*
> *return self.string*
>
> and
>
>
> *class Song_Words_Count(models.model):*
> *song = models.ForeignKey(user, on_delete=models.SET_NULL)*
> *def __str__(self):*
> *return self.song*
>
> now what I want to do at django admin side that the string added in*
> "String" *model should be saved in Song_Wors_count model and string
> should be splitted in a single word and frequency should be counted this
> way:
>
> word word_freq
> word1 10
> word2 15
> word3 20
>
> I need Urgent help please.
>
> --
> 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/f53fc668-ca86-4c51-8d4c-673dee3d180cn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f53fc668-ca86-4c51-8d4c-673dee3d180cn%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/CAMMKRYzrKLwfJdz4LpmeRG6%2BWRffdADH%3D4_VRC_rOnuw%3DthYSQ%40mail.gmail.com.


Re: Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-09 Thread DJANGO DEVELOPER
hi Sebastian, do you know how can I resolve my problem? I want to count
same words in a string. after splitting it

On Fri, Jul 9, 2021 at 10:14 PM DJANGO DEVELOPER 
wrote:

> Hi Peter, thanks for your reply. Sorry I have m2m relationship of User
> model with Song model and I am using m2m_changes signal for it but still
> not giving me the desired output.
>
> On Fri, Jul 9, 2021 at 9:20 PM Sebastian Jung 
> wrote:
>
>> Hello Peter,
>>
>> ich would make it with a signal.
>>
>> Here a another example to use a post save signal:
>>
>> from django.db.models.signals import post_savefrom django.dispatch import 
>> receiver
>> class TransactionDetail(models.Model):
>> product = models.ForeignKey(Product)
>> # method for updating@receiver(post_save, sender=TransactionDetail, 
>> dispatch_uid="update_stock_count")def update_stock(sender, instance, 
>> **kwargs):
>> instance.product.stock -= instance.amount
>> instance.product.save()
>>
>>
>> Please write me if you don't understand these example.
>>
>>
>> P.S. i have no idea why you have a foreignkey relation. Why you save words 
>> not in another column in String class?
>>
>> Regards
>>
>>
>> Am Fr., 9. Juli 2021 um 17:30 Uhr schrieb 'Peter van der Does' via Django
>> users :
>>
>>> Overwrite the save method on the String model and when you hit save you
>>> split and save the words in the S_W_C model. This does mean when you update
>>> the String record all the words are added to the S_W_C model as well, as
>>> there is no correlation between the two model you don't know if that String
>>> was already counted.
>>> On 7/8/21 10:26 PM, DJANGO DEVELOPER wrote:
>>>
>>> is there anyone who can help me here?
>>>
>>> On Fri, Jul 9, 2021 at 2:51 AM DJANGO DEVELOPER 
>>> wrote:
>>>
>>>> let suppose I have 2 models:
>>>> *class String(models.model):*
>>>> *string = models.textarea(null = True, blank = True)*
>>>> *user = models.ForeignKey(user, on_delete=models.CASCADE)*
>>>> *def __str__(self):*
>>>> *return self.string*
>>>>
>>>> and
>>>>
>>>>
>>>> *class Song_Words_Count(models.model):*
>>>> *    song = models.ForeignKey(user, on_delete=models.SET_NULL)*
>>>> *def __str__(self):*
>>>> *return self.song*
>>>>
>>>> now what I want to do at django admin side that the string added in*
>>>> "String" *model should be saved in Song_Wors_count model and string
>>>> should be splitted in a single word and frequency should be counted this
>>>> way:
>>>>
>>>> word word_freq
>>>> word1 10
>>>> word2 15
>>>> word3 20
>>>>
>>>> I need Urgent help please.
>>>> --
>>>> 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/f53fc668-ca86-4c51-8d4c-673dee3d180cn%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/f53fc668-ca86-4c51-8d4c-673dee3d180cn%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/CAKPY9pkPqSbN0OoxVyQ%2BYcfqq2fRX1NDWqpdyo-KmOG2X_vYeQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAKPY9pkPqSbN0OoxVyQ%2BYcfqq2fRX1NDWqpdyo-KmOG2X_vYeQ%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>>> --
>>>
>>> *Peter van der Does o: **410-584-2500*
>>> * m: 732-425-3102 ONeil Interactive, Inc  oneilinteractive.com
>>> <http://www.oneilinteractive.com/> *
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from th

Re: Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-09 Thread DJANGO DEVELOPER
Hi Peter, thanks for your reply. Sorry I have m2m relationship of User
model with Song model and I am using m2m_changes signal for it but still
not giving me the desired output.

On Fri, Jul 9, 2021 at 9:20 PM Sebastian Jung 
wrote:

> Hello Peter,
>
> ich would make it with a signal.
>
> Here a another example to use a post save signal:
>
> from django.db.models.signals import post_savefrom django.dispatch import 
> receiver
> class TransactionDetail(models.Model):
> product = models.ForeignKey(Product)
> # method for updating@receiver(post_save, sender=TransactionDetail, 
> dispatch_uid="update_stock_count")def update_stock(sender, instance, 
> **kwargs):
> instance.product.stock -= instance.amount
> instance.product.save()
>
>
> Please write me if you don't understand these example.
>
>
> P.S. i have no idea why you have a foreignkey relation. Why you save words 
> not in another column in String class?
>
> Regards
>
>
> Am Fr., 9. Juli 2021 um 17:30 Uhr schrieb 'Peter van der Does' via Django
> users :
>
>> Overwrite the save method on the String model and when you hit save you
>> split and save the words in the S_W_C model. This does mean when you update
>> the String record all the words are added to the S_W_C model as well, as
>> there is no correlation between the two model you don't know if that String
>> was already counted.
>> On 7/8/21 10:26 PM, DJANGO DEVELOPER wrote:
>>
>> is there anyone who can help me here?
>>
>> On Fri, Jul 9, 2021 at 2:51 AM DJANGO DEVELOPER 
>> wrote:
>>
>>> let suppose I have 2 models:
>>> *class String(models.model):*
>>> *string = models.textarea(null = True, blank = True)*
>>> *user = models.ForeignKey(user, on_delete=models.CASCADE)*
>>> *def __str__(self):*
>>> *return self.string*
>>>
>>> and
>>>
>>>
>>> *class Song_Words_Count(models.model):*
>>> *song = models.ForeignKey(user, on_delete=models.SET_NULL)*
>>> *def __str__(self):*
>>> *return self.song*
>>>
>>> now what I want to do at django admin side that the string added in*
>>> "String" *model should be saved in Song_Wors_count model and string
>>> should be splitted in a single word and frequency should be counted this
>>> way:
>>>
>>> word word_freq
>>> word1 10
>>> word2 15
>>> word3 20
>>>
>>> I need Urgent help please.
>>> --
>>> 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/f53fc668-ca86-4c51-8d4c-673dee3d180cn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/f53fc668-ca86-4c51-8d4c-673dee3d180cn%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/CAKPY9pkPqSbN0OoxVyQ%2BYcfqq2fRX1NDWqpdyo-KmOG2X_vYeQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAKPY9pkPqSbN0OoxVyQ%2BYcfqq2fRX1NDWqpdyo-KmOG2X_vYeQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>> --
>>
>> *Peter van der Does o: **410-584-2500*
>> * m: 732-425-3102 ONeil Interactive, Inc  oneilinteractive.com
>> <http://www.oneilinteractive.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/3921f39e-60d9-0e67-87ff-c8684bafc8f4%40oneilinteractive.com
>> <https://groups.google.com/d/msgid/django-users/3921f39e-60d9-0e67-87ff-c8684bafc8f4%40oneilinteractive.com?utm_medium=email_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from t

Re: Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-09 Thread Sebastian Jung
Hello Peter,

ich would make it with a signal.

Here a another example to use a post save signal:

from django.db.models.signals import post_savefrom django.dispatch
import receiver
class TransactionDetail(models.Model):
product = models.ForeignKey(Product)
# method for updating@receiver(post_save, sender=TransactionDetail,
dispatch_uid="update_stock_count")def update_stock(sender, instance,
**kwargs):
instance.product.stock -= instance.amount
instance.product.save()


Please write me if you don't understand these example.


P.S. i have no idea why you have a foreignkey relation. Why you save
words not in another column in String class?

Regards


Am Fr., 9. Juli 2021 um 17:30 Uhr schrieb 'Peter van der Does' via Django
users :

> Overwrite the save method on the String model and when you hit save you
> split and save the words in the S_W_C model. This does mean when you update
> the String record all the words are added to the S_W_C model as well, as
> there is no correlation between the two model you don't know if that String
> was already counted.
> On 7/8/21 10:26 PM, DJANGO DEVELOPER wrote:
>
> is there anyone who can help me here?
>
> On Fri, Jul 9, 2021 at 2:51 AM DJANGO DEVELOPER 
> wrote:
>
>> let suppose I have 2 models:
>> *class String(models.model):*
>> *string = models.textarea(null = True, blank = True)*
>> *user = models.ForeignKey(user, on_delete=models.CASCADE)*
>> *def __str__(self):*
>> *return self.string*
>>
>> and
>>
>>
>> *class Song_Words_Count(models.model):*
>> *song = models.ForeignKey(user, on_delete=models.SET_NULL)*
>> *def __str__(self):*
>> *return self.song*
>>
>> now what I want to do at django admin side that the string added in*
>> "String" *model should be saved in Song_Wors_count model and string
>> should be splitted in a single word and frequency should be counted this
>> way:
>>
>> word word_freq
>> word1 10
>> word2 15
>> word3 20
>>
>> I need Urgent help please.
>> --
>> 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/f53fc668-ca86-4c51-8d4c-673dee3d180cn%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/f53fc668-ca86-4c51-8d4c-673dee3d180cn%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/CAKPY9pkPqSbN0OoxVyQ%2BYcfqq2fRX1NDWqpdyo-KmOG2X_vYeQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAKPY9pkPqSbN0OoxVyQ%2BYcfqq2fRX1NDWqpdyo-KmOG2X_vYeQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> --
>
> *Peter van der Does o: **410-584-2500*
> * m: 732-425-3102 ONeil Interactive, Inc  oneilinteractive.com
> <http://www.oneilinteractive.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/3921f39e-60d9-0e67-87ff-c8684bafc8f4%40oneilinteractive.com
> <https://groups.google.com/d/msgid/django-users/3921f39e-60d9-0e67-87ff-c8684bafc8f4%40oneilinteractive.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/CAKGT9mzRGUFn4%3D29wi%2BZc%2BgosXhpuKMmjXRcefx2ZCnDOoQc4w%40mail.gmail.com.


Re: Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-09 Thread Tech Cue
 *class String(models.model):*

*string = models.textarea(null = True, blank = True)*
> *user = models.ForeignKey(user, on_delete=models.CASCADE)*
> *def __str__(self):*
> *return self.string*
>
*class Song_Words_Count(models.model):*
> *song = models.ForeignKey(user, on_delete=models.SET_NULL)*
>



> *def __str__(self):*
> *return self.song*
>


https://docs.djangoproject.com/en/3.2/topics/db/queries/

On Fri, Jul 9, 2021 at 4:31 PM 'Peter van der Does' via Django users <
django-users@googlegroups.com> wrote:

> Overwrite the save method on the String model and when you hit save you
> split and save the words in the S_W_C model. This does mean when you update
> the String record all the words are added to the S_W_C model as well, as
> there is no correlation between the two model you don't know if that String
> was already counted.
> On 7/8/21 10:26 PM, DJANGO DEVELOPER wrote:
>
> is there anyone who can help me here?
>
> On Fri, Jul 9, 2021 at 2:51 AM DJANGO DEVELOPER 
> wrote:
>
>> let suppose I have 2 models:
>> *class String(models.model):*
>> *string = models.textarea(null = True, blank = True)*
>> *user = models.ForeignKey(user, on_delete=models.CASCADE)*
>> *def __str__(self):*
>> *return self.string*
>>
>> and
>>
>>
>> *class Song_Words_Count(models.model):*
>> *song = models.ForeignKey(user, on_delete=models.SET_NULL)*
>> *def __str__(self):*
>> *return self.song*
>>
>> now what I want to do at django admin side that the string added in*
>> "String" *model should be saved in Song_Wors_count model and string
>> should be splitted in a single word and frequency should be counted this
>> way:
>>
>> word word_freq
>> word1 10
>> word2 15
>> word3 20
>>
>> I need Urgent help please.
>> --
>> 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/f53fc668-ca86-4c51-8d4c-673dee3d180cn%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/f53fc668-ca86-4c51-8d4c-673dee3d180cn%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/CAKPY9pkPqSbN0OoxVyQ%2BYcfqq2fRX1NDWqpdyo-KmOG2X_vYeQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAKPY9pkPqSbN0OoxVyQ%2BYcfqq2fRX1NDWqpdyo-KmOG2X_vYeQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> --
>
> *Peter van der Does o: **410-584-2500*
> * m: 732-425-3102 ONeil Interactive, Inc  oneilinteractive.com
> <http://www.oneilinteractive.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/3921f39e-60d9-0e67-87ff-c8684bafc8f4%40oneilinteractive.com
> <https://groups.google.com/d/msgid/django-users/3921f39e-60d9-0e67-87ff-c8684bafc8f4%40oneilinteractive.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/CACQGpNnOUgSBL1%2BsK6w3cJuyWw8vgAWzJZq%3D6GPGDjSsOnOLdQ%40mail.gmail.com.


Re: Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-09 Thread 'Peter van der Does' via Django users
Overwrite the save method on the String model and when you hit save you
split and save the words in the S_W_C model. This does mean when you
update the String record all the words are added to the S_W_C model as
well, as there is no correlation between the two model you don't know if
that String was already counted.

On 7/8/21 10:26 PM, DJANGO DEVELOPER wrote:
> is there anyone who can help me here?
>
> On Fri, Jul 9, 2021 at 2:51 AM DJANGO DEVELOPER
> mailto:abubakarbr...@gmail.com>> wrote:
>
> let suppose I have 2 models:
> *class String(models.model):*
> *    string = models.textarea(null = True, blank = True)*
> *    user = models.ForeignKey(user, on_delete=models.CASCADE)*
> *    def __str__(self):*
> *        return self.string*
>
> and
>
>
> *class Song_Words_Count(models.model):*
> *    song = models.ForeignKey(user, on_delete=models.SET_NULL)*
> *    def __str__(self):*
> *        return self.song*
>
> now what I want to do at django admin side that the string added
> in*"String" *model should be saved in Song_Wors_count model and
> string should be splitted in a single word and frequency should be
> counted this way:
>
> word word_freq
> word1 10
> word2 15
> word3 20
>
> I need Urgent help please.
> -- 
> 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
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit
> 
> https://groups.google.com/d/msgid/django-users/f53fc668-ca86-4c51-8d4c-673dee3d180cn%40googlegroups.com
> 
> <https://groups.google.com/d/msgid/django-users/f53fc668-ca86-4c51-8d4c-673dee3d180cn%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
> <mailto:django-users+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKPY9pkPqSbN0OoxVyQ%2BYcfqq2fRX1NDWqpdyo-KmOG2X_vYeQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAKPY9pkPqSbN0OoxVyQ%2BYcfqq2fRX1NDWqpdyo-KmOG2X_vYeQ%40mail.gmail.com?utm_medium=email_source=footer>.
-- 
*Peter van der Does
o: ***410-584-2500
m: 732-425-3102
*ONeil Interactive, Inc *
oneilinteractive.com <http://www.oneilinteractive.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/3921f39e-60d9-0e67-87ff-c8684bafc8f4%40oneilinteractive.com.


Re: Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-08 Thread DJANGO DEVELOPER
is there anyone who can help me here?

On Fri, Jul 9, 2021 at 2:51 AM DJANGO DEVELOPER 
wrote:

> let suppose I have 2 models:
> *class String(models.model):*
> *string = models.textarea(null = True, blank = True)*
> *user = models.ForeignKey(user, on_delete=models.CASCADE)*
> *def __str__(self):*
> *return self.string*
>
> and
>
>
> *class Song_Words_Count(models.model):*
> *song = models.ForeignKey(user, on_delete=models.SET_NULL)*
> *def __str__(self):*
> *return self.song*
>
> now what I want to do at django admin side that the string added in*
> "String" *model should be saved in Song_Wors_count model and string
> should be splitted in a single word and frequency should be counted this
> way:
>
> word word_freq
> word1 10
> word2 15
> word3 20
>
> I need Urgent help please.
>
> --
> 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/f53fc668-ca86-4c51-8d4c-673dee3d180cn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f53fc668-ca86-4c51-8d4c-673dee3d180cn%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/CAKPY9pkPqSbN0OoxVyQ%2BYcfqq2fRX1NDWqpdyo-KmOG2X_vYeQ%40mail.gmail.com.


Django help| Urgent | how to find the frequency of a string for each word using django admin?

2021-07-08 Thread DJANGO DEVELOPER
let suppose I have 2 models:
*class String(models.model):*
*string = models.textarea(null = True, blank = True)*
*user = models.ForeignKey(user, on_delete=models.CASCADE)*
*def __str__(self):*
*return self.string*

and


*class Song_Words_Count(models.model):*
*song = models.ForeignKey(user, on_delete=models.SET_NULL)*
*def __str__(self):*
*return self.song*

now what I want to do at django admin side that the string added in* 
"String" *model should be saved in Song_Wors_count model and string should 
be splitted in a single word and frequency should be counted this way:

word word_freq
word1 10
word2 15
word3 20

I need Urgent help please.

-- 
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/f53fc668-ca86-4c51-8d4c-673dee3d180cn%40googlegroups.com.


Re: Django Help | Counting word frequency in Django using dictionary.

2021-07-07 Thread Lalit Suthar
you can try moving to postgres if possible

On Wed, 7 Jul 2021 at 10:28, DJANGO DEVELOPER 
wrote:

> I am using sqlite3. so only needs to store the data in django
> admin/database but in the form of dictionary or in the form of counted
> words.
>
> On Wed, Jul 7, 2021 at 9:09 AM Lalit Suthar 
> wrote:
>
>> you can use postgres JsonField
>> https://docs.djangoproject.com/en/3.2/ref/contrib/postgres/fields/#jsonfield
>>
>> On Wed, 7 Jul 2021 at 06:05, DJANGO DEVELOPER 
>> wrote:
>>
>>> Hi
>>>  I am developing a django project and I want to count word frequency at
>>> the django admin side.
>>> Means a word is repeating in a string should be counted and be saved in
>>> the database only.
>>> I have managed to do it on front-end side but now I also want to do it
>>> on django admin side.
>>> example: any_string = {'word1': 12,'word2': 29}
>>> this the example because I want to get the data this way. word1 is there
>>> for 12 times in a string and same is the case for word2.
>>> so I need help and your help would be appreciated.
>>> thanks.
>>>
>>> --
>>> 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/672d9b02-382e-4b79-bcaf-6b618b514c28n%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/672d9b02-382e-4b79-bcaf-6b618b514c28n%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/CAGp2JVEM2mq8EPokL9KwU3OGz%2BgaJf%3DgMALZbVa%3DdsEeW1WGiw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAGp2JVEM2mq8EPokL9KwU3OGz%2BgaJf%3DgMALZbVa%3DdsEeW1WGiw%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/CAKPY9pmAPnbeEvgL1%3DHdid7yZ_BgF-b34AVKr-n3-bDvcTmgjw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAKPY9pmAPnbeEvgL1%3DHdid7yZ_BgF-b34AVKr-n3-bDvcTmgjw%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/CAGp2JVG%3Dus9DPyGgUnA5eEe1JVotrOGHHje0h-oXfE8k%2B0L9SQ%40mail.gmail.com.


Re: hello i need a help

2021-07-07 Thread Richard Dushime
thank you but i wanted to send all the 4 fields and the "to" arguments  how
can i do it? .. its submission form data i tried to loook into the
documentation everywhere they used 3 fields only

On Mon, Jul 5, 2021 at 10:04 PM sum abiut  wrote:

> The error message is very clear send_mass_mail only expect  4 values but
> you are passing in more than four.
> You should only pass in four values.
>
> datatuple = (
> ('f_subject', 'f_message','f_email',
> ['mygm...@gmail.com']),
> # second person
> ('f_subject', 'f_message','f_email',
> ['sec...@gmail.com'])
> )
>
>
> send_mass_mail(datatuple)
>
>
> refer to the documentations
> 
>
>
> On Tue, Jul 6, 2021 at 3:14 AM Richard Dushime 
> wrote:
>
>> i am getting this error down  when trying to submit  my form data to
>> email {{ ValueError at /contact
>>
>> too many values to unpack (expected 4)
>>
>> Request Method: POST
>> Request URL: http://localhost:8000/contact
>> Django Version: 3.2.4
>> Exception Type: ValueError
>> Exception Value:
>>
>> too many values to unpack (expected 4)
>>
>> Exception Location:
>> C:\Users\RDM\Envs\env\lib\site-packages\django\core\mail\__init__.py,
>> line 83, in 
>> Python Executable: C:\Users\RDM\Envs\env\Scripts\python.exe
>> Python Version: 3.9.6
>> Python Path:
>>
>> ['C:\\Users\\RDM\\Desktop\\Web\\KVC\\KVC',
>>  'c:\\users\\rdm\\appdata\\local\\programs\\python\\python39\\python39.zip',
>>  'c:\\users\\rdm\\appdata\\local\\programs\\python\\python39\\DLLs',
>>  'c:\\users\\rdm\\appdata\\local\\programs\\python\\python39\\lib',
>>  'c:\\users\\rdm\\appdata\\local\\programs\\python\\python39',
>>  'C:\\Users\\RDM\\Envs\\env',
>>  'C:\\Users\\RDM\\Envs\\env\\lib\\site-packages']
>>
>>
>>
>> Mon, 05 Jul 2021 15:04:30 +00
>> }}}
>>
>>
>> my settings
>> EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
>> EMAIL_HOST = 'smtp.gmail.com'
>> EMAIL_PORT = '587'
>> EMAIL_HOST_USER = 'myacco...@gmail.com'
>> EMAIL_HOST_PASSWORD = 'almxfemqayldytab'
>> EMAIL_USE_TLS = True
>>
>> here is my views.py
>>
>> def contact(request):
>> if request.method == 'POST':
>> f_name = request.POST['name']
>> f_email = request.POST['email']
>> f_subject = request.POST['subject']
>> f_message = request.POST['message']
>>
>> # send mail function
>> datatuple = (
>> ('f_name','f_subject', 'f_message','f_email',
>> ['mygm...@gmail.com']),
>> # second person
>> ('f_name','f_subject', 'f_message','f_email',
>> ['sec...@gmail.com'])
>> )
>> send_mass_mail(datatuple)
>>
>> if send_mass_mail(datatuple):
>> messages.info(request,'thank you for contacting us')
>> return redirect('contact')
>> else:
>> messages.info(request, 'try again sorry for inconveniency')
>> return redirect('contact')
>> else:
>> messages.info(request, 'try again sorry for inconveniency')
>> return redirect('contact')
>>
>>
>>
>>
>> here down urls.py
>>
>> path("contact", views.contact, name="contact"),
>>
>> then my form html
>>
>>
>>  > "php-email-form" data-aos="fade-left">
>>   {% csrf_token %}
>>   
>> 
>>   > "name" placeholder="Your Name" data-rule="minlen:4" data-msg=
>> "Please enter at least 4 chars" />
>>   
>> 
>> 
>>   > id="email" placeholder="Your Email" data-rule="email" data-msg=
>> "Please enter a valid email" />
>>   
>> 
>>   
>>   
>> > ="subject" placeholder="Subject" data-rule="minlen:4" data-msg=
>> "Please enter at least 8 chars of subject" />
>> 
>>   
>>   
>> > data-rule="required" data-msg="Please write something for us" placeholder
>> ="Message">
>> 
>>   
>>   
>> {% for fmessage in messages %}
>> {{fmessage}}> >
>> {% endfor %}
>>   
>>   > >Send Message
>> 
>>
>>   
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> --
>> 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/CAJCm56LAbJHrbNFworRZsuD-hP5Gok6wH%2BvQw1NgQuwAJ9_S4w%40mail.gmail.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 

Re: Django Help | Counting word frequency in Django using dictionary.

2021-07-06 Thread DJANGO DEVELOPER
I am using sqlite3. so only needs to store the data in django
admin/database but in the form of dictionary or in the form of counted
words.

On Wed, Jul 7, 2021 at 9:09 AM Lalit Suthar 
wrote:

> you can use postgres JsonField
> https://docs.djangoproject.com/en/3.2/ref/contrib/postgres/fields/#jsonfield
>
> On Wed, 7 Jul 2021 at 06:05, DJANGO DEVELOPER 
> wrote:
>
>> Hi
>>  I am developing a django project and I want to count word frequency at
>> the django admin side.
>> Means a word is repeating in a string should be counted and be saved in
>> the database only.
>> I have managed to do it on front-end side but now I also want to do it on
>> django admin side.
>> example: any_string = {'word1': 12,'word2': 29}
>> this the example because I want to get the data this way. word1 is there
>> for 12 times in a string and same is the case for word2.
>> so I need help and your help would be appreciated.
>> thanks.
>>
>> --
>> 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/672d9b02-382e-4b79-bcaf-6b618b514c28n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/672d9b02-382e-4b79-bcaf-6b618b514c28n%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/CAGp2JVEM2mq8EPokL9KwU3OGz%2BgaJf%3DgMALZbVa%3DdsEeW1WGiw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAGp2JVEM2mq8EPokL9KwU3OGz%2BgaJf%3DgMALZbVa%3DdsEeW1WGiw%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/CAKPY9pmAPnbeEvgL1%3DHdid7yZ_BgF-b34AVKr-n3-bDvcTmgjw%40mail.gmail.com.


Re: Django Help | Counting word frequency in Django using dictionary.

2021-07-06 Thread Lalit Suthar
you can use postgres JsonField
https://docs.djangoproject.com/en/3.2/ref/contrib/postgres/fields/#jsonfield

On Wed, 7 Jul 2021 at 06:05, DJANGO DEVELOPER 
wrote:

> Hi
>  I am developing a django project and I want to count word frequency at
> the django admin side.
> Means a word is repeating in a string should be counted and be saved in
> the database only.
> I have managed to do it on front-end side but now I also want to do it on
> django admin side.
> example: any_string = {'word1': 12,'word2': 29}
> this the example because I want to get the data this way. word1 is there
> for 12 times in a string and same is the case for word2.
> so I need help and your help would be appreciated.
> thanks.
>
> --
> 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/672d9b02-382e-4b79-bcaf-6b618b514c28n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/672d9b02-382e-4b79-bcaf-6b618b514c28n%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/CAGp2JVEM2mq8EPokL9KwU3OGz%2BgaJf%3DgMALZbVa%3DdsEeW1WGiw%40mail.gmail.com.


Django Help | Counting word frequency in Django using dictionary.

2021-07-06 Thread DJANGO DEVELOPER
Hi
 I am developing a django project and I want to count word frequency at the 
django admin side.
Means a word is repeating in a string should be counted and be saved in the 
database only.
I have managed to do it on front-end side but now I also want to do it on 
django admin side.
example: any_string = {'word1': 12,'word2': 29}
this the example because I want to get the data this way. word1 is there 
for 12 times in a string and same is the case for word2.
so I need help and your help would be appreciated.
thanks.

-- 
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/672d9b02-382e-4b79-bcaf-6b618b514c28n%40googlegroups.com.


Re: hello i need a help

2021-07-05 Thread sum abiut
The error message is very clear send_mass_mail only expect  4 values but
you are passing in more than four.
You should only pass in four values.

datatuple = (
('f_subject', 'f_message','f_email',
['mygm...@gmail.com']),
# second person
('f_subject', 'f_message','f_email',
['sec...@gmail.com'])
)


send_mass_mail(datatuple)


refer to the documentations



On Tue, Jul 6, 2021 at 3:14 AM Richard Dushime 
wrote:

> i am getting this error down  when trying to submit  my form data to email
> {{ ValueError at /contact
>
> too many values to unpack (expected 4)
>
> Request Method: POST
> Request URL: http://localhost:8000/contact
> Django Version: 3.2.4
> Exception Type: ValueError
> Exception Value:
>
> too many values to unpack (expected 4)
>
> Exception Location:
> C:\Users\RDM\Envs\env\lib\site-packages\django\core\mail\__init__.py,
> line 83, in 
> Python Executable: C:\Users\RDM\Envs\env\Scripts\python.exe
> Python Version: 3.9.6
> Python Path:
>
> ['C:\\Users\\RDM\\Desktop\\Web\\KVC\\KVC',
>  'c:\\users\\rdm\\appdata\\local\\programs\\python\\python39\\python39.zip',
>  'c:\\users\\rdm\\appdata\\local\\programs\\python\\python39\\DLLs',
>  'c:\\users\\rdm\\appdata\\local\\programs\\python\\python39\\lib',
>  'c:\\users\\rdm\\appdata\\local\\programs\\python\\python39',
>  'C:\\Users\\RDM\\Envs\\env',
>  'C:\\Users\\RDM\\Envs\\env\\lib\\site-packages']
>
>
>
> Mon, 05 Jul 2021 15:04:30 +00
> }}}
>
>
> my settings
> EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
> EMAIL_HOST = 'smtp.gmail.com'
> EMAIL_PORT = '587'
> EMAIL_HOST_USER = 'myacco...@gmail.com'
> EMAIL_HOST_PASSWORD = 'almxfemqayldytab'
> EMAIL_USE_TLS = True
>
> here is my views.py
>
> def contact(request):
> if request.method == 'POST':
> f_name = request.POST['name']
> f_email = request.POST['email']
> f_subject = request.POST['subject']
> f_message = request.POST['message']
>
> # send mail function
> datatuple = (
> ('f_name','f_subject', 'f_message','f_email',
> ['mygm...@gmail.com']),
> # second person
> ('f_name','f_subject', 'f_message','f_email',
> ['sec...@gmail.com'])
> )
> send_mass_mail(datatuple)
>
> if send_mass_mail(datatuple):
> messages.info(request,'thank you for contacting us')
> return redirect('contact')
> else:
> messages.info(request, 'try again sorry for inconveniency')
> return redirect('contact')
> else:
> messages.info(request, 'try again sorry for inconveniency')
> return redirect('contact')
>
>
>
>
> here down urls.py
>
> path("contact", views.contact, name="contact"),
>
> then my form html
>
>
>   "php-email-form" data-aos="fade-left">
>   {% csrf_token %}
>   
> 
>"name" placeholder="Your Name" data-rule="minlen:4" data-msg=
> "Please enter at least 4 chars" />
>   
> 
> 
>="email" placeholder="Your Email" data-rule="email" data-msg=
> "Please enter a valid email" />
>   
> 
>   
>   
>  "subject" placeholder="Subject" data-rule="minlen:4" data-msg=
> "Please enter at least 8 chars of subject" />
> 
>   
>   
>  data-rule="required" data-msg="Please write something for us" placeholder=
> "Message">
> 
>   
>   
> {% for fmessage in messages %}
> {{fmessage}}
> {% endfor %}
>   
>   
> Send Message
> 
>
>   
>
>
>
>
>
>
>
>
>
> --
> 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/CAJCm56LAbJHrbNFworRZsuD-hP5Gok6wH%2BvQw1NgQuwAJ9_S4w%40mail.gmail.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/CAPCf-y5CENT4WAmjvd2SJaLy5t8rTv_kncYn0o%3DD7uX8hjporA%40mail.gmail.com.


hello i need a help

2021-07-05 Thread Richard Dushime
i am getting this error down  when trying to submit  my form data to email
{{ ValueError at /contact

too many values to unpack (expected 4)

Request Method: POST
Request URL: http://localhost:8000/contact
Django Version: 3.2.4
Exception Type: ValueError
Exception Value:

too many values to unpack (expected 4)

Exception Location:
C:\Users\RDM\Envs\env\lib\site-packages\django\core\mail\__init__.py, line
83, in 
Python Executable: C:\Users\RDM\Envs\env\Scripts\python.exe
Python Version: 3.9.6
Python Path:

['C:\\Users\\RDM\\Desktop\\Web\\KVC\\KVC',
 'c:\\users\\rdm\\appdata\\local\\programs\\python\\python39\\python39.zip',
 'c:\\users\\rdm\\appdata\\local\\programs\\python\\python39\\DLLs',
 'c:\\users\\rdm\\appdata\\local\\programs\\python\\python39\\lib',
 'c:\\users\\rdm\\appdata\\local\\programs\\python\\python39',
 'C:\\Users\\RDM\\Envs\\env',
 'C:\\Users\\RDM\\Envs\\env\\lib\\site-packages']



Mon, 05 Jul 2021 15:04:30 +00
}}}


my settings
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = '587'
EMAIL_HOST_USER = 'myacco...@gmail.com'
EMAIL_HOST_PASSWORD = 'almxfemqayldytab'
EMAIL_USE_TLS = True

here is my views.py

def contact(request):
if request.method == 'POST':
f_name = request.POST['name']
f_email = request.POST['email']
f_subject = request.POST['subject']
f_message = request.POST['message']

# send mail function
datatuple = (
('f_name','f_subject', 'f_message','f_email',
['mygm...@gmail.com']),
# second person
('f_name','f_subject', 'f_message','f_email',
['sec...@gmail.com'])
)
send_mass_mail(datatuple)

if send_mass_mail(datatuple):
messages.info(request,'thank you for contacting us')
return redirect('contact')
else:
messages.info(request, 'try again sorry for inconveniency')
return redirect('contact')
else:
messages.info(request, 'try again sorry for inconveniency')
return redirect('contact')




here down urls.py

path("contact", views.contact, name="contact"),

then my form html


 
  {% csrf_token %}
  

  
  


  
  

  
  


  
  


  
  
{% for fmessage in messages %}
{{fmessage}}
{% endfor %}
  
  
Send Message


  

-- 
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/CAJCm56LAbJHrbNFworRZsuD-hP5Gok6wH%2BvQw1NgQuwAJ9_S4w%40mail.gmail.com.


Re: HELP WITH INSTALLING AND RUNNING PGAGENT AS A DAEMON

2021-07-01 Thread Kasper Laudrup
On 01/07/2021 17.49, Sunday Iyanu Ajayi wrote:
> 
> Please I need guidance in setting up Pgagent as a daemon on my ubuntu

https://gist.github.com/v4r15/b246b81ec09c488ebecac4610d975456

Kind regards,

Kasper Laudrup

-- 
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/4419c780-f9e9-b7ab-da69-7e94757ba218%40stacktrace.dk.


OpenPGP_signature
Description: OpenPGP digital signature


HELP WITH INSTALLING AND RUNNING PGAGENT AS A DAEMON

2021-07-01 Thread Sunday Iyanu Ajayi
Dear Team,

Please I need guidance in setting up Pgagent as a daemon on my ubuntu
*AJAYI Sunday *
(+234) 806 771 5394
*sunnexaj...@gmail.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/CAKYSAw2fJ7E1Ge80UTo%2BPkFGYaqdxxVnTjoJuhycoarNyBuswA%40mail.gmail.com.


Re: In need of urgent help for products sorting and displaying

2021-06-28 Thread Kasper Laudrup
On 28/06/2021 13.58, Aritra Ray wrote:
> We've realised the error but are unable to fix it. We'll be grateful if
> you can solve it for us as we've been stuck on this for a long time.

I cannot solve your problems for you, but I and many others will be
happy to help if you provide some details on exactly what problems
you're having.

The idea of a mailing list/forum like this is helping each other and
learning from each other.

Kind regards,

Kasper Laudrup

-- 
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/f956a3dc-d444-bd2b-1fcb-f6d7488c1679%40stacktrace.dk.


OpenPGP_signature
Description: OpenPGP digital signature


Re: In need of urgent help for products sorting and displaying

2021-06-28 Thread Aritra Ray
We've realised the error but are unable to fix it. We'll be grateful if you
can solve it for us as we've been stuck on this for a long time. The search
function in the views.py is conditioning the products via products.html
filter form which is requesting for a "products-list url" which looks like
this: path('products', Product.as_view(), name='products-list').
The problem is the url pattern. Can you help us resolve this issue?
The GitHub link to our repo is
https://github.com/First-project-01/Django-ecommerce


Will be of great help
Regards,
Aritra.


On Mon, 28 Jun 2021 at 16:40, Kasper Laudrup  wrote:

> On 28/06/2021 12.51, Adarsh Sarda wrote:
> >  I've been building a Django E-commerce website and I'm facing problems
> > displaying the sorted products on the products page of my website. I can
> > display the products by category sorting in which I'm using crispy-forms
> > to display the form but I am unable to display the products when sorted
> > by price. I've attached the required files below.
> >
> > Do let me know if anything else is needed.
> > Thanks for your help in advance
> >
>
> Check the "action" parameter to your form. Where exactly does the string
> given to that parameter end?
>
> That should help you figure out how to fix it.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/bec6b39c-53a2-2905-eb4c-77cb24ba6c25%40stacktrace.dk
> .
>

-- 
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/CAFecadvCQGUGmCpd9O%3DHXrgnMV83uHUBhYv5m2qyOqi_Cf10Dw%40mail.gmail.com.


Re: In need of urgent help for products sorting and displaying

2021-06-28 Thread Kasper Laudrup
On 28/06/2021 12.51, Adarsh Sarda wrote:
>  I've been building a Django E-commerce website and I'm facing problems
> displaying the sorted products on the products page of my website. I can
> display the products by category sorting in which I'm using crispy-forms
> to display the form but I am unable to display the products when sorted
> by price. I've attached the required files below.  
> 
> Do let me know if anything else is needed. 
> Thanks for your help in advance
> 

Check the "action" parameter to your form. Where exactly does the string
given to that parameter end?

That should help you figure out how to fix it.

Kind regards,

Kasper Laudrup

-- 
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/bec6b39c-53a2-2905-eb4c-77cb24ba6c25%40stacktrace.dk.


OpenPGP_signature
Description: OpenPGP digital signature


Re: Help

2021-06-27 Thread sum abiut
You have to be more clear on what you are working on. provide the code that
you are having trouble with in order to get the appropriate assistance.
You might want to take a look at this.
https://django-hitcount.readthedocs.io/en/latest/#

On Mon, Jun 28, 2021 at 5:54 AM ola neat  wrote:

> Halo django devs,
> I'm working on a drf api to return hit count on my site & I've  got no
> idea how to archive that, can anyone help?
>
> --
> 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/CAHLKn7320WTv4hjN4dUv4pcjH53z-G4NT%2BrEhuLb6aBcZahYYg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAHLKn7320WTv4hjN4dUv4pcjH53z-G4NT%2BrEhuLb6aBcZahYYg%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/CAPCf-y5k3RVH33pp6BXz_nP_o1gwA4edt3%2B2v8VtoYP8cR321w%40mail.gmail.com.


Help

2021-06-27 Thread ola neat
Halo django devs,
I'm working on a drf api to return hit count on my site & I've  got no idea
how to archive that, can anyone help?

-- 
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/CAHLKn7320WTv4hjN4dUv4pcjH53z-G4NT%2BrEhuLb6aBcZahYYg%40mail.gmail.com.


Re: Kindly help me with Django filer, urgent need.

2021-06-25 Thread Aritra Ray
Right, kindly heed to the problem as early as possible, The GitHub link is
provided below.
https://github.com/First-project-01/Django-ecommerce/issues/12

On Fri, 25 Jun 2021 at 19:34, Symaxx  wrote:

> This is easier to work with on GitHub, do you have a GitHub account?
>
> You can raise an issue then share the link here 
>
> On Fri, 25 Jun 2021, 3:04 PM Aritra Ray,  wrote:
>
>> Hi,
>> This is my second request regarding the same issue. I've been building a
>> Django E-commerce website and I'm facing problems filtering the product
>> according to price. I used django-filter to filter category and size.
>> Please suggest a solution for price in the following manner: Latest
>> products, Lowest to Highest and Highest to Lowest. I've made some progress
>> in the template without using django-filter. Kindly help me tie it up with
>> the backend.
>>
>> Do let me know if anything else is needed.
>> Thanks for your help in advance
>>
>> Regards,
>> Aritra
>>
>> #products-html
>>  
>> 
>>   
>>   
>> {{filter.form|crispy}}
>> 
>>   Select sorting criteria
>>   
>>   
>>   
>>   > '-date_added' %}selected{% endif %}>Latest collection
>>   >  %} selected {% endif %}>Lowest to Highest
>>   >  %} selected {% endif %}>Highest to Lowest
>>   
>>   
>>   
>>   
>> > class="glyphicon glyphicon-search"> Search
>> 
>>   
>> 
>>
>> #views.py
>>
>> class Product(ListView):
>> model = Items
>> paginate_by = 6
>> template_name = 'products.html'
>> ordering = ["-id"]
>>
>> def get_queryset(self):
>> queryset = super().get_queryset()
>> filter = ProductFilter(self.request.GET, queryset)
>> return filter.qs
>>
>> def get_context_data(self, **kwargs):
>> context = super().get_context_data(**kwargs)
>> queryset = self.get_queryset()
>> filter = ProductFilter(self.request.GET, queryset)
>> context["filter"] = filter
>> return context
>>
>> # filters.py
>> import django_filters
>> from .models import Items
>>
>> class ProductFilter(django_filters.FilterSet):
>> class Meta:
>> model = Items
>> fields = ['size', 'category']
>>
>> --
>> 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/CAFecadt5eYOdDX3sL46kbscLfbhwAzEcvwUpM9TF_s%2B9YhBGVQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAFecadt5eYOdDX3sL46kbscLfbhwAzEcvwUpM9TF_s%2B9YhBGVQ%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/CANPYDAtyWhqy%3DGM%3DEGpwVrUFDrTuctmgpN4xPcrLyKYgOv23cg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CANPYDAtyWhqy%3DGM%3DEGpwVrUFDrTuctmgpN4xPcrLyKYgOv23cg%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/CAFecaduYnX1yYU-f1B2rOKZjX4_XnU-%2BVDGVPZan4DikY_e19A%40mail.gmail.com.


Re: Kindly help me with Django filer, urgent need.

2021-06-25 Thread Symaxx
This is easier to work with on GitHub, do you have a GitHub account?

You can raise an issue then share the link here 

On Fri, 25 Jun 2021, 3:04 PM Aritra Ray,  wrote:

> Hi,
> This is my second request regarding the same issue. I've been building a
> Django E-commerce website and I'm facing problems filtering the product
> according to price. I used django-filter to filter category and size.
> Please suggest a solution for price in the following manner: Latest
> products, Lowest to Highest and Highest to Lowest. I've made some progress
> in the template without using django-filter. Kindly help me tie it up with
> the backend.
>
> Do let me know if anything else is needed.
> Thanks for your help in advance
>
> Regards,
> Aritra
>
> #products-html
>  
> 
>   
>   
> {{filter.form|crispy}}
> 
>   Select sorting criteria
>   
>   
>   
>'-date_added' %}selected{% endif %}>Latest collection
> selected {% endif %}>Lowest to Highest
> %} selected {% endif %}>Highest to Lowest
>   
>   
>   
>   
>  class="glyphicon glyphicon-search"> Search
> 
>   
> 
>
> #views.py
>
> class Product(ListView):
> model = Items
> paginate_by = 6
> template_name = 'products.html'
> ordering = ["-id"]
>
> def get_queryset(self):
> queryset = super().get_queryset()
> filter = ProductFilter(self.request.GET, queryset)
> return filter.qs
>
> def get_context_data(self, **kwargs):
> context = super().get_context_data(**kwargs)
> queryset = self.get_queryset()
> filter = ProductFilter(self.request.GET, queryset)
> context["filter"] = filter
> return context
>
> # filters.py
> import django_filters
> from .models import Items
>
> class ProductFilter(django_filters.FilterSet):
> class Meta:
> model = Items
> fields = ['size', 'category']
>
> --
> 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/CAFecadt5eYOdDX3sL46kbscLfbhwAzEcvwUpM9TF_s%2B9YhBGVQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFecadt5eYOdDX3sL46kbscLfbhwAzEcvwUpM9TF_s%2B9YhBGVQ%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/CANPYDAtyWhqy%3DGM%3DEGpwVrUFDrTuctmgpN4xPcrLyKYgOv23cg%40mail.gmail.com.


Kindly help me with Django filer, urgent need.

2021-06-25 Thread Aritra Ray
Hi,
This is my second request regarding the same issue. I've been building a
Django E-commerce website and I'm facing problems filtering the product
according to price. I used django-filter to filter category and size.
Please suggest a solution for price in the following manner: Latest
products, Lowest to Highest and Highest to Lowest. I've made some progress
in the template without using django-filter. Kindly help me tie it up with
the backend.

Do let me know if anything else is needed.
Thanks for your help in advance

Regards,
Aritra

#products-html
 

  
  
{{filter.form|crispy}}

  Select sorting criteria
  
  
  
  Latest collection
  Lowest to Highest
  Highest to Lowest
  
  
  
  
 Search

  


#views.py

class Product(ListView):
model = Items
paginate_by = 6
template_name = 'products.html'
ordering = ["-id"]

def get_queryset(self):
queryset = super().get_queryset()
filter = ProductFilter(self.request.GET, queryset)
return filter.qs

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
queryset = self.get_queryset()
filter = ProductFilter(self.request.GET, queryset)
context["filter"] = filter
return context

# filters.py
import django_filters
from .models import Items

class ProductFilter(django_filters.FilterSet):
class Meta:
model = Items
fields = ['size', 'category']

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


In need of urgent help as I've been stuck on this for a while

2021-06-24 Thread Aritra Ray
Hi,
This is my second request regarding the same issue. I've been building a
Django E-commerce website and I'm facing problems filtering the product
according to price. I used django-filter to filter category and size.
Please suggest a solution for price in the following manner: Latest
products, Lowest to Highest and Highest to Lowest. I've made some progress
in the template without using django-filter. Kindly help me tie it up with
the backend.

Do let me know if anything else is needed.
Thanks for your help in advance

Regards,
Aritra

#products-html
 

  
  
{{filter.form|crispy}}

  Select sorting criteria
  
  
  
  Latest collection
  Lowest to Highest
  Highest to Lowest
  
  
  
  
 Search

  


#views.py

class Product(ListView):
model = Items
paginate_by = 6
template_name = 'products.html'
ordering = ["-id"]

def get_queryset(self):
queryset = super().get_queryset()
filter = ProductFilter(self.request.GET, queryset)
return filter.qs

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
queryset = self.get_queryset()
filter = ProductFilter(self.request.GET, queryset)
context["filter"] = filter
return context

# filters.py
import django_filters
from .models import Items

class ProductFilter(django_filters.FilterSet):
class Meta:
model = Items
fields = ['size', 'category']

-- 
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/CAFecadukpt-gAgFwT5%2BKGM2tp3u3fdFDj98MQHWPgbY42dMGVQ%40mail.gmail.com.


Fwd: Error while creating an ecommerce website :PLEASE HELP!

2021-06-23 Thread Parul.
-- Forwarded message -
From: Parul. 
Date: Wed, Jun 23, 2021, 11:34 PM
Subject: Error while creating an ecommerce website :PLEASE HELP!
To: 


Hi,
I am working on an ecommerce website. I am facing an error. Can anyone
please help me solve this error.
I am not able to fetch the PRODUCT_ID

1. views.py (APP-CART)
---
from django.shortcuts import render,redirect
from .models import Cart
from new_app.models import Product

# Create your views here.


def cart_home(request):

cart_obj,new_obj=Cart.objects.new_or_get(request)
products=Cart.objects.all()



return render(request,'carts/home.html',{})


def cart_update(request):
print(request.POST)
# print(dict(request.POST.items()))
# print("in func")

product_id=1
print('id below')
print(product_id) // not able to get the value of product id in
console
product_obj=Product.objects.get(id=product_id)
cart_obj,new_obj=Cart.objects.new_or_get(request)
if product_obj in cart_obj.products.all():
cart_obj.products.remove(product_obj)
else:
cart_obj.products.add(product_obj)
return redirect('home')




2. models.py  (cart)


from django.db import models
from django.conf import settings
from new_app.models import Product
from django.db.models.signals import pre_save,post_save,m2m_changed



User=settings.AUTH_USER_MODEL

class CartManager(models.Manager):
def new_or_get(self,request):
cart_id=request.session.get("cart_id",None)
# qs=self.get_queryset().filter(id=cart_id)
qs=self.get_queryset().only('products')

print(qs)
if qs.count()==1:
new_obj=False
cart_obj=qs.first()
print('cart obj below')
print(cart_obj)
if request.user.is_authenticated and cart_obj.user is None:

cart_obj.user=request.user
cart_obj.save()


else:
cart_obj=Cart.objects.new_cart(user=request.user)
new_obj=True
request.session['cart_id']=cart_obj.id
return cart_obj,new_obj

def new_cart(self,user=None):
user_obj=None
if user is not None:
if user.is_authenticated:
user_obj=user
return self.model.objects.create(user=user_obj)

class Cart(models.Model):

user=models.ForeignKey(User,null=True,blank=True,on_delete=models.CASCADE)
products=models.ManyToManyField(Product,blank=True)

subtotal=models.DecimalField(default=0.00,max_digits=100,decimal_places=2)

total=models.DecimalField(default=0.00,max_digits=100,decimal_places=2)
timestamp=models.DateTimeField(auto_now_add=True)
updated=models.DateTimeField(auto_now=True)

objects=CartManager()

def __str__(self):
return str(self.id)


def m2m_changed_cart_receiver(sender,instance,action,*args,**kwargs):
print(action)
if action=='post_add' or action=='post_remove' or action=='clear':
products=instance.products.all()
total=0
for x in products:
total += x.price
if instance.subtotal != total:
instance.subtotal=total
instance.save()
m2m_changed.connect(m2m_changed_cart_receiver,sender=Cart.products.through)


def pre_save_cart_receiver(sender,instance,*args,**kwargs):
if instance.subtotal>0:
instance.total=instance.subtotal + 10
else:
instance.total=0.00

pre_save.connect(pre_save_cart_receiver,sender=Cart)




OUTPUT IN CONSOLE:

  GETTING EMPTY DICTIONARY  INSTEAD OF GETTING PRODUCT
ID i.e. 1
id below
1
]>


So, I am unable to fetch the productc id there besides the csrf
i tried to individually print the product id.. which came as 1...(written
under"id below" in output)

Can anyone pls help me with this.




Also, adding update_cart.html
{% csrf_token
%}
  
  {% if product in cart.products.all %}
  remove
  {% else %}
  add to cart
  {% endif %}

  

-- 
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/CAHjHRFqpGEcZj6-Enq_uwZJRbKZRVwJEti9BfKBwg%2Bv%3Dkr4kjA%40mail.gmail.com.


Re: Error while creating an ecommerce website :PLEASE HELP!

2021-06-23 Thread Parul.
Hi,
I tried to pass the id..but its not working
I observed while debugging, the try catch block is not getting
implemented... i tried to put some print statements there..but they are not
getting printed
The print statements in models.py -- new_or_get func()  are working

On Thu, Jun 24, 2021 at 12:08 AM Aadil Rashid 
wrote:

> First pass Id as an argument along with request to that particular view
> function
>
> On Thu, 24 Jun, 2021, 12:06 AM Parul.,  wrote:
>
>> Hi ,
>>
>> I am doing : product_obj=Product.objects.get(id=product_id)
>> in the cart_update function in views.py
>>
>> but when trying to print this object... i am not getting anything... is
>> this function is not working?
>>
>>
>> On Wed, Jun 23, 2021 at 11:38 PM Aadil Rashid 
>> wrote:
>>
>>> Pass I'd to the view you are you are using,
>>> And then get products thrid that I'd by simple ORM quriy
>>>
>>> Product = model name.objects.get(id=id)
>>>
>>> On Wed, 23 Jun, 2021, 11:35 PM Parul.,  wrote:
>>>
>>>> Hi,
>>>> I am working on an ecommerce website. I am facing an error. Can anyone
>>>> please help me solve this error.
>>>> I am not able to fetch the PRODUCT_ID
>>>>
>>>> 1. views.py (APP-CART)
>>>>
>>>> ---
>>>> from django.shortcuts import render,redirect
>>>> from .models import Cart
>>>> from new_app.models import Product
>>>>
>>>> # Create your views here.
>>>>
>>>>
>>>> def cart_home(request):
>>>>
>>>> cart_obj,new_obj=Cart.objects.new_or_get(request)
>>>> products=Cart.objects.all()
>>>>
>>>>
>>>>
>>>> return render(request,'carts/home.html',{})
>>>>
>>>>
>>>> def cart_update(request):
>>>> print(request.POST)
>>>> # print(dict(request.POST.items()))
>>>> # print("in func")
>>>>
>>>> product_id=1
>>>> print('id below')
>>>> print(product_id) // not able to get the value of product id in
>>>> console
>>>> product_obj=Product.objects.get(id=product_id)
>>>> cart_obj,new_obj=Cart.objects.new_or_get(request)
>>>> if product_obj in cart_obj.products.all():
>>>> cart_obj.products.remove(product_obj)
>>>> else:
>>>> cart_obj.products.add(product_obj)
>>>> return redirect('home')
>>>>
>>>>
>>>>
>>>>
>>>> 
>>>> 2. models.py  (cart)
>>>>
>>>>
>>>> from django.db import models
>>>> from django.conf import settings
>>>> from new_app.models import Product
>>>> from django.db.models.signals import pre_save,post_save,m2m_changed
>>>>
>>>>
>>>>
>>>> User=settings.AUTH_USER_MODEL
>>>>
>>>> class CartManager(models.Manager):
>>>> def new_or_get(self,request):
>>>> cart_id=request.session.get("cart_id",None)
>>>> # qs=self.get_queryset().filter(id=cart_id)
>>>> qs=self.get_queryset().only('products')
>>>>
>>>> print(qs)
>>>> if qs.count()==1:
>>>> new_obj=False
>>>> cart_obj=qs.first()
>>>> print('cart obj below')
>>>> print(cart_obj)
>>>> if request.user.is_authenticated and cart_obj.user is
>>>> None:
>>>>
>>>> cart_obj.user=request.user
>>>> cart_obj.save()
>>>>
>>>>
>>>> else:
>>>> cart_obj=Cart.objects.new_cart(user=request.user)
>>>> new_obj=True
>>>> request.session['cart_id']=cart_obj.id
>>>> return cart_obj,new_obj
>>>>
>>>> def new_cart(self,user=None):
>>>> user_obj=None
>>>> if user is not None:
>>>> if user.is_authenticated:
>>>> user_obj=u

Re: Error while creating an ecommerce website :PLEASE HELP!

2021-06-23 Thread Aadil Rashid
First pass Id as an argument along with request to that particular view
function

On Thu, 24 Jun, 2021, 12:06 AM Parul.,  wrote:

> Hi ,
>
> I am doing : product_obj=Product.objects.get(id=product_id)
> in the cart_update function in views.py
>
> but when trying to print this object... i am not getting anything... is
> this function is not working?
>
>
> On Wed, Jun 23, 2021 at 11:38 PM Aadil Rashid 
> wrote:
>
>> Pass I'd to the view you are you are using,
>> And then get products thrid that I'd by simple ORM quriy
>>
>> Product = model name.objects.get(id=id)
>>
>> On Wed, 23 Jun, 2021, 11:35 PM Parul.,  wrote:
>>
>>> Hi,
>>> I am working on an ecommerce website. I am facing an error. Can anyone
>>> please help me solve this error.
>>> I am not able to fetch the PRODUCT_ID
>>>
>>> 1. views.py (APP-CART)
>>>
>>> ---
>>> from django.shortcuts import render,redirect
>>> from .models import Cart
>>> from new_app.models import Product
>>>
>>> # Create your views here.
>>>
>>>
>>> def cart_home(request):
>>>
>>> cart_obj,new_obj=Cart.objects.new_or_get(request)
>>> products=Cart.objects.all()
>>>
>>>
>>>
>>> return render(request,'carts/home.html',{})
>>>
>>>
>>> def cart_update(request):
>>> print(request.POST)
>>> # print(dict(request.POST.items()))
>>> # print("in func")
>>>
>>> product_id=1
>>> print('id below')
>>> print(product_id) // not able to get the value of product id in
>>> console
>>> product_obj=Product.objects.get(id=product_id)
>>> cart_obj,new_obj=Cart.objects.new_or_get(request)
>>> if product_obj in cart_obj.products.all():
>>> cart_obj.products.remove(product_obj)
>>> else:
>>> cart_obj.products.add(product_obj)
>>> return redirect('home')
>>>
>>>
>>>
>>>
>>> 
>>> 2. models.py  (cart)
>>>
>>>
>>> from django.db import models
>>> from django.conf import settings
>>> from new_app.models import Product
>>> from django.db.models.signals import pre_save,post_save,m2m_changed
>>>
>>>
>>>
>>> User=settings.AUTH_USER_MODEL
>>>
>>> class CartManager(models.Manager):
>>> def new_or_get(self,request):
>>> cart_id=request.session.get("cart_id",None)
>>> # qs=self.get_queryset().filter(id=cart_id)
>>> qs=self.get_queryset().only('products')
>>>
>>> print(qs)
>>> if qs.count()==1:
>>> new_obj=False
>>> cart_obj=qs.first()
>>> print('cart obj below')
>>> print(cart_obj)
>>> if request.user.is_authenticated and cart_obj.user is
>>> None:
>>>
>>> cart_obj.user=request.user
>>> cart_obj.save()
>>>
>>>
>>> else:
>>> cart_obj=Cart.objects.new_cart(user=request.user)
>>> new_obj=True
>>> request.session['cart_id']=cart_obj.id
>>> return cart_obj,new_obj
>>>
>>> def new_cart(self,user=None):
>>> user_obj=None
>>> if user is not None:
>>> if user.is_authenticated:
>>> user_obj=user
>>> return self.model.objects.create(user=user_obj)
>>>
>>> class Cart(models.Model):
>>>
>>> user=models.ForeignKey(User,null=True,blank=True,on_delete=models.CASCADE)
>>> products=models.ManyToManyField(Product,blank=True)
>>>
>>> subtotal=models.DecimalField(default=0.00,max_digits=100,decimal_places=2)
>>>
>>>
>>> total=models.DecimalField(default=0.00,max_digits=100,decimal_places=2)
>>> timestamp=models.DateTimeField(auto_now_add=True)
>>> updated=models.DateTimeField(auto_now=True)
>>>
>>> objects=CartManager()
>>>
>>> def __str__(self):
>>> return str(self.id)

Re: Error while creating an ecommerce website :PLEASE HELP!

2021-06-23 Thread Parul.
Hi ,

I am doing : product_obj=Product.objects.get(id=product_id)
in the cart_update function in views.py

but when trying to print this object... i am not getting anything... is
this function is not working?


On Wed, Jun 23, 2021 at 11:38 PM Aadil Rashid 
wrote:

> Pass I'd to the view you are you are using,
> And then get products thrid that I'd by simple ORM quriy
>
> Product = model name.objects.get(id=id)
>
> On Wed, 23 Jun, 2021, 11:35 PM Parul.,  wrote:
>
>> Hi,
>> I am working on an ecommerce website. I am facing an error. Can anyone
>> please help me solve this error.
>> I am not able to fetch the PRODUCT_ID
>>
>> 1. views.py (APP-CART)
>>
>> ---
>> from django.shortcuts import render,redirect
>> from .models import Cart
>> from new_app.models import Product
>>
>> # Create your views here.
>>
>>
>> def cart_home(request):
>>
>> cart_obj,new_obj=Cart.objects.new_or_get(request)
>> products=Cart.objects.all()
>>
>>
>>
>> return render(request,'carts/home.html',{})
>>
>>
>> def cart_update(request):
>> print(request.POST)
>> # print(dict(request.POST.items()))
>> # print("in func")
>>
>> product_id=1
>> print('id below')
>> print(product_id) // not able to get the value of product id in
>> console
>> product_obj=Product.objects.get(id=product_id)
>> cart_obj,new_obj=Cart.objects.new_or_get(request)
>> if product_obj in cart_obj.products.all():
>> cart_obj.products.remove(product_obj)
>> else:
>> cart_obj.products.add(product_obj)
>> return redirect('home')
>>
>>
>>
>>
>> 
>> 2. models.py  (cart)
>>
>>
>> from django.db import models
>> from django.conf import settings
>> from new_app.models import Product
>> from django.db.models.signals import pre_save,post_save,m2m_changed
>>
>>
>>
>> User=settings.AUTH_USER_MODEL
>>
>> class CartManager(models.Manager):
>> def new_or_get(self,request):
>> cart_id=request.session.get("cart_id",None)
>> # qs=self.get_queryset().filter(id=cart_id)
>> qs=self.get_queryset().only('products')
>>
>> print(qs)
>> if qs.count()==1:
>> new_obj=False
>> cart_obj=qs.first()
>> print('cart obj below')
>> print(cart_obj)
>> if request.user.is_authenticated and cart_obj.user is
>> None:
>>
>> cart_obj.user=request.user
>> cart_obj.save()
>>
>>
>> else:
>> cart_obj=Cart.objects.new_cart(user=request.user)
>> new_obj=True
>> request.session['cart_id']=cart_obj.id
>> return cart_obj,new_obj
>>
>> def new_cart(self,user=None):
>> user_obj=None
>> if user is not None:
>> if user.is_authenticated:
>> user_obj=user
>> return self.model.objects.create(user=user_obj)
>>
>> class Cart(models.Model):
>>
>> user=models.ForeignKey(User,null=True,blank=True,on_delete=models.CASCADE)
>> products=models.ManyToManyField(Product,blank=True)
>>
>> subtotal=models.DecimalField(default=0.00,max_digits=100,decimal_places=2)
>>
>>
>> total=models.DecimalField(default=0.00,max_digits=100,decimal_places=2)
>> timestamp=models.DateTimeField(auto_now_add=True)
>> updated=models.DateTimeField(auto_now=True)
>>
>> objects=CartManager()
>>
>> def __str__(self):
>> return str(self.id)
>>
>>
>> def m2m_changed_cart_receiver(sender,instance,action,*args,**kwargs):
>> print(action)
>> if action=='post_add' or action=='post_remove' or action=='clear':
>> products=instance.products.all()
>> total=0
>> for x in products:
>> total += x.price
>> if instance.subtotal != total:
>> instance.subtotal=total
>> instance.save()
>>
>> m2m_changed.connect(m2m_changed_cart_receiver,sender=Cart.products.through)
>>
>>
>> def pre_save_cart_rece

Re: Error while creating an ecommerce website :PLEASE HELP!

2021-06-23 Thread Aadil Rashid
Pass I'd to the view you are you are using,
And then get products thrid that I'd by simple ORM quriy

Product = model name.objects.get(id=id)

On Wed, 23 Jun, 2021, 11:35 PM Parul.,  wrote:

> Hi,
> I am working on an ecommerce website. I am facing an error. Can anyone
> please help me solve this error.
> I am not able to fetch the PRODUCT_ID
>
> 1. views.py (APP-CART)
>
> ---
> from django.shortcuts import render,redirect
> from .models import Cart
> from new_app.models import Product
>
> # Create your views here.
>
>
> def cart_home(request):
>
> cart_obj,new_obj=Cart.objects.new_or_get(request)
> products=Cart.objects.all()
>
>
>
> return render(request,'carts/home.html',{})
>
>
> def cart_update(request):
> print(request.POST)
> # print(dict(request.POST.items()))
> # print("in func")
>
> product_id=1
> print('id below')
> print(product_id) // not able to get the value of product id in
> console
> product_obj=Product.objects.get(id=product_id)
> cart_obj,new_obj=Cart.objects.new_or_get(request)
> if product_obj in cart_obj.products.all():
> cart_obj.products.remove(product_obj)
> else:
> cart_obj.products.add(product_obj)
> return redirect('home')
>
>
>
>
> 
> 2. models.py  (cart)
>
>
> from django.db import models
> from django.conf import settings
> from new_app.models import Product
> from django.db.models.signals import pre_save,post_save,m2m_changed
>
>
>
> User=settings.AUTH_USER_MODEL
>
> class CartManager(models.Manager):
> def new_or_get(self,request):
> cart_id=request.session.get("cart_id",None)
> # qs=self.get_queryset().filter(id=cart_id)
> qs=self.get_queryset().only('products')
>
> print(qs)
> if qs.count()==1:
> new_obj=False
> cart_obj=qs.first()
> print('cart obj below')
> print(cart_obj)
> if request.user.is_authenticated and cart_obj.user is None:
>
> cart_obj.user=request.user
> cart_obj.save()
>
>
> else:
> cart_obj=Cart.objects.new_cart(user=request.user)
> new_obj=True
> request.session['cart_id']=cart_obj.id
> return cart_obj,new_obj
>
> def new_cart(self,user=None):
> user_obj=None
> if user is not None:
> if user.is_authenticated:
> user_obj=user
> return self.model.objects.create(user=user_obj)
>
> class Cart(models.Model):
>
> user=models.ForeignKey(User,null=True,blank=True,on_delete=models.CASCADE)
> products=models.ManyToManyField(Product,blank=True)
>
> subtotal=models.DecimalField(default=0.00,max_digits=100,decimal_places=2)
>
> total=models.DecimalField(default=0.00,max_digits=100,decimal_places=2)
> timestamp=models.DateTimeField(auto_now_add=True)
> updated=models.DateTimeField(auto_now=True)
>
> objects=CartManager()
>
> def __str__(self):
> return str(self.id)
>
>
> def m2m_changed_cart_receiver(sender,instance,action,*args,**kwargs):
> print(action)
> if action=='post_add' or action=='post_remove' or action=='clear':
> products=instance.products.all()
> total=0
> for x in products:
> total += x.price
> if instance.subtotal != total:
> instance.subtotal=total
> instance.save()
> m2m_changed.connect(m2m_changed_cart_receiver,sender=Cart.products.through)
>
>
> def pre_save_cart_receiver(sender,instance,*args,**kwargs):
> if instance.subtotal>0:
> instance.total=instance.subtotal + 10
> else:
> instance.total=0.00
>
> pre_save.connect(pre_save_cart_receiver,sender=Cart)
>
>
>
>
> OUTPUT IN CONSOLE:
>
>  ['FMk2gTq6XXxZ2HU40I6h4b3WtPl59Drf1urwUNufDZUeSFPMzGNwU4L1QuGCiCbB'],
> 'product_id':
>  ['']}>  GETTING EMPTY DICTIONARY  INSTEAD OF GETTING PRODUCT
> ID i.e. 1
> id below
> 1
> ]>
>
>
> So, I am unable to fetch the productc id there besides the csrf
> i tried to individually print the product id.. which came as 1...(written
> under"id below" in output)
>
> Can anyone pls help me with this.
>
>
>
>
> Also, adding update_cart.html
> {% cs

Error while creating an ecommerce website :PLEASE HELP!

2021-06-23 Thread Parul.
Hi,
I am working on an ecommerce website. I am facing an error. Can anyone
please help me solve this error.
I am not able to fetch the PRODUCT_ID

1. views.py (APP-CART)
---
from django.shortcuts import render,redirect
from .models import Cart
from new_app.models import Product

# Create your views here.


def cart_home(request):

cart_obj,new_obj=Cart.objects.new_or_get(request)
products=Cart.objects.all()



return render(request,'carts/home.html',{})


def cart_update(request):
print(request.POST)
# print(dict(request.POST.items()))
# print("in func")

product_id=1
print('id below')
print(product_id) // not able to get the value of product id in
console
product_obj=Product.objects.get(id=product_id)
cart_obj,new_obj=Cart.objects.new_or_get(request)
if product_obj in cart_obj.products.all():
cart_obj.products.remove(product_obj)
else:
cart_obj.products.add(product_obj)
return redirect('home')




2. models.py  (cart)


from django.db import models
from django.conf import settings
from new_app.models import Product
from django.db.models.signals import pre_save,post_save,m2m_changed



User=settings.AUTH_USER_MODEL

class CartManager(models.Manager):
def new_or_get(self,request):
cart_id=request.session.get("cart_id",None)
# qs=self.get_queryset().filter(id=cart_id)
qs=self.get_queryset().only('products')

print(qs)
if qs.count()==1:
new_obj=False
cart_obj=qs.first()
print('cart obj below')
print(cart_obj)
if request.user.is_authenticated and cart_obj.user is None:

cart_obj.user=request.user
cart_obj.save()


else:
cart_obj=Cart.objects.new_cart(user=request.user)
new_obj=True
request.session['cart_id']=cart_obj.id
return cart_obj,new_obj

def new_cart(self,user=None):
user_obj=None
if user is not None:
if user.is_authenticated:
user_obj=user
return self.model.objects.create(user=user_obj)

class Cart(models.Model):

user=models.ForeignKey(User,null=True,blank=True,on_delete=models.CASCADE)
products=models.ManyToManyField(Product,blank=True)

subtotal=models.DecimalField(default=0.00,max_digits=100,decimal_places=2)

total=models.DecimalField(default=0.00,max_digits=100,decimal_places=2)
timestamp=models.DateTimeField(auto_now_add=True)
updated=models.DateTimeField(auto_now=True)

objects=CartManager()

def __str__(self):
return str(self.id)


def m2m_changed_cart_receiver(sender,instance,action,*args,**kwargs):
print(action)
if action=='post_add' or action=='post_remove' or action=='clear':
products=instance.products.all()
total=0
for x in products:
total += x.price
if instance.subtotal != total:
instance.subtotal=total
instance.save()
m2m_changed.connect(m2m_changed_cart_receiver,sender=Cart.products.through)


def pre_save_cart_receiver(sender,instance,*args,**kwargs):
if instance.subtotal>0:
instance.total=instance.subtotal + 10
else:
instance.total=0.00

pre_save.connect(pre_save_cart_receiver,sender=Cart)




OUTPUT IN CONSOLE:

  GETTING EMPTY DICTIONARY  INSTEAD OF GETTING PRODUCT
ID i.e. 1
id below
1
]>


So, I am unable to fetch the productc id there besides the csrf
i tried to individually print the product id.. which came as 1...(written
under"id below" in output)

Can anyone pls help me with this.




Also, adding update_cart.html
{% csrf_token
%}
  
  {% if product in cart.products.all %}
  remove
  {% else %}
  add to cart
  {% endif %}

  

-- 
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/CAHjHRFpf_EfU%3DSSFFTMOeb5JkuNKL%3DuSNVtp782A2r_R-M0_DA%40mail.gmail.com.


Re: kindly i need a help

2021-06-23 Thread Kelvin Sajere
I see three errors in your views and templates. First, the kvc variable in
your view holds a list of all objects in your Aboutus table and all objects
in your Services table, and I don’t think that’s what you want.

If I understand what you want to achieve, then your view should look like
this.

def index(request):
Abt = Aboutus.objects.all()
service = Services.objects.all()
kvc = {“Abt” : Abt,
“service” : service}
return render(request, "index.html", kvc)

Then in your template, loop over Abt to get all about us objects, then over
services to get services objects. You can’t just call Abt or services cos
they are lists of objects.

On Wed, Jun 23, 2021 at 17:04 Richard Dushime 
wrote:

> i am making a website using  django  and postgresql the  when i made a
> migration and i created the tables then i i went  in the admin (django
> administration ) everything was okay  the user and the data i can add and
> manipulate all the data and get effect into the database  but  on my
> webpages i am not seeing anything it is deseapiring
>  this is my index.html file
>   
> 
>   
>
> 
>   {{Abt.name}}
>   {{Abt.desc}}
> 
>
> 
>   
> 
>   
> 
>   
>   
> 
>   {{Abt.title}}
>   
> {{Abt.desc2}}
>   
>   
> 
>  Ullamco laboris nisi ut aliquip ex ea commodo consequat.
> 
>  Duis aute irure dolor in reprehenderit in voluptate velit.
> 
>  Ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure 
> dolor in reprehenderit in voluptate trideta storacalaperda mastiro dolore eu 
> fugiat nulla pariatur.
> 
>   
>   
>
> Ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis 
> aute irure dolor in reprehenderit in voluptate
>
> velit esse cillum dolore eu fugiat nulla pariatur. Excepteur 
> sint occaecat cupidatat non proident, sunt in
> culpa qui officia deserunt mollit anim id est laborum
>   
> 
>   
> 
>
>   
> 
>
> 
> 
>   
>
> 
>   {{service.title}}
>   {{service.description}}
> 
>
> 
>   
> 
>   
>   {{service.name}}
>   {{service.description1}}
> 
>
>
> --
> 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/CAJCm56LnoLUsxp-NSZuopNchdG7wAd5UOHxdyfjsfCR7RmMD3w%40mail.gmail.com
> 
> .
>
-- 
KeLLs

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


Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Aritra Ray
Can you write the class based function of the above views.py. I'm unable to
do so. Will be of great help.


On Wed, 23 Jun 2021 at 21:54, Shailesh Yadav 
wrote:

> in Html code
>
> 
> {{items_filter.form}}
> 
>  Search
> 
> 
>
> Thanks & Regards
> Shailesh Yadav
> +91-9920886044
>
>   [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>
>
>
> On Wed, Jun 23, 2021 at 9:50 PM Shailesh Yadav <
> shaileshyadav7...@gmail.com> wrote:
>
>> Okay.
>> If you using the Django filter then, please try like below in your views..
>>
>> abc_list = ModelName.objects.all()
>> result_filter = ModelNameFilter(request.GET, queryset=abc_list)
>>
>> Thanks & Regards
>> Shailesh Yadav
>> +91-9920886044
>>
>>   [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>>
>>
>>
>>
>> On Wed, Jun 23, 2021 at 9:13 PM Aritra Ray  wrote:
>>
>>> Sorry, it's not working. I tried items_filter.form but it didn't work.
>>> Kindly check my views.py if that'll be of any help or require any changes.
>>>
>>>
>>> On Wed, 23 Jun 2021 at 15:02, Shailesh Yadav <
>>> shaileshyadav7...@gmail.com> wrote:
>>>
>>>> Okay use below in html
>>>> {{yourmodelnameinsmall_filter.form}}
>>>>
>>>> Thanks & Regards
>>>> Shailesh Yadav
>>>> +91-9920886044
>>>>
>>>>   [image: Linkedin]
>>>> <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>>>>
>>>>
>>>>
>>>> On Wed, Jun 23, 2021 at 2:58 PM Aritra Ray  wrote:
>>>>
>>>>> This isn't working. When we are supplying a filter, the html is
>>>>> displaying all the products irrespective of the requested.
>>>>>
>>>>> On Wed, 23 Jun, 2021, 2:57 pm Shailesh Yadav, <
>>>>> shaileshyadav7...@gmail.com> wrote:
>>>>>
>>>>>> Can you help with what ERROR you are getting?
>>>>>>
>>>>>> Thanks & Regards
>>>>>> Shailesh Yadav
>>>>>> +91-9920886044
>>>>>>
>>>>>>   [image: Linkedin]
>>>>>> <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, Jun 23, 2021 at 2:25 PM Aritra Ray 
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>> I've been trying to introduce a filter system in my Django-ecommerce
>>>>>>> website and I've been struggling despite reading the documents, etc. I 
>>>>>>> am
>>>>>>> using 'django-filter' and below are filters.py, models.py, views.py and 
>>>>>>> the
>>>>>>> template. To check out the project, follow the github link:
>>>>>>> https://github.com/First-project-01/Django-ecommerce.
>>>>>>>
>>>>>>> Will be grateful if anyone can sort this out. Thanks in advance.
>>>>>>> Regards,
>>>>>>> Aritra
>>>>>>>
>>>>>>> #filters.py
>>>>>>> class ProductFilter(django_filters.FilterSet):
>>>>>>> price = django_filters.NumberFilter()
>>>>>>> price__gt = django_filters.NumberFilter(field_name='price'
>>>>>>> , lookup_expr='gt')
>>>>>>> price__lt = django_filters.NumberFilter(field_name='price'
>>>>>>> , lookup_expr='lt')
>>>>>>> class Meta:
>>>>>>> model = Items
>>>>>>> fields = ['size', 'availability']
>>>>>>>
>>>>>>> #views.py
>>>>>>> class Product(ListView):
>>>>>>> model = Items
>>>>>>> paginate_by = 6
>>>>>>> template_name = 'products.html'
>>>>>>> def get_context_data(self, **kwargs):
>>>>>>> context = super(Product, self).get_context_data(**kwargs)
>>>>>>> context['filter'] = ProductFilter(self.request.GET, queryset
>>>>>>> =self.get_queryset())
>>>>>>> return context
>>>>>>> #models.py
>>>>>>> AVAILABILITY = (
>>>>>>> ('Y', 'Available'

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Aritra Ray
Like this?

class Product(ListView):
model = Items.objects.all()
paginate_by = 6
template_name = 'products.html'
result_filter = ProductFilter(request.GET, queryset=model)

On Wed, 23 Jun 2021 at 21:51, Shailesh Yadav 
wrote:

> Okay.
> If you using the Django filter then, please try like below in your views..
>
> abc_list = ModelName.objects.all()
> result_filter = ModelNameFilter(request.GET, queryset=abc_list)
>
> Thanks & Regards
> Shailesh Yadav
> +91-9920886044
>
>   [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>
>
>
> On Wed, Jun 23, 2021 at 9:13 PM Aritra Ray  wrote:
>
>> Sorry, it's not working. I tried items_filter.form but it didn't work.
>> Kindly check my views.py if that'll be of any help or require any changes.
>>
>>
>> On Wed, 23 Jun 2021 at 15:02, Shailesh Yadav 
>> wrote:
>>
>>> Okay use below in html
>>> {{yourmodelnameinsmall_filter.form}}
>>>
>>> Thanks & Regards
>>> Shailesh Yadav
>>> +91-9920886044
>>>
>>>   [image: Linkedin]
>>> <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>>>
>>>
>>>
>>> On Wed, Jun 23, 2021 at 2:58 PM Aritra Ray  wrote:
>>>
>>>> This isn't working. When we are supplying a filter, the html is
>>>> displaying all the products irrespective of the requested.
>>>>
>>>> On Wed, 23 Jun, 2021, 2:57 pm Shailesh Yadav, <
>>>> shaileshyadav7...@gmail.com> wrote:
>>>>
>>>>> Can you help with what ERROR you are getting?
>>>>>
>>>>> Thanks & Regards
>>>>> Shailesh Yadav
>>>>> +91-9920886044
>>>>>
>>>>>   [image: Linkedin]
>>>>> <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Jun 23, 2021 at 2:25 PM Aritra Ray 
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>> I've been trying to introduce a filter system in my Django-ecommerce
>>>>>> website and I've been struggling despite reading the documents, etc. I am
>>>>>> using 'django-filter' and below are filters.py, models.py, views.py and 
>>>>>> the
>>>>>> template. To check out the project, follow the github link:
>>>>>> https://github.com/First-project-01/Django-ecommerce.
>>>>>>
>>>>>> Will be grateful if anyone can sort this out. Thanks in advance.
>>>>>> Regards,
>>>>>> Aritra
>>>>>>
>>>>>> #filters.py
>>>>>> class ProductFilter(django_filters.FilterSet):
>>>>>> price = django_filters.NumberFilter()
>>>>>> price__gt = django_filters.NumberFilter(field_name='price'
>>>>>> , lookup_expr='gt')
>>>>>> price__lt = django_filters.NumberFilter(field_name='price'
>>>>>> , lookup_expr='lt')
>>>>>> class Meta:
>>>>>> model = Items
>>>>>> fields = ['size', 'availability']
>>>>>>
>>>>>> #views.py
>>>>>> class Product(ListView):
>>>>>> model = Items
>>>>>> paginate_by = 6
>>>>>> template_name = 'products.html'
>>>>>> def get_context_data(self, **kwargs):
>>>>>> context = super(Product, self).get_context_data(**kwargs)
>>>>>> context['filter'] = ProductFilter(self.request.GET, queryset=
>>>>>> self.get_queryset())
>>>>>> return context
>>>>>> #models.py
>>>>>> AVAILABILITY = (
>>>>>> ('Y', 'Available'),
>>>>>> ('N', 'Out of Stock'),
>>>>>> )
>>>>>>
>>>>>> SIZES = (
>>>>>> ('K', 'King - 108 x 120'),
>>>>>> ('Q', 'Queen - 90 x 108')
>>>>>> )
>>>>>> class Items(BaseModel):
>>>>>> title = models.CharField(max_length=100, null=True, blank=True)
>>>>>> price = models.FloatField(null=True, blank=True)
>>>>>> size = models.CharField(choices=SIZES, default=SIZES[0][0
>>>>>> ], max_length=1)
>>>>>> description = models.TextField(max_length=500)
>>>>>>

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Shailesh Yadav
in Html code


{{items_filter.form}}

 Search



Thanks & Regards
Shailesh Yadav
+91-9920886044

  [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>



On Wed, Jun 23, 2021 at 9:50 PM Shailesh Yadav 
wrote:

> Okay.
> If you using the Django filter then, please try like below in your views..
>
> abc_list = ModelName.objects.all()
> result_filter = ModelNameFilter(request.GET, queryset=abc_list)
>
> Thanks & Regards
> Shailesh Yadav
> +91-9920886044
>
>   [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>
>
>
> On Wed, Jun 23, 2021 at 9:13 PM Aritra Ray  wrote:
>
>> Sorry, it's not working. I tried items_filter.form but it didn't work.
>> Kindly check my views.py if that'll be of any help or require any changes.
>>
>>
>> On Wed, 23 Jun 2021 at 15:02, Shailesh Yadav 
>> wrote:
>>
>>> Okay use below in html
>>> {{yourmodelnameinsmall_filter.form}}
>>>
>>> Thanks & Regards
>>> Shailesh Yadav
>>> +91-9920886044
>>>
>>>   [image: Linkedin]
>>> <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>>>
>>>
>>>
>>> On Wed, Jun 23, 2021 at 2:58 PM Aritra Ray  wrote:
>>>
>>>> This isn't working. When we are supplying a filter, the html is
>>>> displaying all the products irrespective of the requested.
>>>>
>>>> On Wed, 23 Jun, 2021, 2:57 pm Shailesh Yadav, <
>>>> shaileshyadav7...@gmail.com> wrote:
>>>>
>>>>> Can you help with what ERROR you are getting?
>>>>>
>>>>> Thanks & Regards
>>>>> Shailesh Yadav
>>>>> +91-9920886044
>>>>>
>>>>>   [image: Linkedin]
>>>>> <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Jun 23, 2021 at 2:25 PM Aritra Ray 
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>> I've been trying to introduce a filter system in my Django-ecommerce
>>>>>> website and I've been struggling despite reading the documents, etc. I am
>>>>>> using 'django-filter' and below are filters.py, models.py, views.py and 
>>>>>> the
>>>>>> template. To check out the project, follow the github link:
>>>>>> https://github.com/First-project-01/Django-ecommerce.
>>>>>>
>>>>>> Will be grateful if anyone can sort this out. Thanks in advance.
>>>>>> Regards,
>>>>>> Aritra
>>>>>>
>>>>>> #filters.py
>>>>>> class ProductFilter(django_filters.FilterSet):
>>>>>> price = django_filters.NumberFilter()
>>>>>> price__gt = django_filters.NumberFilter(field_name='price'
>>>>>> , lookup_expr='gt')
>>>>>> price__lt = django_filters.NumberFilter(field_name='price'
>>>>>> , lookup_expr='lt')
>>>>>> class Meta:
>>>>>> model = Items
>>>>>> fields = ['size', 'availability']
>>>>>>
>>>>>> #views.py
>>>>>> class Product(ListView):
>>>>>> model = Items
>>>>>> paginate_by = 6
>>>>>> template_name = 'products.html'
>>>>>> def get_context_data(self, **kwargs):
>>>>>> context = super(Product, self).get_context_data(**kwargs)
>>>>>> context['filter'] = ProductFilter(self.request.GET, queryset=
>>>>>> self.get_queryset())
>>>>>> return context
>>>>>> #models.py
>>>>>> AVAILABILITY = (
>>>>>> ('Y', 'Available'),
>>>>>> ('N', 'Out of Stock'),
>>>>>> )
>>>>>>
>>>>>> SIZES = (
>>>>>> ('K', 'King - 108 x 120'),
>>>>>> ('Q', 'Queen - 90 x 108')
>>>>>> )
>>>>>> class Items(BaseModel):
>>>>>> title = models.CharField(max_length=100, null=True, blank=True)
>>>>>> price = models.FloatField(null=True, blank=True)
>>>>>> size = models.CharField(choices=SIZES, default=SIZES[0][0
>>>>>> ], max_length=1)
>>>>>> description = models.TextField(max_length=500)
>>>>>> availability

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Shailesh Yadav
Okay.
If you using the Django filter then, please try like below in your views..

abc_list = ModelName.objects.all()
result_filter = ModelNameFilter(request.GET, queryset=abc_list)

Thanks & Regards
Shailesh Yadav
+91-9920886044

  [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>



On Wed, Jun 23, 2021 at 9:13 PM Aritra Ray  wrote:

> Sorry, it's not working. I tried items_filter.form but it didn't work.
> Kindly check my views.py if that'll be of any help or require any changes.
>
>
> On Wed, 23 Jun 2021 at 15:02, Shailesh Yadav 
> wrote:
>
>> Okay use below in html
>> {{yourmodelnameinsmall_filter.form}}
>>
>> Thanks & Regards
>> Shailesh Yadav
>> +91-9920886044
>>
>>   [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>>
>>
>>
>>
>> On Wed, Jun 23, 2021 at 2:58 PM Aritra Ray  wrote:
>>
>>> This isn't working. When we are supplying a filter, the html is
>>> displaying all the products irrespective of the requested.
>>>
>>> On Wed, 23 Jun, 2021, 2:57 pm Shailesh Yadav, <
>>> shaileshyadav7...@gmail.com> wrote:
>>>
>>>> Can you help with what ERROR you are getting?
>>>>
>>>> Thanks & Regards
>>>> Shailesh Yadav
>>>> +91-9920886044
>>>>
>>>>   [image: Linkedin]
>>>> <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>>>>
>>>>
>>>>
>>>> On Wed, Jun 23, 2021 at 2:25 PM Aritra Ray  wrote:
>>>>
>>>>> Hi,
>>>>> I've been trying to introduce a filter system in my Django-ecommerce
>>>>> website and I've been struggling despite reading the documents, etc. I am
>>>>> using 'django-filter' and below are filters.py, models.py, views.py and 
>>>>> the
>>>>> template. To check out the project, follow the github link:
>>>>> https://github.com/First-project-01/Django-ecommerce.
>>>>>
>>>>> Will be grateful if anyone can sort this out. Thanks in advance.
>>>>> Regards,
>>>>> Aritra
>>>>>
>>>>> #filters.py
>>>>> class ProductFilter(django_filters.FilterSet):
>>>>> price = django_filters.NumberFilter()
>>>>> price__gt = django_filters.NumberFilter(field_name='price'
>>>>> , lookup_expr='gt')
>>>>> price__lt = django_filters.NumberFilter(field_name='price'
>>>>> , lookup_expr='lt')
>>>>> class Meta:
>>>>> model = Items
>>>>> fields = ['size', 'availability']
>>>>>
>>>>> #views.py
>>>>> class Product(ListView):
>>>>> model = Items
>>>>> paginate_by = 6
>>>>> template_name = 'products.html'
>>>>> def get_context_data(self, **kwargs):
>>>>> context = super(Product, self).get_context_data(**kwargs)
>>>>> context['filter'] = ProductFilter(self.request.GET, queryset=
>>>>> self.get_queryset())
>>>>> return context
>>>>> #models.py
>>>>> AVAILABILITY = (
>>>>> ('Y', 'Available'),
>>>>> ('N', 'Out of Stock'),
>>>>> )
>>>>>
>>>>> SIZES = (
>>>>> ('K', 'King - 108 x 120'),
>>>>> ('Q', 'Queen - 90 x 108')
>>>>> )
>>>>> class Items(BaseModel):
>>>>> title = models.CharField(max_length=100, null=True, blank=True)
>>>>> price = models.FloatField(null=True, blank=True)
>>>>> size = models.CharField(choices=SIZES, default=SIZES[0][0
>>>>> ], max_length=1)
>>>>> description = models.TextField(max_length=500)
>>>>> availability = models.CharField(choices=AVAILABILITY, default=
>>>>> AVAILABILITY[0][0], max_length=1)
>>>>> ...
>>>>>
>>>>> #product-list.html
>>>>> 
>>>>>  
>>>>> {{ filter.form| crispy }}
>>>>> Search
>>>>>  
>>>>> 
>>>>>
>>>>> --
>>>>> 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
&g

kindly i need a help

2021-06-23 Thread Richard Dushime
i am making a website using  django  and postgresql the  when i made a
migration and i created the tables then i i went  in the admin (django
administration ) everything was okay  the user and the data i can add and
manipulate all the data and get effect into the database  but  on my
webpages i am not seeing anything it is deseapiring
 this is my index.html file
  

  


  {{Abt.name}}
  {{Abt.desc}}



  

  

  
  

  {{Abt.title}}
  
{{Abt.desc2}}
  
  

 Ullamco laboris nisi ut aliquip ex ea commodo consequat.

 Duis aute irure dolor in reprehenderit in voluptate velit.

 Ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute
irure dolor in reprehenderit in voluptate trideta storacalaperda
mastiro dolore eu fugiat nulla pariatur.

  
  
Ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate
velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum
  

  


  




  


  {{service.title}}
  {{service.description}}



  

  
  {{service.name}}
  {{service.description1}}


-- 
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/CAJCm56LnoLUsxp-NSZuopNchdG7wAd5UOHxdyfjsfCR7RmMD3w%40mail.gmail.com.
from django.contrib import admin
from .models import Aboutus,Services

# Register your models here.
admin.site.register(Aboutus)
admin.site.register(Services)from os import name
from django.db import models

# Create your models here.

class Aboutus(models.Model):
name = models.CharField(max_length=100)
desc = models.TextField()
img = models.ImageField(upload_to='images')
title = models.CharField(max_length=200)
desc2 = models.TextField()

# services section
class Services(models.Model):
title = models.CharField(max_length=120)
description = models.TextField()
name = models.CharField(max_length=100)
description1 = models.TextField()from kampalavc.models import Aboutus, Services
from django.shortcuts import render

# Create your views here.

def index(request):

Abt = Aboutus.objects.all()
service = Services.objects.all()
kvc = [Abt,service]
return render(request, "index.html", {'kvc': kvc})from django.urls import path

from . import views

urlpatterns = [
path("", views.index, name="index")
]


Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Aritra Ray
Sorry, it's not working. I tried items_filter.form but it didn't work.
Kindly check my views.py if that'll be of any help or require any changes.


On Wed, 23 Jun 2021 at 15:02, Shailesh Yadav 
wrote:

> Okay use below in html
> {{yourmodelnameinsmall_filter.form}}
>
> Thanks & Regards
> Shailesh Yadav
> +91-9920886044
>
>   [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>
>
>
> On Wed, Jun 23, 2021 at 2:58 PM Aritra Ray  wrote:
>
>> This isn't working. When we are supplying a filter, the html is
>> displaying all the products irrespective of the requested.
>>
>> On Wed, 23 Jun, 2021, 2:57 pm Shailesh Yadav, <
>> shaileshyadav7...@gmail.com> wrote:
>>
>>> Can you help with what ERROR you are getting?
>>>
>>> Thanks & Regards
>>> Shailesh Yadav
>>> +91-9920886044
>>>
>>>   [image: Linkedin]
>>> <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>>>
>>>
>>>
>>> On Wed, Jun 23, 2021 at 2:25 PM Aritra Ray  wrote:
>>>
>>>> Hi,
>>>> I've been trying to introduce a filter system in my Django-ecommerce
>>>> website and I've been struggling despite reading the documents, etc. I am
>>>> using 'django-filter' and below are filters.py, models.py, views.py and the
>>>> template. To check out the project, follow the github link:
>>>> https://github.com/First-project-01/Django-ecommerce.
>>>>
>>>> Will be grateful if anyone can sort this out. Thanks in advance.
>>>> Regards,
>>>> Aritra
>>>>
>>>> #filters.py
>>>> class ProductFilter(django_filters.FilterSet):
>>>> price = django_filters.NumberFilter()
>>>> price__gt = django_filters.NumberFilter(field_name='price'
>>>> , lookup_expr='gt')
>>>> price__lt = django_filters.NumberFilter(field_name='price'
>>>> , lookup_expr='lt')
>>>> class Meta:
>>>> model = Items
>>>> fields = ['size', 'availability']
>>>>
>>>> #views.py
>>>> class Product(ListView):
>>>> model = Items
>>>> paginate_by = 6
>>>> template_name = 'products.html'
>>>> def get_context_data(self, **kwargs):
>>>> context = super(Product, self).get_context_data(**kwargs)
>>>> context['filter'] = ProductFilter(self.request.GET, queryset=
>>>> self.get_queryset())
>>>> return context
>>>> #models.py
>>>> AVAILABILITY = (
>>>> ('Y', 'Available'),
>>>> ('N', 'Out of Stock'),
>>>> )
>>>>
>>>> SIZES = (
>>>> ('K', 'King - 108 x 120'),
>>>> ('Q', 'Queen - 90 x 108')
>>>> )
>>>> class Items(BaseModel):
>>>> title = models.CharField(max_length=100, null=True, blank=True)
>>>> price = models.FloatField(null=True, blank=True)
>>>> size = models.CharField(choices=SIZES, default=SIZES[0][0
>>>> ], max_length=1)
>>>> description = models.TextField(max_length=500)
>>>> availability = models.CharField(choices=AVAILABILITY, default=
>>>> AVAILABILITY[0][0], max_length=1)
>>>> ...
>>>>
>>>> #product-list.html
>>>> 
>>>>  
>>>> {{ filter.form| crispy }}
>>>> Search
>>>>  
>>>> 
>>>>
>>>> --
>>>> 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/CAFecadtwZG0%3DLwE989gsFkusgAnAGkvEspF3i5WC1-uWO6OOHw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAFecadtwZG0%3DLwE989gsFkusgAnAGkvEspF3i5WC1-uWO6OOHw%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 w

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Aritra Ray
Okay, will try and let you know.
Thank you for your response.

On Wed, 23 Jun, 2021, 3:02 pm Shailesh Yadav, 
wrote:

> Okay use below in html
> {{yourmodelnameinsmall_filter.form}}
>
> Thanks & Regards
> Shailesh Yadav
> +91-9920886044
>
>   [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>
>
>
> On Wed, Jun 23, 2021 at 2:58 PM Aritra Ray  wrote:
>
>> This isn't working. When we are supplying a filter, the html is
>> displaying all the products irrespective of the requested.
>>
>> On Wed, 23 Jun, 2021, 2:57 pm Shailesh Yadav, <
>> shaileshyadav7...@gmail.com> wrote:
>>
>>> Can you help with what ERROR you are getting?
>>>
>>> Thanks & Regards
>>> Shailesh Yadav
>>> +91-9920886044
>>>
>>>   [image: Linkedin]
>>> <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>>>
>>>
>>>
>>> On Wed, Jun 23, 2021 at 2:25 PM Aritra Ray  wrote:
>>>
>>>> Hi,
>>>> I've been trying to introduce a filter system in my Django-ecommerce
>>>> website and I've been struggling despite reading the documents, etc. I am
>>>> using 'django-filter' and below are filters.py, models.py, views.py and the
>>>> template. To check out the project, follow the github link:
>>>> https://github.com/First-project-01/Django-ecommerce.
>>>>
>>>> Will be grateful if anyone can sort this out. Thanks in advance.
>>>> Regards,
>>>> Aritra
>>>>
>>>> #filters.py
>>>> class ProductFilter(django_filters.FilterSet):
>>>> price = django_filters.NumberFilter()
>>>> price__gt = django_filters.NumberFilter(field_name='price'
>>>> , lookup_expr='gt')
>>>> price__lt = django_filters.NumberFilter(field_name='price'
>>>> , lookup_expr='lt')
>>>> class Meta:
>>>> model = Items
>>>> fields = ['size', 'availability']
>>>>
>>>> #views.py
>>>> class Product(ListView):
>>>> model = Items
>>>> paginate_by = 6
>>>> template_name = 'products.html'
>>>> def get_context_data(self, **kwargs):
>>>> context = super(Product, self).get_context_data(**kwargs)
>>>> context['filter'] = ProductFilter(self.request.GET, queryset=
>>>> self.get_queryset())
>>>> return context
>>>> #models.py
>>>> AVAILABILITY = (
>>>> ('Y', 'Available'),
>>>> ('N', 'Out of Stock'),
>>>> )
>>>>
>>>> SIZES = (
>>>> ('K', 'King - 108 x 120'),
>>>> ('Q', 'Queen - 90 x 108')
>>>> )
>>>> class Items(BaseModel):
>>>> title = models.CharField(max_length=100, null=True, blank=True)
>>>> price = models.FloatField(null=True, blank=True)
>>>> size = models.CharField(choices=SIZES, default=SIZES[0][0
>>>> ], max_length=1)
>>>> description = models.TextField(max_length=500)
>>>> availability = models.CharField(choices=AVAILABILITY, default=
>>>> AVAILABILITY[0][0], max_length=1)
>>>> ...
>>>>
>>>> #product-list.html
>>>> 
>>>>  
>>>> {{ filter.form| crispy }}
>>>> Search
>>>>  
>>>> 
>>>>
>>>> --
>>>> 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/CAFecadtwZG0%3DLwE989gsFkusgAnAGkvEspF3i5WC1-uWO6OOHw%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAFecadtwZG0%3DLwE989gsFkusgAnAGkvEspF3i5WC1-uWO6OOHw%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/djan

Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Shailesh Yadav
Okay use below in html
{{yourmodelnameinsmall_filter.form}}

Thanks & Regards
Shailesh Yadav
+91-9920886044

  [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>



On Wed, Jun 23, 2021 at 2:58 PM Aritra Ray  wrote:

> This isn't working. When we are supplying a filter, the html is displaying
> all the products irrespective of the requested.
>
> On Wed, 23 Jun, 2021, 2:57 pm Shailesh Yadav, 
> wrote:
>
>> Can you help with what ERROR you are getting?
>>
>> Thanks & Regards
>> Shailesh Yadav
>> +91-9920886044
>>
>>   [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>>
>>
>>
>>
>> On Wed, Jun 23, 2021 at 2:25 PM Aritra Ray  wrote:
>>
>>> Hi,
>>> I've been trying to introduce a filter system in my Django-ecommerce
>>> website and I've been struggling despite reading the documents, etc. I am
>>> using 'django-filter' and below are filters.py, models.py, views.py and the
>>> template. To check out the project, follow the github link:
>>> https://github.com/First-project-01/Django-ecommerce.
>>>
>>> Will be grateful if anyone can sort this out. Thanks in advance.
>>> Regards,
>>> Aritra
>>>
>>> #filters.py
>>> class ProductFilter(django_filters.FilterSet):
>>> price = django_filters.NumberFilter()
>>> price__gt = django_filters.NumberFilter(field_name='price'
>>> , lookup_expr='gt')
>>> price__lt = django_filters.NumberFilter(field_name='price'
>>> , lookup_expr='lt')
>>> class Meta:
>>> model = Items
>>> fields = ['size', 'availability']
>>>
>>> #views.py
>>> class Product(ListView):
>>> model = Items
>>> paginate_by = 6
>>> template_name = 'products.html'
>>> def get_context_data(self, **kwargs):
>>> context = super(Product, self).get_context_data(**kwargs)
>>> context['filter'] = ProductFilter(self.request.GET, queryset=
>>> self.get_queryset())
>>> return context
>>> #models.py
>>> AVAILABILITY = (
>>> ('Y', 'Available'),
>>> ('N', 'Out of Stock'),
>>> )
>>>
>>> SIZES = (
>>> ('K', 'King - 108 x 120'),
>>> ('Q', 'Queen - 90 x 108')
>>> )
>>> class Items(BaseModel):
>>> title = models.CharField(max_length=100, null=True, blank=True)
>>> price = models.FloatField(null=True, blank=True)
>>> size = models.CharField(choices=SIZES, default=SIZES[0][0
>>> ], max_length=1)
>>> description = models.TextField(max_length=500)
>>> availability = models.CharField(choices=AVAILABILITY, default=
>>> AVAILABILITY[0][0], max_length=1)
>>> ...
>>>
>>> #product-list.html
>>> 
>>>  
>>> {{ filter.form| crispy }}
>>> Search
>>>  
>>> 
>>>
>>> --
>>> 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/CAFecadtwZG0%3DLwE989gsFkusgAnAGkvEspF3i5WC1-uWO6OOHw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAFecadtwZG0%3DLwE989gsFkusgAnAGkvEspF3i5WC1-uWO6OOHw%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/CAMQ-AEXsJ%2B19X3aO740%3DD%2BZUhcEYujh2FWScZDXCqM4cB0Bikg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAMQ-AEXsJ%2B19X3aO740%3DD%2BZUhcEYujh2FWScZDXCqM4cB0Bikg%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/CAFecaduw28greFLXGqsTuit5JmCrzfHqawOU9HKvoojfXQLYtg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFecaduw28greFLXGqsTuit5JmCrzfHqawOU9HKvoojfXQLYtg%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/CAMQ-AEXrqujnhn3q_629ZyjCbrS31j7mtqAt9br0psKPSB53dQ%40mail.gmail.com.


Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Aritra Ray
This isn't working. When we are supplying a filter, the html is displaying
all the products irrespective of the requested.

On Wed, 23 Jun, 2021, 2:57 pm Shailesh Yadav, 
wrote:

> Can you help with what ERROR you are getting?
>
> Thanks & Regards
> Shailesh Yadav
> +91-9920886044
>
>   [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>
>
>
>
> On Wed, Jun 23, 2021 at 2:25 PM Aritra Ray  wrote:
>
>> Hi,
>> I've been trying to introduce a filter system in my Django-ecommerce
>> website and I've been struggling despite reading the documents, etc. I am
>> using 'django-filter' and below are filters.py, models.py, views.py and the
>> template. To check out the project, follow the github link:
>> https://github.com/First-project-01/Django-ecommerce.
>>
>> Will be grateful if anyone can sort this out. Thanks in advance.
>> Regards,
>> Aritra
>>
>> #filters.py
>> class ProductFilter(django_filters.FilterSet):
>> price = django_filters.NumberFilter()
>> price__gt = django_filters.NumberFilter(field_name='price'
>> , lookup_expr='gt')
>> price__lt = django_filters.NumberFilter(field_name='price'
>> , lookup_expr='lt')
>> class Meta:
>> model = Items
>> fields = ['size', 'availability']
>>
>> #views.py
>> class Product(ListView):
>> model = Items
>> paginate_by = 6
>> template_name = 'products.html'
>> def get_context_data(self, **kwargs):
>> context = super(Product, self).get_context_data(**kwargs)
>> context['filter'] = ProductFilter(self.request.GET, queryset=self
>> .get_queryset())
>> return context
>> #models.py
>> AVAILABILITY = (
>> ('Y', 'Available'),
>> ('N', 'Out of Stock'),
>> )
>>
>> SIZES = (
>> ('K', 'King - 108 x 120'),
>> ('Q', 'Queen - 90 x 108')
>> )
>> class Items(BaseModel):
>> title = models.CharField(max_length=100, null=True, blank=True)
>> price = models.FloatField(null=True, blank=True)
>> size = models.CharField(choices=SIZES, default=SIZES[0][0
>> ], max_length=1)
>> description = models.TextField(max_length=500)
>> availability = models.CharField(choices=AVAILABILITY, default=
>> AVAILABILITY[0][0], max_length=1)
>> ...
>>
>> #product-list.html
>> 
>>  
>> {{ filter.form| crispy }}
>> Search
>>  
>> 
>>
>> --
>> 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/CAFecadtwZG0%3DLwE989gsFkusgAnAGkvEspF3i5WC1-uWO6OOHw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAFecadtwZG0%3DLwE989gsFkusgAnAGkvEspF3i5WC1-uWO6OOHw%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/CAMQ-AEXsJ%2B19X3aO740%3DD%2BZUhcEYujh2FWScZDXCqM4cB0Bikg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMQ-AEXsJ%2B19X3aO740%3DD%2BZUhcEYujh2FWScZDXCqM4cB0Bikg%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/CAFecaduw28greFLXGqsTuit5JmCrzfHqawOU9HKvoojfXQLYtg%40mail.gmail.com.


Re: Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Shailesh Yadav
Can you help with what ERROR you are getting?

Thanks & Regards
Shailesh Yadav
+91-9920886044

  [image: Linkedin] <https://in.linkedin.com/in/shailesh-yadav-b7ab89110>



On Wed, Jun 23, 2021 at 2:25 PM Aritra Ray  wrote:

> Hi,
> I've been trying to introduce a filter system in my Django-ecommerce
> website and I've been struggling despite reading the documents, etc. I am
> using 'django-filter' and below are filters.py, models.py, views.py and the
> template. To check out the project, follow the github link:
> https://github.com/First-project-01/Django-ecommerce.
>
> Will be grateful if anyone can sort this out. Thanks in advance.
> Regards,
> Aritra
>
> #filters.py
> class ProductFilter(django_filters.FilterSet):
> price = django_filters.NumberFilter()
> price__gt = django_filters.NumberFilter(field_name='price'
> , lookup_expr='gt')
> price__lt = django_filters.NumberFilter(field_name='price'
> , lookup_expr='lt')
> class Meta:
> model = Items
> fields = ['size', 'availability']
>
> #views.py
> class Product(ListView):
> model = Items
> paginate_by = 6
> template_name = 'products.html'
> def get_context_data(self, **kwargs):
> context = super(Product, self).get_context_data(**kwargs)
> context['filter'] = ProductFilter(self.request.GET, queryset=self.
> get_queryset())
> return context
> #models.py
> AVAILABILITY = (
> ('Y', 'Available'),
> ('N', 'Out of Stock'),
> )
>
> SIZES = (
> ('K', 'King - 108 x 120'),
> ('Q', 'Queen - 90 x 108')
> )
> class Items(BaseModel):
> title = models.CharField(max_length=100, null=True, blank=True)
> price = models.FloatField(null=True, blank=True)
> size = models.CharField(choices=SIZES, default=SIZES[0][0], max_length
> =1)
> description = models.TextField(max_length=500)
> availability = models.CharField(choices=AVAILABILITY, default=
> AVAILABILITY[0][0], max_length=1)
> ...
>
> #product-list.html
> 
>  
> {{ filter.form| crispy }}
> Search
>  
> 
>
> --
> 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/CAFecadtwZG0%3DLwE989gsFkusgAnAGkvEspF3i5WC1-uWO6OOHw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAFecadtwZG0%3DLwE989gsFkusgAnAGkvEspF3i5WC1-uWO6OOHw%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/CAMQ-AEXsJ%2B19X3aO740%3DD%2BZUhcEYujh2FWScZDXCqM4cB0Bikg%40mail.gmail.com.


Need urgent help with filter system (django-filter) in Django

2021-06-23 Thread Aritra Ray
Hi,
I've been trying to introduce a filter system in my Django-ecommerce
website and I've been struggling despite reading the documents, etc. I am
using 'django-filter' and below are filters.py, models.py, views.py and the
template. To check out the project, follow the github link:
https://github.com/First-project-01/Django-ecommerce.

Will be grateful if anyone can sort this out. Thanks in advance.
Regards,
Aritra

#filters.py
class ProductFilter(django_filters.FilterSet):
price = django_filters.NumberFilter()
price__gt = django_filters.NumberFilter(field_name='price', lookup_expr=
'gt')
price__lt = django_filters.NumberFilter(field_name='price', lookup_expr=
'lt')
class Meta:
model = Items
fields = ['size', 'availability']

#views.py
class Product(ListView):
model = Items
paginate_by = 6
template_name = 'products.html'
def get_context_data(self, **kwargs):
context = super(Product, self).get_context_data(**kwargs)
context['filter'] = ProductFilter(self.request.GET, queryset=self.
get_queryset())
return context
#models.py
AVAILABILITY = (
('Y', 'Available'),
('N', 'Out of Stock'),
)

SIZES = (
('K', 'King - 108 x 120'),
('Q', 'Queen - 90 x 108')
)
class Items(BaseModel):
title = models.CharField(max_length=100, null=True, blank=True)
price = models.FloatField(null=True, blank=True)
size = models.CharField(choices=SIZES, default=SIZES[0][0], max_length=1
)
description = models.TextField(max_length=500)
availability = models.CharField(choices=AVAILABILITY, default=
AVAILABILITY[0][0], max_length=1)
...

#product-list.html

 
{{ filter.form| crispy }}
Search
 


-- 
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/CAFecadtwZG0%3DLwE989gsFkusgAnAGkvEspF3i5WC1-uWO6OOHw%40mail.gmail.com.


Re: In need of urgent help regarding dynamic image display v

2021-06-23 Thread Aritra Ray
Thank you, it worked.


On Fri, 18 Jun 2021 at 00:08, Ayush Bisht  wrote:

> I think there is 2 method which you can do to get the work done. ...
>
> *1 : first one* .. you can declare a property decorator which just return
> the url of that image
>
>
>   class Banner(BaseModel):
> image = ResizedImageField(upload_to="banner", null=True,
> blank=True)
>
> @property
>   def get_image_url(self):
>   return str(self.image.url).replace(" ", "")
>
> and then you can simply access this function like normal attributes..
>
>  
> {% for banner in banners %}
> 
> {% endfor %}
>
> 
>
>
> *2 Method :  *you can create a   root path for static files as well
>
>
> STATIC_URL = '/static/'
> STATICFILES_DIRS = [os.path.join(BASE_DIR,'static')]
>
>
> now , with this root path I can access all the file belonging to that
> particular folder 
>
> folder structure ...
>
> * static
>*Banner
>  *banner1.jpg
>
>
>
> now u can simply access all the stuff ...
>
> .banner-item-01 {
> padding:300px 0px;
> background-size: cover;
> background-image: url('/static/Banner/banner1.jpg');
> background-repeat: no-repeat;
> background-position: center center;
> }
>
> On Thursday, June 17, 2021 at 4:11:11 AM UTC-7 arit...@gmail.com wrote:
>
>> Hi,
>> I've been building a Django E-commerce website and I'm facing this
>> problem.
>> I have created a Banner model which will take in images via
>> django.ResizedImage and then display it in the homepage. But I'm unable to
>> process them in CSS.
>> Kindly help me out.
>>
>> PS: I'll have to process it as background-image orelse when passed as
>>  in html, we're getting extra wrapped spaces which aren't needed.
>>
>> Below given are: views.py, models.py, index.html, css block.
>> Kindly help me out as it is urgent. Thank you for your support in advance.
>>
>> Regards,
>> Aritra
>>
>> class HomeView(ListView):
>> context_object_name = 'items'
>> template_name = "index.html"
>> queryset = Items.objects.all()
>>
>> def get_context_data(self, **kwargs):
>> context = super(HomeView, self).get_context_data(**kwargs)
>> context['banners'] = Banner.objects.all()
>> return context
>>
>> class Banner(BaseModel):
>> image = ResizedImageField(upload_to="banner", null=True, blank=True)
>>
>> 
>> 
>>   {% for banner in banners %}
>> > {{banner.image.url}}>
>>   {% endfor %}
>> 
>> 
>>
>>   .banner-item-01 {
>>padding:300px 0px;
>>background-size: cover;
>>background-image: url(var(--item));
>>background-repeat: no-repeat;
>>background-position: center center;
>> }
>>
>>
>> --
> 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/241a1f08-a093-4f3a-a01f-46e0a3e73ce1n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/241a1f08-a093-4f3a-a01f-46e0a3e73ce1n%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/CAFecadu_Gjnr4nzRV_GEkfCpG%3DGWP%3DaNKoR0yZxqzqk8cE3MGQ%40mail.gmail.com.


Re: Help me Please - Django and python program

2021-06-22 Thread mayank sandikar
Sure sir thank you  again

On Wed, Jun 23, 2021 at 8:10 AM DJANGO DEVELOPER 
wrote:

> +923012876771, you can send me your queries here.
>
> On Wed, Jun 23, 2021 at 7:39 AM DJANGO DEVELOPER 
> wrote:
>
>> is it resolved now? or still want some help?
>>
>> On Tue, Jun 22, 2021 at 9:44 PM mayank sandikar <
>> mayanksandikar191...@gmail.com> wrote:
>>
>>> Thank you sir, sorry for all the troubles.
>>>
>>> On Tue, Jun 22, 2021 at 4:41 PM DJANGO DEVELOPER <
>>> abubakarbr...@gmail.com> wrote:
>>>
>>>> request.FILES used when we need to insert images as well. if there is
>>>> no image field then remove the request.FILES.
>>>>
>>>> On Tue, Jun 22, 2021 at 4:10 PM DJANGO DEVELOPER <
>>>> abubakarbr...@gmail.com> wrote:
>>>>
>>>>> follow this code's pattern but remember one thing that you have to
>>>>> follow it according to your needs.
>>>>>
>>>>> On Tue, Jun 22, 2021 at 4:10 PM DJANGO DEVELOPER <
>>>>> abubakarbr...@gmail.com> wrote:
>>>>>
>>>>>> def insetdata(request):
>>>>>> product_form = your_product_form()
>>>>>> if request.method == 'POST':
>>>>>> product_form = your_product_form(request.POST, request.FILES)
>>>>>> if product_form.is_valid:
>>>>>> product_form.save()
>>>>>> return redirect('put your product's url name value here')
>>>>>> return render(request, 'your template path here',
>>>>>> {'product':product_form})
>>>>>>
>>>>>> On Tue, Jun 22, 2021 at 3:59 PM mayank sandikar <
>>>>>> mayanksandikar191...@gmail.com> wrote:
>>>>>>
>>>>>>> Thank you sir, the html problem is solved, but I don't know how to
>>>>>>> insert itemname, quantity and rate in the database
>>>>>>>
>>>>>>> On Tue, Jun 22, 2021 at 4:15 PM DJANGO DEVELOPER <
>>>>>>> abubakarbr...@gmail.com> wrote:
>>>>>>>
>>>>>>>> is your code working now?
>>>>>>>>
>>>>>>>> On Tue, Jun 22, 2021 at 3:32 PM DJANGO DEVELOPER <
>>>>>>>> abubakarbr...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> First of all please remove the for loop from your form.
>>>>>>>>> secondly please add{{displayemp.userquantity_field}}
>>>>>>>>>   {{displayemp.amount_field}} 
>>>>>>>>>
>>>>>>>>> On Tue, Jun 22, 2021 at 3:27 PM mayank sandikar <
>>>>>>>>> mayanksandikar191...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> view.py
>>>>>>>>>> def displaydata(request):
>>>>>>>>>>results = editupdaterecord.objects.all()
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>if request.method=='POST':
>>>>>>>>>>  if request.POST.get('userquantity')  :
>>>>>>>>>>  quantity = request.POST.get('userquantity')
>>>>>>>>>>  a = editupdaterecord.objects.all()
>>>>>>>>>>  print(a)
>>>>>>>>>>#  if results in a < quantity:
>>>>>>>>>>  saverecord = editupdaterecord(userquantity = quantity)
>>>>>>>>>>  saverecord.save()
>>>>>>>>>>
>>>>>>>>>>return render(request , 'index.html' ,{"editupdaterecord"
>>>>>>>>>> :results})
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Tue, Jun 22, 2021 at 3:55 PM mayank sandikar <
>>>>>>>>>> mayanksandikar191...@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> my index.html is
>>>>>>>>>>>
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>>  Edit 
>>>>>>>>>>> 
>>>>>>>>>>> .button

Re: Help me Please - Django and python program

2021-06-22 Thread DJANGO DEVELOPER
+923012876771, you can send me your queries here.

On Wed, Jun 23, 2021 at 7:39 AM DJANGO DEVELOPER 
wrote:

> is it resolved now? or still want some help?
>
> On Tue, Jun 22, 2021 at 9:44 PM mayank sandikar <
> mayanksandikar191...@gmail.com> wrote:
>
>> Thank you sir, sorry for all the troubles.
>>
>> On Tue, Jun 22, 2021 at 4:41 PM DJANGO DEVELOPER 
>> wrote:
>>
>>> request.FILES used when we need to insert images as well. if there is no
>>> image field then remove the request.FILES.
>>>
>>> On Tue, Jun 22, 2021 at 4:10 PM DJANGO DEVELOPER <
>>> abubakarbr...@gmail.com> wrote:
>>>
>>>> follow this code's pattern but remember one thing that you have to
>>>> follow it according to your needs.
>>>>
>>>> On Tue, Jun 22, 2021 at 4:10 PM DJANGO DEVELOPER <
>>>> abubakarbr...@gmail.com> wrote:
>>>>
>>>>> def insetdata(request):
>>>>> product_form = your_product_form()
>>>>> if request.method == 'POST':
>>>>> product_form = your_product_form(request.POST, request.FILES)
>>>>> if product_form.is_valid:
>>>>> product_form.save()
>>>>> return redirect('put your product's url name value here')
>>>>> return render(request, 'your template path here',
>>>>> {'product':product_form})
>>>>>
>>>>> On Tue, Jun 22, 2021 at 3:59 PM mayank sandikar <
>>>>> mayanksandikar191...@gmail.com> wrote:
>>>>>
>>>>>> Thank you sir, the html problem is solved, but I don't know how to
>>>>>> insert itemname, quantity and rate in the database
>>>>>>
>>>>>> On Tue, Jun 22, 2021 at 4:15 PM DJANGO DEVELOPER <
>>>>>> abubakarbr...@gmail.com> wrote:
>>>>>>
>>>>>>> is your code working now?
>>>>>>>
>>>>>>> On Tue, Jun 22, 2021 at 3:32 PM DJANGO DEVELOPER <
>>>>>>> abubakarbr...@gmail.com> wrote:
>>>>>>>
>>>>>>>> First of all please remove the for loop from your form.
>>>>>>>> secondly please add{{displayemp.userquantity_field}}
>>>>>>>>   {{displayemp.amount_field}} 
>>>>>>>>
>>>>>>>> On Tue, Jun 22, 2021 at 3:27 PM mayank sandikar <
>>>>>>>> mayanksandikar191...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> view.py
>>>>>>>>> def displaydata(request):
>>>>>>>>>results = editupdaterecord.objects.all()
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>if request.method=='POST':
>>>>>>>>>  if request.POST.get('userquantity')  :
>>>>>>>>>  quantity = request.POST.get('userquantity')
>>>>>>>>>  a = editupdaterecord.objects.all()
>>>>>>>>>  print(a)
>>>>>>>>>#  if results in a < quantity:
>>>>>>>>>  saverecord = editupdaterecord(userquantity = quantity)
>>>>>>>>>  saverecord.save()
>>>>>>>>>
>>>>>>>>>return render(request , 'index.html' ,{"editupdaterecord"
>>>>>>>>> :results})
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, Jun 22, 2021 at 3:55 PM mayank sandikar <
>>>>>>>>> mayanksandikar191...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> my index.html is
>>>>>>>>>>
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>>  Edit 
>>>>>>>>>> 
>>>>>>>>>> .button {
>>>>>>>>>>   border: none;
>>>>>>>>>>   color: black;
>>>>>>>>>>   padding: 15px 32px;
>>>>>>>>>>   text-align: center;
>>>>>>>>>>   text-decoration: none;
>>>>>>>>>>   display: inline-block;
>>>>>>>>>>   font-size: 16px;
>>>>>>>>>>   margin:

Re: Help me Please - Django and python program

2021-06-22 Thread DJANGO DEVELOPER
is it resolved now? or still want some help?

On Tue, Jun 22, 2021 at 9:44 PM mayank sandikar <
mayanksandikar191...@gmail.com> wrote:

> Thank you sir, sorry for all the troubles.
>
> On Tue, Jun 22, 2021 at 4:41 PM DJANGO DEVELOPER 
> wrote:
>
>> request.FILES used when we need to insert images as well. if there is no
>> image field then remove the request.FILES.
>>
>> On Tue, Jun 22, 2021 at 4:10 PM DJANGO DEVELOPER 
>> wrote:
>>
>>> follow this code's pattern but remember one thing that you have to
>>> follow it according to your needs.
>>>
>>> On Tue, Jun 22, 2021 at 4:10 PM DJANGO DEVELOPER <
>>> abubakarbr...@gmail.com> wrote:
>>>
>>>> def insetdata(request):
>>>> product_form = your_product_form()
>>>> if request.method == 'POST':
>>>> product_form = your_product_form(request.POST, request.FILES)
>>>> if product_form.is_valid:
>>>> product_form.save()
>>>> return redirect('put your product's url name value here')
>>>> return render(request, 'your template path here',
>>>> {'product':product_form})
>>>>
>>>> On Tue, Jun 22, 2021 at 3:59 PM mayank sandikar <
>>>> mayanksandikar191...@gmail.com> wrote:
>>>>
>>>>> Thank you sir, the html problem is solved, but I don't know how to
>>>>> insert itemname, quantity and rate in the database
>>>>>
>>>>> On Tue, Jun 22, 2021 at 4:15 PM DJANGO DEVELOPER <
>>>>> abubakarbr...@gmail.com> wrote:
>>>>>
>>>>>> is your code working now?
>>>>>>
>>>>>> On Tue, Jun 22, 2021 at 3:32 PM DJANGO DEVELOPER <
>>>>>> abubakarbr...@gmail.com> wrote:
>>>>>>
>>>>>>> First of all please remove the for loop from your form.
>>>>>>> secondly please add{{displayemp.userquantity_field}}
>>>>>>>   {{displayemp.amount_field}} 
>>>>>>>
>>>>>>> On Tue, Jun 22, 2021 at 3:27 PM mayank sandikar <
>>>>>>> mayanksandikar191...@gmail.com> wrote:
>>>>>>>
>>>>>>>> view.py
>>>>>>>> def displaydata(request):
>>>>>>>>results = editupdaterecord.objects.all()
>>>>>>>>
>>>>>>>>
>>>>>>>>if request.method=='POST':
>>>>>>>>  if request.POST.get('userquantity')  :
>>>>>>>>  quantity = request.POST.get('userquantity')
>>>>>>>>  a = editupdaterecord.objects.all()
>>>>>>>>  print(a)
>>>>>>>>#  if results in a < quantity:
>>>>>>>>  saverecord = editupdaterecord(userquantity = quantity)
>>>>>>>>  saverecord.save()
>>>>>>>>
>>>>>>>>return render(request , 'index.html' ,{"editupdaterecord"
>>>>>>>> :results})
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Jun 22, 2021 at 3:55 PM mayank sandikar <
>>>>>>>> mayanksandikar191...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> my index.html is
>>>>>>>>>
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>>  Edit 
>>>>>>>>> 
>>>>>>>>> .button {
>>>>>>>>>   border: none;
>>>>>>>>>   color: black;
>>>>>>>>>   padding: 15px 32px;
>>>>>>>>>   text-align: center;
>>>>>>>>>   text-decoration: none;
>>>>>>>>>   display: inline-block;
>>>>>>>>>   font-size: 16px;
>>>>>>>>>   margin: 4px 2px;
>>>>>>>>>   cursor: pointer;
>>>>>>>>>
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> .button2 {background-color: #008CBA;}
>>>>>>>>>
>>>>>>>>> 
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 
>>>>>>>>> 
>>>>>>

Re: Help me Please - Django and python program

2021-06-22 Thread mayank sandikar
amount
>>>>>>>>   
>>>>>>>>
>>>>>>>>   {% for displayemp in editupdaterecord%}
>>>>>>>>   
>>>>>>>>   {{displayemp.id}}
>>>>>>>>   {{displayemp.Itemname}}
>>>>>>>>   {{displayemp.quantity}} 
>>>>>>>>{{displayemp.rate}} 
>>>>>>>>   {{displayemp.basicamount}} 
>>>>>>>>
>>>>>>>>   
>>>>>>>>{% endfor %}
>>>>>>>>
>>>>>>>>
>>>>>>>>   
>>>>>>>>  {% csrf_token %}
>>>>>>>>
>>>>>>>> 
>>>>>>>>   
>>>>>>>> ID
>>>>>>>> Itemname
>>>>>>>> Quantity
>>>>>>>>
>>>>>>>> userquantity
>>>>>>>> amount
>>>>>>>>   
>>>>>>>>
>>>>>>>>   {% for displayemp in editupdaterecord%}
>>>>>>>>   
>>>>>>>>   {{displayemp.id}}
>>>>>>>>   {{displayemp.Itemname}}
>>>>>>>>   {{displayemp.quantity}} 
>>>>>>>>
>>>>>>>>
>>>>>>>>   
>>>>>>>>
>>>>>>>>{% csrf_token %}
>>>>>>>>   >>>>>>> value="{{editupdaterecord.userquantity}}"   >
>>>>>>>>{{displayemp.amount2}} 
>>>>>>>>   
>>>>>>>>{% endfor %}
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 
>>>>>>>>
>>>>>>>> Add
>>>>>>>>
>>>>>>>>
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Jun 22, 2021 at 3:49 PM mayank sandikar <
>>>>>>>> mayanksandikar191...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hello sir,
>>>>>>>>> I'm trying to insert the data in the table. For example in
>>>>>>>>> database
>>>>>>>>> Itemname quantity price user-quantity amount
>>>>>>>>> pen20  5   00
>>>>>>>>> book  20 10  00
>>>>>>>>>
>>>>>>>>> in my database I'm getting this result
>>>>>>>>> pen20  5   00
>>>>>>>>> book  20 10  00
>>>>>>>>>  20
>>>>>>>>>
>>>>>>>>> I want to take the itemname, quantity, and price in the last row
>>>>>>>>> as well.
>>>>>>>>> In my html front view (screenshot 50) only the last text box is
>>>>>>>>> active in the user quantity column.
>>>>>>>>>
>>>>>>>>> please help me.
>>>>>>>>> thank you
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Tue, Jun 22, 2021 at 2:58 PM DJANGO DEVELOPER <
>>>>>>>>> abubakarbr...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> according to your code, you're trying to update the product
>>>>>>>>>> record. right?
>>>>>>>>>> If so, then you're doing things the right way.
>>>>>>>>>>
>>>>>>>>>> On Tue, Jun 22, 2021 at 9:50 AM mayank sandikar <
>>>>>>>>>

Re: Help me - Django and python

2021-06-22 Thread DJANGO DEVELOPER
have you removed for loop from your form?

On Tue, Jun 22, 2021 at 8:33 PM DJANGO DEVELOPER 
wrote:

> because it is necessary to write when there are no more conditions left.
>
> On Tue, Jun 22, 2021 at 6:31 PM avdesh sharma 
> wrote:
>
>> what will happen if I change from elif to else ?
>> FYI - I checked it but still getting same error.
>>
>> On Tue, Jun 22, 2021 at 2:51 PM DJANGO DEVELOPER 
>> wrote:
>>
>>> your index.html
>>>
>>> 
>>> PASSWORD
>>> >> class="form-control" name="password" placeholder="Enter Password">
>>> 
>>> 
>>> {% if login == 'inactive' %}
>>> User Inactive! Contact 
>>> Admin!
>>> {% elif login == 'invalid' %}
>>> line 32 username or password 
>>> Invalid
>>> {% endif%}
>>> {% if tab_error == True %}
>>> Invalid Tab Selected
>>> {% endif %}
>>>
>>>
>>>
>>> changed index.html
>>>
>>> 
>>> PASSWORD
>>> >> class="form-control" name="password" placeholder="Enter Password" 
>>> value="{{login.password_field}}">
>>> 
>>> 
>>> {% if login == 'inactive' %}
>>> User Inactive! Contact 
>>> Admin!
>>> {% else %}
>>> line 32 username or password 
>>> Invalid
>>> {% endif%}
>>> {% if tab_error == True %}
>>> Invalid Tab Selected
>>> {% endif %}
>>>
>>>
>>> On Tue, Jun 22, 2021 at 2:16 PM DJANGO DEVELOPER <
>>> abubakarbr...@gmail.com> wrote:
>>>
 by seeing your code, it seems that only the 'else' part is working.
 have you provided value='{{dict_key.model_password_field}} in your html
 input element?

 On Tue, Jun 22, 2021 at 12:52 PM avdesh sharma <
 avdeshsharma...@gmail.com> wrote:

> Here is my View.py code
>
> from django.shortcuts import render
> from django.http import HttpResponseRedirect
> from django.urls import reverse
> from django.contrib.auth import authenticate, logout, login
> from django.contrib.auth.decorators import login_required
> from student.models import *
> from django.views.generic import TemplateView
> import datetime, random
> from django.contrib.auth.backends import BaseBackend
> # Create your views here.
>
>
> def index_view(request):
> if request.method == 'POST':
> username = request.POST.get('username')
> password = request.POST.get('password')
> tab_selected = request.POST.get('tab_selected')
>
> user = authenticate(username=username, password=password)
> print(user)
> if user:
> # if get_user(username):
> if user.is_active:
> login(request, user)
> request.session['username'] = username
> request.session['tab_selected'] = tab_selected
> if tab_selected == 'student_tab':
> return 
> HttpResponseRedirect(reverse('student:stud_home'))
> elif tab_selected == 'dept_tab':
> if username[:3] == 'hod':
> return 
> HttpResponseRedirect(reverse('student:hod_home'))
> else:
> return 
> HttpResponseRedirect(reverse('student:dep_home'))
> elif tab_selected == 'office_tab':
> return 
> HttpResponseRedirect(reverse('student:off_home'))
> else:
> user_login = 'inactive'
> return render(request, 'student/index.html', 
> context={'login': user_login})
> else:
> user_login = 'invalid'
> return render(request, 'student/index.html', 
> context={'login': user_login})
> else:
> return render(request, 'student/index.html', context={})
>
>
> index.html
>
> 
>  style="color:black;">PASSWORD
>  class="form-control" name="password" placeholder="Enter Password">
> 
> 
> {% if login == 'inactive' %}
> User Inactive! Contact 
> Admin!
> {% elif login == 'invalid' %}
> line 32 username or password 
> Invalid
> {% endif%}
> {% if tab_error == True %}
> Invalid Tab Selected
> {% endif %}
> 
>
>
> On Tue, Jun 22, 2021 at 11:55 AM DJANGO DEVELOPER <
> abubakarbr...@gmail.com> wrote:
>
>> can you please share your login view code?
>>
>> On Tue, Jun 22, 2021 at 10:12 AM avdesh sharma <
>> avdeshsharma...@gmail.com> wrote:
>>
>>> Hi All,
>>>
>>> I have an issue coming in my django code, even though the user id
>>> and password is present in sqlite3 db still  the user is giving '
>>> *None'* value
>>> user = authenticate(username=username, password=password)
>>>
>>> and I am not able to login with user and throwing this error.
>>>
>>> [image: image.png]
>>>
>>>
>>>
>>>
>>> --
>>> Warm Regards,
>>> Avdesh Kumar Sharma
>>> 9650031844
>>>

Re: Help me - Django and python

2021-06-22 Thread DJANGO DEVELOPER
because it is necessary to write when there are no more conditions left.

On Tue, Jun 22, 2021 at 6:31 PM avdesh sharma 
wrote:

> what will happen if I change from elif to else ?
> FYI - I checked it but still getting same error.
>
> On Tue, Jun 22, 2021 at 2:51 PM DJANGO DEVELOPER 
> wrote:
>
>> your index.html
>>
>> 
>> PASSWORD
>> > class="form-control" name="password" placeholder="Enter Password">
>> 
>> 
>> {% if login == 'inactive' %}
>> User Inactive! Contact 
>> Admin!
>> {% elif login == 'invalid' %}
>> line 32 username or password 
>> Invalid
>> {% endif%}
>> {% if tab_error == True %}
>> Invalid Tab Selected
>> {% endif %}
>>
>>
>>
>> changed index.html
>>
>> 
>> PASSWORD
>> > class="form-control" name="password" placeholder="Enter Password" 
>> value="{{login.password_field}}">
>> 
>> 
>> {% if login == 'inactive' %}
>> User Inactive! Contact 
>> Admin!
>> {% else %}
>> line 32 username or password 
>> Invalid
>> {% endif%}
>> {% if tab_error == True %}
>> Invalid Tab Selected
>> {% endif %}
>>
>>
>> On Tue, Jun 22, 2021 at 2:16 PM DJANGO DEVELOPER 
>> wrote:
>>
>>> by seeing your code, it seems that only the 'else' part is working. have
>>> you provided value='{{dict_key.model_password_field}} in your html input
>>> element?
>>>
>>> On Tue, Jun 22, 2021 at 12:52 PM avdesh sharma <
>>> avdeshsharma...@gmail.com> wrote:
>>>
 Here is my View.py code

 from django.shortcuts import render
 from django.http import HttpResponseRedirect
 from django.urls import reverse
 from django.contrib.auth import authenticate, logout, login
 from django.contrib.auth.decorators import login_required
 from student.models import *
 from django.views.generic import TemplateView
 import datetime, random
 from django.contrib.auth.backends import BaseBackend
 # Create your views here.


 def index_view(request):
 if request.method == 'POST':
 username = request.POST.get('username')
 password = request.POST.get('password')
 tab_selected = request.POST.get('tab_selected')

 user = authenticate(username=username, password=password)
 print(user)
 if user:
 # if get_user(username):
 if user.is_active:
 login(request, user)
 request.session['username'] = username
 request.session['tab_selected'] = tab_selected
 if tab_selected == 'student_tab':
 return 
 HttpResponseRedirect(reverse('student:stud_home'))
 elif tab_selected == 'dept_tab':
 if username[:3] == 'hod':
 return 
 HttpResponseRedirect(reverse('student:hod_home'))
 else:
 return 
 HttpResponseRedirect(reverse('student:dep_home'))
 elif tab_selected == 'office_tab':
 return 
 HttpResponseRedirect(reverse('student:off_home'))
 else:
 user_login = 'inactive'
 return render(request, 'student/index.html', 
 context={'login': user_login})
 else:
 user_login = 'invalid'
 return render(request, 'student/index.html', context={'login': 
 user_login})
 else:
 return render(request, 'student/index.html', context={})


 index.html

 
 PASSWORD
 >>> class="form-control" name="password" placeholder="Enter Password">
 
 
 {% if login == 'inactive' %}
 User Inactive! Contact 
 Admin!
 {% elif login == 'invalid' %}
 line 32 username or password 
 Invalid
 {% endif%}
 {% if tab_error == True %}
 Invalid Tab Selected
 {% endif %}
 


 On Tue, Jun 22, 2021 at 11:55 AM DJANGO DEVELOPER <
 abubakarbr...@gmail.com> wrote:

> can you please share your login view code?
>
> On Tue, Jun 22, 2021 at 10:12 AM avdesh sharma <
> avdeshsharma...@gmail.com> wrote:
>
>> Hi All,
>>
>> I have an issue coming in my django code, even though the user id and
>> password is present in sqlite3 db still  the user is giving '*None'*
>> value
>> user = authenticate(username=username, password=password)
>>
>> and I am not able to login with user and throwing this error.
>>
>> [image: image.png]
>>
>>
>>
>>
>> --
>> Warm Regards,
>> Avdesh Kumar Sharma
>> 9650031844
>>
>> --
>> 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
>> 

Re: Help me - Django and python

2021-06-22 Thread avdesh sharma
what will happen if I change from elif to else ?
FYI - I checked it but still getting same error.

On Tue, Jun 22, 2021 at 2:51 PM DJANGO DEVELOPER 
wrote:

> your index.html
>
> 
> PASSWORD
>  class="form-control" name="password" placeholder="Enter Password">
> 
> 
> {% if login == 'inactive' %}
> User Inactive! Contact 
> Admin!
> {% elif login == 'invalid' %}
> line 32 username or password 
> Invalid
> {% endif%}
> {% if tab_error == True %}
> Invalid Tab Selected
> {% endif %}
>
>
>
> changed index.html
>
> 
> PASSWORD
>  class="form-control" name="password" placeholder="Enter Password" 
> value="{{login.password_field}}">
> 
> 
> {% if login == 'inactive' %}
> User Inactive! Contact 
> Admin!
> {% else %}
> line 32 username or password 
> Invalid
> {% endif%}
> {% if tab_error == True %}
> Invalid Tab Selected
> {% endif %}
>
>
> On Tue, Jun 22, 2021 at 2:16 PM DJANGO DEVELOPER 
> wrote:
>
>> by seeing your code, it seems that only the 'else' part is working. have
>> you provided value='{{dict_key.model_password_field}} in your html input
>> element?
>>
>> On Tue, Jun 22, 2021 at 12:52 PM avdesh sharma 
>> wrote:
>>
>>> Here is my View.py code
>>>
>>> from django.shortcuts import render
>>> from django.http import HttpResponseRedirect
>>> from django.urls import reverse
>>> from django.contrib.auth import authenticate, logout, login
>>> from django.contrib.auth.decorators import login_required
>>> from student.models import *
>>> from django.views.generic import TemplateView
>>> import datetime, random
>>> from django.contrib.auth.backends import BaseBackend
>>> # Create your views here.
>>>
>>>
>>> def index_view(request):
>>> if request.method == 'POST':
>>> username = request.POST.get('username')
>>> password = request.POST.get('password')
>>> tab_selected = request.POST.get('tab_selected')
>>>
>>> user = authenticate(username=username, password=password)
>>> print(user)
>>> if user:
>>> # if get_user(username):
>>> if user.is_active:
>>> login(request, user)
>>> request.session['username'] = username
>>> request.session['tab_selected'] = tab_selected
>>> if tab_selected == 'student_tab':
>>> return 
>>> HttpResponseRedirect(reverse('student:stud_home'))
>>> elif tab_selected == 'dept_tab':
>>> if username[:3] == 'hod':
>>> return 
>>> HttpResponseRedirect(reverse('student:hod_home'))
>>> else:
>>> return 
>>> HttpResponseRedirect(reverse('student:dep_home'))
>>> elif tab_selected == 'office_tab':
>>> return HttpResponseRedirect(reverse('student:off_home'))
>>> else:
>>> user_login = 'inactive'
>>> return render(request, 'student/index.html', 
>>> context={'login': user_login})
>>> else:
>>> user_login = 'invalid'
>>> return render(request, 'student/index.html', context={'login': 
>>> user_login})
>>> else:
>>> return render(request, 'student/index.html', context={})
>>>
>>>
>>> index.html
>>>
>>> 
>>> PASSWORD
>>> >> class="form-control" name="password" placeholder="Enter Password">
>>> 
>>> 
>>> {% if login == 'inactive' %}
>>> User Inactive! Contact 
>>> Admin!
>>> {% elif login == 'invalid' %}
>>> line 32 username or password 
>>> Invalid
>>> {% endif%}
>>> {% if tab_error == True %}
>>> Invalid Tab Selected
>>> {% endif %}
>>> 
>>>
>>>
>>> On Tue, Jun 22, 2021 at 11:55 AM DJANGO DEVELOPER <
>>> abubakarbr...@gmail.com> wrote:
>>>
 can you please share your login view code?

 On Tue, Jun 22, 2021 at 10:12 AM avdesh sharma <
 avdeshsharma...@gmail.com> wrote:

> Hi All,
>
> I have an issue coming in my django code, even though the user id and
> password is present in sqlite3 db still  the user is giving '*None'*
> value
> user = authenticate(username=username, password=password)
>
> and I am not able to login with user and throwing this error.
>
> [image: image.png]
>
>
>
>
> --
> Warm Regards,
> Avdesh Kumar Sharma
> 9650031844
>
> --
> 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/CAF5Nfo65s-8c75FRkhF0rN7Sh0aUH6eKNBbQ--OMawNPCVX13w%40mail.gmail.com
> 
> .
>
 --
 You received this message because you 

Re: Help me Please - Django and python program

2021-06-22 Thread DJANGO DEVELOPER
t;
>>>>>>>   
>>>>>>>{% endfor %}
>>>>>>>
>>>>>>>
>>>>>>>   
>>>>>>>  {% csrf_token %}
>>>>>>>
>>>>>>> 
>>>>>>>   
>>>>>>> ID
>>>>>>> Itemname
>>>>>>> Quantity
>>>>>>>
>>>>>>> userquantity
>>>>>>> amount
>>>>>>>   
>>>>>>>
>>>>>>>   {% for displayemp in editupdaterecord%}
>>>>>>>   
>>>>>>>   {{displayemp.id}}
>>>>>>>   {{displayemp.Itemname}}
>>>>>>>   {{displayemp.quantity}} 
>>>>>>>
>>>>>>>
>>>>>>>   
>>>>>>>
>>>>>>>{% csrf_token %}
>>>>>>>   >>>>>> value="{{editupdaterecord.userquantity}}"   >
>>>>>>>{{displayemp.amount2}} 
>>>>>>>   
>>>>>>>{% endfor %}
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 
>>>>>>>
>>>>>>> Add
>>>>>>>
>>>>>>>
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Jun 22, 2021 at 3:49 PM mayank sandikar <
>>>>>>> mayanksandikar191...@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hello sir,
>>>>>>>> I'm trying to insert the data in the table. For example in database
>>>>>>>> Itemname quantity price user-quantity amount
>>>>>>>> pen20  5   00
>>>>>>>> book  20 10  00
>>>>>>>>
>>>>>>>> in my database I'm getting this result
>>>>>>>> pen20  5   00
>>>>>>>> book  20 10  00
>>>>>>>>  20
>>>>>>>>
>>>>>>>> I want to take the itemname, quantity, and price in the last row as
>>>>>>>> well.
>>>>>>>> In my html front view (screenshot 50) only the last text box is
>>>>>>>> active in the user quantity column.
>>>>>>>>
>>>>>>>> please help me.
>>>>>>>> thank you
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Jun 22, 2021 at 2:58 PM DJANGO DEVELOPER <
>>>>>>>> abubakarbr...@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> according to your code, you're trying to update the product
>>>>>>>>> record. right?
>>>>>>>>> If so, then you're doing things the right way.
>>>>>>>>>
>>>>>>>>> On Tue, Jun 22, 2021 at 9:50 AM mayank sandikar <
>>>>>>>>> mayanksandikar191...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> hello , sir your mobile no. is not on whatsapp. please assist me
>>>>>>>>>> with  this
>>>>>>>>>>
>>>>>>>>>> On Mon, Jun 21, 2021 at 10:09 PM Onyemordi Daniel <
>>>>>>>>>> onyemordidan...@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hello, have your problem been solved if no kindly contact me on
>>>>>>>>>>> WhatsApp 08167997730 to assist you better.
>>>>>>>>>>>
>>>>>>>>>>> On Mon, 21 Jun 2021, 07:07 mayank sandikar, <
>>>>>>>>>>> mayanksandikar191...@gmail.com> wrote:
>>

Re: Help me Please - Django and python program

2021-06-22 Thread DJANGO DEVELOPER
follow this code's pattern but remember one thing that you have to follow
it according to your needs.

On Tue, Jun 22, 2021 at 4:10 PM DJANGO DEVELOPER 
wrote:

> def insetdata(request):
> product_form = your_product_form()
> if request.method == 'POST':
> product_form = your_product_form(request.POST, request.FILES)
> if product_form.is_valid:
> product_form.save()
> return redirect('put your product's url name value here')
> return render(request, 'your template path here',
> {'product':product_form})
>
> On Tue, Jun 22, 2021 at 3:59 PM mayank sandikar <
> mayanksandikar191...@gmail.com> wrote:
>
>> Thank you sir, the html problem is solved, but I don't know how to insert
>> itemname, quantity and rate in the database
>>
>> On Tue, Jun 22, 2021 at 4:15 PM DJANGO DEVELOPER 
>> wrote:
>>
>>> is your code working now?
>>>
>>> On Tue, Jun 22, 2021 at 3:32 PM DJANGO DEVELOPER <
>>> abubakarbr...@gmail.com> wrote:
>>>
>>>> First of all please remove the for loop from your form.
>>>> secondly please add{{displayemp.userquantity_field}}
>>>>   {{displayemp.amount_field}} 
>>>>
>>>> On Tue, Jun 22, 2021 at 3:27 PM mayank sandikar <
>>>> mayanksandikar191...@gmail.com> wrote:
>>>>
>>>>> view.py
>>>>> def displaydata(request):
>>>>>results = editupdaterecord.objects.all()
>>>>>
>>>>>
>>>>>if request.method=='POST':
>>>>>  if request.POST.get('userquantity')  :
>>>>>  quantity = request.POST.get('userquantity')
>>>>>  a = editupdaterecord.objects.all()
>>>>>  print(a)
>>>>>#  if results in a < quantity:
>>>>>  saverecord = editupdaterecord(userquantity = quantity)
>>>>>  saverecord.save()
>>>>>
>>>>>return render(request , 'index.html' ,{"editupdaterecord":results})
>>>>>
>>>>>
>>>>> On Tue, Jun 22, 2021 at 3:55 PM mayank sandikar <
>>>>> mayanksandikar191...@gmail.com> wrote:
>>>>>
>>>>>> my index.html is
>>>>>>
>>>>>> 
>>>>>> 
>>>>>>  Edit 
>>>>>> 
>>>>>> .button {
>>>>>>   border: none;
>>>>>>   color: black;
>>>>>>   padding: 15px 32px;
>>>>>>   text-align: center;
>>>>>>   text-decoration: none;
>>>>>>   display: inline-block;
>>>>>>   font-size: 16px;
>>>>>>   margin: 4px 2px;
>>>>>>   cursor: pointer;
>>>>>>
>>>>>> }
>>>>>>
>>>>>> .button2 {background-color: #008CBA;}
>>>>>>
>>>>>> 
>>>>>>
>>>>>>
>>>>>> 
>>>>>> 
>>>>>>
>>>>>>
>>>>>> 
>>>>>>  
>>>>>> 
>>>>>> 
>>>>>>   
>>>>>> ID
>>>>>> Itemname
>>>>>> Quantity
>>>>>>
>>>>>>  rate
>>>>>>   amount
>>>>>>   
>>>>>>
>>>>>>   {% for displayemp in editupdaterecord%}
>>>>>>   
>>>>>>   {{displayemp.id}}
>>>>>>   {{displayemp.Itemname}}
>>>>>>   {{displayemp.quantity}} 
>>>>>>{{displayemp.rate}} 
>>>>>>   {{displayemp.basicamount}} 
>>>>>>
>>>>>>   
>>>>>>{% endfor %}
>>>>>>
>>>>>>
>>>>>>   
>>>>>>  {% csrf_token %}
>>>>>>
>>>>>> 
>>>>>>   
>>>>>> ID
>>>>>> Itemname
>>>>>> Quantity
>>>>>>
>>>>>> userquantity
>>>>>> amount
>>>>>>   
>>>>>>
>>>&

Re: Help me Please - Django and python program

2021-06-22 Thread DJANGO DEVELOPER
def insetdata(request):
product_form = your_product_form()
if request.method == 'POST':
product_form = your_product_form(request.POST, request.FILES)
if product_form.is_valid:
product_form.save()
return redirect('put your product's url name value here')
return render(request, 'your template path here',
{'product':product_form})

On Tue, Jun 22, 2021 at 3:59 PM mayank sandikar <
mayanksandikar191...@gmail.com> wrote:

> Thank you sir, the html problem is solved, but I don't know how to insert
> itemname, quantity and rate in the database
>
> On Tue, Jun 22, 2021 at 4:15 PM DJANGO DEVELOPER 
> wrote:
>
>> is your code working now?
>>
>> On Tue, Jun 22, 2021 at 3:32 PM DJANGO DEVELOPER 
>> wrote:
>>
>>> First of all please remove the for loop from your form.
>>> secondly please add{{displayemp.userquantity_field}}
>>>   {{displayemp.amount_field}} 
>>>
>>> On Tue, Jun 22, 2021 at 3:27 PM mayank sandikar <
>>> mayanksandikar191...@gmail.com> wrote:
>>>
>>>> view.py
>>>> def displaydata(request):
>>>>results = editupdaterecord.objects.all()
>>>>
>>>>
>>>>if request.method=='POST':
>>>>  if request.POST.get('userquantity')  :
>>>>  quantity = request.POST.get('userquantity')
>>>>  a = editupdaterecord.objects.all()
>>>>  print(a)
>>>>#  if results in a < quantity:
>>>>  saverecord = editupdaterecord(userquantity = quantity)
>>>>  saverecord.save()
>>>>
>>>>return render(request , 'index.html' ,{"editupdaterecord":results})
>>>>
>>>>
>>>> On Tue, Jun 22, 2021 at 3:55 PM mayank sandikar <
>>>> mayanksandikar191...@gmail.com> wrote:
>>>>
>>>>> my index.html is
>>>>>
>>>>> 
>>>>> 
>>>>>  Edit 
>>>>> 
>>>>> .button {
>>>>>   border: none;
>>>>>   color: black;
>>>>>   padding: 15px 32px;
>>>>>   text-align: center;
>>>>>   text-decoration: none;
>>>>>   display: inline-block;
>>>>>   font-size: 16px;
>>>>>   margin: 4px 2px;
>>>>>   cursor: pointer;
>>>>>
>>>>> }
>>>>>
>>>>> .button2 {background-color: #008CBA;}
>>>>>
>>>>> 
>>>>>
>>>>>
>>>>> 
>>>>> 
>>>>>
>>>>>
>>>>> 
>>>>>  
>>>>> 
>>>>> 
>>>>>   
>>>>> ID
>>>>> Itemname
>>>>> Quantity
>>>>>
>>>>>  rate
>>>>>   amount
>>>>>   
>>>>>
>>>>>   {% for displayemp in editupdaterecord%}
>>>>>   
>>>>>   {{displayemp.id}}
>>>>>   {{displayemp.Itemname}}
>>>>>   {{displayemp.quantity}} 
>>>>>{{displayemp.rate}} 
>>>>>   {{displayemp.basicamount}} 
>>>>>
>>>>>   
>>>>>{% endfor %}
>>>>>
>>>>>
>>>>>   
>>>>>  {% csrf_token %}
>>>>>
>>>>> 
>>>>>   
>>>>> ID
>>>>> Itemname
>>>>> Quantity
>>>>>
>>>>> userquantity
>>>>> amount
>>>>>   
>>>>>
>>>>>   {% for displayemp in editupdaterecord%}
>>>>>   
>>>>>   {{displayemp.id}}
>>>>>   {{displayemp.Itemname}}
>>>>>   {{displayemp.quantity}} 
>>>>>
>>>>>
>>>>>   
>>>>>
>>>>>{% csrf_token %}
>>>>>   >>>> ="{{editupdaterecord.userquantity}}"   >
>>>>>{{displayemp.amount2}} 
>>>>>   
>>>>>{% endfor %}
>>>>>
>>>

Re: Help me Please - Django and python program

2021-06-22 Thread mayank sandikar
Thank you sir, the html problem is solved, but I don't know how to insert
itemname, quantity and rate in the database

On Tue, Jun 22, 2021 at 4:15 PM DJANGO DEVELOPER 
wrote:

> is your code working now?
>
> On Tue, Jun 22, 2021 at 3:32 PM DJANGO DEVELOPER 
> wrote:
>
>> First of all please remove the for loop from your form.
>> secondly please add{{displayemp.userquantity_field}}
>>   {{displayemp.amount_field}} 
>>
>> On Tue, Jun 22, 2021 at 3:27 PM mayank sandikar <
>> mayanksandikar191...@gmail.com> wrote:
>>
>>> view.py
>>> def displaydata(request):
>>>results = editupdaterecord.objects.all()
>>>
>>>
>>>if request.method=='POST':
>>>  if request.POST.get('userquantity')  :
>>>  quantity = request.POST.get('userquantity')
>>>  a = editupdaterecord.objects.all()
>>>  print(a)
>>>#  if results in a < quantity:
>>>  saverecord = editupdaterecord(userquantity = quantity)
>>>  saverecord.save()
>>>
>>>return render(request , 'index.html' ,{"editupdaterecord":results})
>>>
>>>
>>> On Tue, Jun 22, 2021 at 3:55 PM mayank sandikar <
>>> mayanksandikar191...@gmail.com> wrote:
>>>
>>>> my index.html is
>>>>
>>>> 
>>>> 
>>>>  Edit 
>>>> 
>>>> .button {
>>>>   border: none;
>>>>   color: black;
>>>>   padding: 15px 32px;
>>>>   text-align: center;
>>>>   text-decoration: none;
>>>>   display: inline-block;
>>>>   font-size: 16px;
>>>>   margin: 4px 2px;
>>>>   cursor: pointer;
>>>>
>>>> }
>>>>
>>>> .button2 {background-color: #008CBA;}
>>>>
>>>> 
>>>>
>>>>
>>>> 
>>>> 
>>>>
>>>>
>>>> 
>>>>  
>>>> 
>>>> 
>>>>   
>>>> ID
>>>> Itemname
>>>> Quantity
>>>>
>>>>  rate
>>>>   amount
>>>>   
>>>>
>>>>   {% for displayemp in editupdaterecord%}
>>>>   
>>>>   {{displayemp.id}}
>>>>   {{displayemp.Itemname}}
>>>>   {{displayemp.quantity}} 
>>>>{{displayemp.rate}} 
>>>>   {{displayemp.basicamount}} 
>>>>
>>>>   
>>>>{% endfor %}
>>>>
>>>>
>>>>   
>>>>  {% csrf_token %}
>>>>
>>>> 
>>>>   
>>>> ID
>>>> Itemname
>>>> Quantity
>>>>
>>>> userquantity
>>>> amount
>>>>   
>>>>
>>>>   {% for displayemp in editupdaterecord%}
>>>>   
>>>>   {{displayemp.id}}
>>>>   {{displayemp.Itemname}}
>>>>   {{displayemp.quantity}} 
>>>>
>>>>
>>>>   
>>>>
>>>>{% csrf_token %}
>>>>   >>> "{{editupdaterecord.userquantity}}"   >
>>>>{{displayemp.amount2}} 
>>>>   
>>>>{% endfor %}
>>>>
>>>>
>>>>
>>>> 
>>>>
>>>> Add
>>>>
>>>>
>>>> 
>>>> 
>>>> 
>>>>
>>>>
>>>>
>>>>
>>>> On Tue, Jun 22, 2021 at 3:49 PM mayank sandikar <
>>>> mayanksandikar191...@gmail.com> wrote:
>>>>
>>>>> Hello sir,
>>>>> I'm trying to insert the data in the table. For example in database
>>>>> Itemname quantity price user-quantity amount
>>>>> pen20  5   00
>>>>> book  20 10  00
>>>>>
>>>>> in my database I'm getting this result
>>>>> pen20  5   00
>>>>> book  20 

Re: Help me Please - Django and python program

2021-06-22 Thread DJANGO DEVELOPER
is your code working now?

On Tue, Jun 22, 2021 at 3:32 PM DJANGO DEVELOPER 
wrote:

> First of all please remove the for loop from your form.
> secondly please add{{displayemp.userquantity_field}}
>   {{displayemp.amount_field}} 
>
> On Tue, Jun 22, 2021 at 3:27 PM mayank sandikar <
> mayanksandikar191...@gmail.com> wrote:
>
>> view.py
>> def displaydata(request):
>>results = editupdaterecord.objects.all()
>>
>>
>>if request.method=='POST':
>>  if request.POST.get('userquantity')  :
>>  quantity = request.POST.get('userquantity')
>>  a = editupdaterecord.objects.all()
>>  print(a)
>>#  if results in a < quantity:
>>  saverecord = editupdaterecord(userquantity = quantity)
>>  saverecord.save()
>>
>>return render(request , 'index.html' ,{"editupdaterecord":results})
>>
>>
>> On Tue, Jun 22, 2021 at 3:55 PM mayank sandikar <
>> mayanksandikar191...@gmail.com> wrote:
>>
>>> my index.html is
>>>
>>> 
>>> 
>>>  Edit 
>>> 
>>> .button {
>>>   border: none;
>>>   color: black;
>>>   padding: 15px 32px;
>>>   text-align: center;
>>>   text-decoration: none;
>>>   display: inline-block;
>>>   font-size: 16px;
>>>   margin: 4px 2px;
>>>   cursor: pointer;
>>>
>>> }
>>>
>>> .button2 {background-color: #008CBA;}
>>>
>>> 
>>>
>>>
>>> 
>>> 
>>>
>>>
>>> 
>>>  
>>> 
>>> 
>>>   
>>> ID
>>> Itemname
>>> Quantity
>>>
>>>  rate
>>>   amount
>>>   
>>>
>>>   {% for displayemp in editupdaterecord%}
>>>   
>>>   {{displayemp.id}}
>>>   {{displayemp.Itemname}}
>>>   {{displayemp.quantity}} 
>>>{{displayemp.rate}} 
>>>   {{displayemp.basicamount}} 
>>>
>>>   
>>>{% endfor %}
>>>
>>>
>>>   
>>>  {% csrf_token %}
>>>
>>> 
>>>   
>>> ID
>>> Itemname
>>> Quantity
>>>
>>> userquantity
>>> amount
>>>   
>>>
>>>   {% for displayemp in editupdaterecord%}
>>>   
>>>   {{displayemp.id}}
>>>   {{displayemp.Itemname}}
>>>   {{displayemp.quantity}} 
>>>
>>>
>>>   
>>>
>>>{% csrf_token %}
>>>   
>>>{{displayemp.amount2}} 
>>>   
>>>{% endfor %}
>>>
>>>
>>>
>>> 
>>>
>>> Add
>>>
>>>
>>> 
>>> 
>>> 
>>>
>>>
>>>
>>>
>>> On Tue, Jun 22, 2021 at 3:49 PM mayank sandikar <
>>> mayanksandikar191...@gmail.com> wrote:
>>>
>>>> Hello sir,
>>>> I'm trying to insert the data in the table. For example in database
>>>> Itemname quantity price user-quantity amount
>>>> pen20  5   00
>>>> book  20 10  00
>>>>
>>>> in my database I'm getting this result
>>>> pen20  5   00
>>>> book  20 10  00
>>>>  20
>>>>
>>>> I want to take the itemname, quantity, and price in the last row as
>>>> well.
>>>> In my html front view (screenshot 50) only the last text box is active
>>>> in the user quantity column.
>>>>
>>>> please help me.
>>>> thank you
>>>>
>>>>
>>>>
>>>> On Tue, Jun 22, 2021 at 2:58 PM DJANGO DEVELOPER <
>>>> abubakarbr...@gmail.com> wrote:
>>>>
>>>>> according to your code, you're trying to update the product record.
>>>>> right?
>>>>> If so, then you're doing thin

Re: Help me Please - Django and python program

2021-06-22 Thread DJANGO DEVELOPER


 Edit 

.button {
  border: none;
  color: black;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;

}

.button2 {background-color: #008CBA;}









 


  
ID
Itemname
Quantity

 rate
  amount
  

  {% for displayemp in editupdaterecord%}
  
  {{displayemp.id}}
  {{displayemp.Itemname}}
  {{displayemp.quantity}} 
   {{displayemp.rate}} 
  {{displayemp.basicamount}} 

  
   {% endfor %}
   

  
 {% csrf_token %}


  
ID
Itemname
Quantity

userquantity
amount
  


  
  {{editupdaterecord.id}}
  {{editupdaterecord.Itemname}}
  {{editupdaterecord.quantity}} 
{{editupdaterecord.yourquantity}} 
 {{editupdaterecord.youramount}} 

  

   {% csrf_token %}
  
   {{displayemp.amount2}} 
  
   {% endfor %}


   


Add






On Tue, Jun 22, 2021 at 3:32 PM DJANGO DEVELOPER 
wrote:

> First of all please remove the for loop from your form.
> secondly please add{{displayemp.userquantity_field}}
>   {{displayemp.amount_field}} 
>
> On Tue, Jun 22, 2021 at 3:27 PM mayank sandikar <
> mayanksandikar191...@gmail.com> wrote:
>
>> view.py
>> def displaydata(request):
>>results = editupdaterecord.objects.all()
>>
>>
>>if request.method=='POST':
>>  if request.POST.get('userquantity')  :
>>  quantity = request.POST.get('userquantity')
>>  a = editupdaterecord.objects.all()
>>  print(a)
>>#  if results in a < quantity:
>>  saverecord = editupdaterecord(userquantity = quantity)
>>  saverecord.save()
>>
>>return render(request , 'index.html' ,{"editupdaterecord":results})
>>
>>
>> On Tue, Jun 22, 2021 at 3:55 PM mayank sandikar <
>> mayanksandikar191...@gmail.com> wrote:
>>
>>> my index.html is
>>>
>>> 
>>> 
>>>  Edit 
>>> 
>>> .button {
>>>   border: none;
>>>   color: black;
>>>   padding: 15px 32px;
>>>   text-align: center;
>>>   text-decoration: none;
>>>   display: inline-block;
>>>   font-size: 16px;
>>>   margin: 4px 2px;
>>>   cursor: pointer;
>>>
>>> }
>>>
>>> .button2 {background-color: #008CBA;}
>>>
>>> 
>>>
>>>
>>> 
>>> 
>>>
>>>
>>> 
>>>  
>>> 
>>> 
>>>   
>>> ID
>>> Itemname
>>> Quantity
>>>
>>>  rate
>>>   amount
>>>   
>>>
>>>   {% for displayemp in editupdaterecord%}
>>>   
>>>   {{displayemp.id}}
>>>   {{displayemp.Itemname}}
>>>   {{displayemp.quantity}} 
>>>{{displayemp.rate}} 
>>>   {{displayemp.basicamount}} 
>>>
>>>   
>>>{% endfor %}
>>>
>>>
>>>   
>>>  {% csrf_token %}
>>>
>>> 
>>>   
>>> ID
>>> Itemname
>>> Quantity
>>>
>>> userquantity
>>> amount
>>>   
>>>
>>>   {% for displayemp in editupdaterecord%}
>>>   
>>>   {{displayemp.id}}
>>>   {{displayemp.Itemname}}
>>>   {{displayemp.quantity}} 
>>>
>>>
>>>   
>>>
>>>{% csrf_token %}
>>>   
>>>{{displayemp.amount2}} 
>>>   
>>>{% endfor %}
>>>
>>>
>>>
>>> 
>>>
>>> Add
>>>
>>>
>>> 
>>> 
>>> 
>>>
>>>
>>>
>>>
>>> On Tue, Jun 22, 2021 at 3:49 PM mayank sandikar <
>>> mayanksandikar191...@gmail.com> wrote:
>>>
>>>> Hello sir,
>>>> I'm trying to insert the data in the table. For example in database
>&

Re: Help me Please - Django and python program

2021-06-22 Thread DJANGO DEVELOPER
First of all please remove the for loop from your form.
secondly please add{{displayemp.userquantity_field}}
  {{displayemp.amount_field}} 

On Tue, Jun 22, 2021 at 3:27 PM mayank sandikar <
mayanksandikar191...@gmail.com> wrote:

> view.py
> def displaydata(request):
>results = editupdaterecord.objects.all()
>
>
>if request.method=='POST':
>  if request.POST.get('userquantity')  :
>  quantity = request.POST.get('userquantity')
>  a = editupdaterecord.objects.all()
>  print(a)
>#  if results in a < quantity:
>  saverecord = editupdaterecord(userquantity = quantity)
>  saverecord.save()
>
>return render(request , 'index.html' ,{"editupdaterecord":results})
>
>
> On Tue, Jun 22, 2021 at 3:55 PM mayank sandikar <
> mayanksandikar191...@gmail.com> wrote:
>
>> my index.html is
>>
>> 
>> 
>>  Edit 
>> 
>> .button {
>>   border: none;
>>   color: black;
>>   padding: 15px 32px;
>>   text-align: center;
>>   text-decoration: none;
>>   display: inline-block;
>>   font-size: 16px;
>>   margin: 4px 2px;
>>   cursor: pointer;
>>
>> }
>>
>> .button2 {background-color: #008CBA;}
>>
>> 
>>
>>
>> 
>> 
>>
>>
>> 
>>  
>> 
>> 
>>   
>> ID
>> Itemname
>> Quantity
>>
>>  rate
>>   amount
>>   
>>
>>   {% for displayemp in editupdaterecord%}
>>   
>>   {{displayemp.id}}
>>   {{displayemp.Itemname}}
>>   {{displayemp.quantity}} 
>>{{displayemp.rate}} 
>>   {{displayemp.basicamount}} 
>>
>>   
>>{% endfor %}
>>
>>
>>   
>>  {% csrf_token %}
>>
>> 
>>   
>> ID
>> Itemname
>> Quantity
>>
>> userquantity
>> amount
>>   
>>
>>   {% for displayemp in editupdaterecord%}
>>   
>>   {{displayemp.id}}
>>   {{displayemp.Itemname}}
>>   {{displayemp.quantity}} 
>>
>>
>>   
>>
>>{% csrf_token %}
>>   
>>{{displayemp.amount2}} 
>>   
>>{% endfor %}
>>
>>
>>
>> 
>>
>> Add
>>
>>
>> 
>> 
>> 
>>
>>
>>
>>
>> On Tue, Jun 22, 2021 at 3:49 PM mayank sandikar <
>> mayanksandikar191...@gmail.com> wrote:
>>
>>> Hello sir,
>>> I'm trying to insert the data in the table. For example in database
>>> Itemname quantity price user-quantity amount
>>> pen20  5   00
>>> book  20 10  00
>>>
>>> in my database I'm getting this result
>>> pen20  5   00
>>> book  20 10  00
>>>  20
>>>
>>> I want to take the itemname, quantity, and price in the last row as well.
>>> In my html front view (screenshot 50) only the last text box is active
>>> in the user quantity column.
>>>
>>> please help me.
>>> thank you
>>>
>>>
>>>
>>> On Tue, Jun 22, 2021 at 2:58 PM DJANGO DEVELOPER <
>>> abubakarbr...@gmail.com> wrote:
>>>
>>>> according to your code, you're trying to update the product record.
>>>> right?
>>>> If so, then you're doing things the right way.
>>>>
>>>> On Tue, Jun 22, 2021 at 9:50 AM mayank sandikar <
>>>> mayanksandikar191...@gmail.com> wrote:
>>>>
>>>>> hello , sir your mobile no. is not on whatsapp. please assist me
>>>>> with  this
>>>>>
>>>>> On Mon, Jun 21, 2021 at 10:09 PM Onyemordi Daniel <
>>>>> onyemordidan...@gmail.com> wrote:
>>>>>
>>>>>> Hello, have your problem been solved if no kindly contact me on
>>>>>> WhatsApp 08167997730 to assist you better.
>>>>>>
>>>>>> On Mon, 21 Jun 2021, 07:07 mayank s

Re: Help me Please - Django and python program

2021-06-22 Thread mayank sandikar
forms.py

from django import forms
from django.forms import fields
from project.models import editupdaterecord

class empforms(forms.ModelForm):
class Meta:
model=editupdaterecord
fields="__all__"


On Tue, Jun 22, 2021 at 3:57 PM mayank sandikar <
mayanksandikar191...@gmail.com> wrote:

> models.py
>
> from django.db import models
>
>
>
> class editupdaterecord(models.Model):
> id = models.IntegerField(primary_key=1)
> Itemname =  models.CharField(max_length=100)
> quantity = models.IntegerField(blank=True, null=True, default=0)
> basicamount = models.IntegerField(blank=True, null=True, default=0)
> rate = models.IntegerField(blank=True, null=True, default=20)
> userquantity = models.IntegerField(blank=True, null=True, default=0)
> amount2 = models.IntegerField(blank=True, null=True, default=0)
> class Meta:
> db_table ='bill3'
>
> On Tue, Jun 22, 2021 at 3:57 PM mayank sandikar <
> mayanksandikar191...@gmail.com> wrote:
>
>> view.py
>> def displaydata(request):
>>results = editupdaterecord.objects.all()
>>
>>
>>if request.method=='POST':
>>  if request.POST.get('userquantity')  :
>>  quantity = request.POST.get('userquantity')
>>  a = editupdaterecord.objects.all()
>>  print(a)
>>#  if results in a < quantity:
>>  saverecord = editupdaterecord(userquantity = quantity)
>>  saverecord.save()
>>
>>return render(request , 'index.html' ,{"editupdaterecord":results})
>>
>>
>> On Tue, Jun 22, 2021 at 3:55 PM mayank sandikar <
>> mayanksandikar191...@gmail.com> wrote:
>>
>>> my index.html is
>>>
>>> 
>>> 
>>>  Edit 
>>> 
>>> .button {
>>>   border: none;
>>>   color: black;
>>>   padding: 15px 32px;
>>>   text-align: center;
>>>   text-decoration: none;
>>>   display: inline-block;
>>>   font-size: 16px;
>>>   margin: 4px 2px;
>>>   cursor: pointer;
>>>
>>> }
>>>
>>> .button2 {background-color: #008CBA;}
>>>
>>> 
>>>
>>>
>>> 
>>> 
>>>
>>>
>>> 
>>>  
>>> 
>>> 
>>>   
>>> ID
>>> Itemname
>>> Quantity
>>>
>>>  rate
>>>   amount
>>>   
>>>
>>>   {% for displayemp in editupdaterecord%}
>>>   
>>>   {{displayemp.id}}
>>>   {{displayemp.Itemname}}
>>>   {{displayemp.quantity}} 
>>>{{displayemp.rate}} 
>>>   {{displayemp.basicamount}} 
>>>
>>>   
>>>{% endfor %}
>>>
>>>
>>>   
>>>  {% csrf_token %}
>>>
>>> 
>>>   
>>> ID
>>> Itemname
>>> Quantity
>>>
>>> userquantity
>>> amount
>>>   
>>>
>>>   {% for displayemp in editupdaterecord%}
>>>   
>>>   {{displayemp.id}}
>>>   {{displayemp.Itemname}}
>>>   {{displayemp.quantity}} 
>>>
>>>
>>>   
>>>
>>>{% csrf_token %}
>>>   
>>>{{displayemp.amount2}} 
>>>   
>>>    {% endfor %}
>>>
>>>
>>>
>>> 
>>>
>>> Add
>>>
>>>
>>> 
>>> 
>>> 
>>>
>>>
>>>
>>>
>>> On Tue, Jun 22, 2021 at 3:49 PM mayank sandikar <
>>> mayanksandikar191...@gmail.com> wrote:
>>>
>>>> Hello sir,
>>>> I'm trying to insert the data in the table. For example in database
>>>> Itemname quantity price user-quantity amount
>>>> pen20  5   00
>>>> book  20 10  00
>>>>
>>>> in my database I'm getting this result
>>>> pen20  5   00
>>>> book  20 10  00
>>>>  

Re: Help me Please - Django and python program

2021-06-22 Thread mayank sandikar
models.py

from django.db import models



class editupdaterecord(models.Model):
id = models.IntegerField(primary_key=1)
Itemname =  models.CharField(max_length=100)
quantity = models.IntegerField(blank=True, null=True, default=0)
basicamount = models.IntegerField(blank=True, null=True, default=0)
rate = models.IntegerField(blank=True, null=True, default=20)
userquantity = models.IntegerField(blank=True, null=True, default=0)
amount2 = models.IntegerField(blank=True, null=True, default=0)
class Meta:
db_table ='bill3'

On Tue, Jun 22, 2021 at 3:57 PM mayank sandikar <
mayanksandikar191...@gmail.com> wrote:

> view.py
> def displaydata(request):
>results = editupdaterecord.objects.all()
>
>
>if request.method=='POST':
>  if request.POST.get('userquantity')  :
>  quantity = request.POST.get('userquantity')
>  a = editupdaterecord.objects.all()
>  print(a)
>#  if results in a < quantity:
>  saverecord = editupdaterecord(userquantity = quantity)
>  saverecord.save()
>
>return render(request , 'index.html' ,{"editupdaterecord":results})
>
>
> On Tue, Jun 22, 2021 at 3:55 PM mayank sandikar <
> mayanksandikar191...@gmail.com> wrote:
>
>> my index.html is
>>
>> 
>> 
>>  Edit 
>> 
>> .button {
>>   border: none;
>>   color: black;
>>   padding: 15px 32px;
>>   text-align: center;
>>   text-decoration: none;
>>   display: inline-block;
>>   font-size: 16px;
>>   margin: 4px 2px;
>>   cursor: pointer;
>>
>> }
>>
>> .button2 {background-color: #008CBA;}
>>
>> 
>>
>>
>> 
>> 
>>
>>
>> 
>>  
>> 
>> 
>>   
>> ID
>> Itemname
>> Quantity
>>
>>  rate
>>   amount
>>   
>>
>>   {% for displayemp in editupdaterecord%}
>>   
>>   {{displayemp.id}}
>>   {{displayemp.Itemname}}
>>   {{displayemp.quantity}} 
>>{{displayemp.rate}} 
>>   {{displayemp.basicamount}} 
>>
>>   
>>{% endfor %}
>>
>>
>>   
>>  {% csrf_token %}
>>
>> 
>>   
>> ID
>> Itemname
>> Quantity
>>
>> userquantity
>> amount
>>   
>>
>>   {% for displayemp in editupdaterecord%}
>>   
>>   {{displayemp.id}}
>>   {{displayemp.Itemname}}
>>   {{displayemp.quantity}} 
>>
>>
>>   
>>
>>{% csrf_token %}
>>   
>>{{displayemp.amount2}} 
>>   
>>{% endfor %}
>>
>>
>>
>> 
>>
>> Add
>>
>>
>> 
>> 
>> 
>>
>>
>>
>>
>> On Tue, Jun 22, 2021 at 3:49 PM mayank sandikar <
>> mayanksandikar191...@gmail.com> wrote:
>>
>>> Hello sir,
>>> I'm trying to insert the data in the table. For example in database
>>> Itemname quantity price user-quantity amount
>>> pen20  5   00
>>> book  20 10  00
>>>
>>> in my database I'm getting this result
>>> pen20  5   00
>>> book  20 10  00
>>>  20
>>>
>>> I want to take the itemname, quantity, and price in the last row as well.
>>> In my html front view (screenshot 50) only the last text box is active
>>> in the user quantity column.
>>>
>>> please help me.
>>> thank you
>>>
>>>
>>>
>>> On Tue, Jun 22, 2021 at 2:58 PM DJANGO DEVELOPER <
>>> abubakarbr...@gmail.com> wrote:
>>>
>>>> according to your code, you're trying to update the product record.
>>>> right?
>>>> If so, then you're doing things the right way.
>>>>
>>>> On Tue, Jun 22, 2021 at 9:50 AM mayank sandikar <
>>>> mayanksandikar191...@gmail.com> wrote:
>>>>
>>>>> hello , sir your mobile no. is not on whatsapp. please assist me
>>>>>

Re: Help me Please - Django and python program

2021-06-22 Thread mayank sandikar
view.py
def displaydata(request):
   results = editupdaterecord.objects.all()


   if request.method=='POST':
 if request.POST.get('userquantity')  :
 quantity = request.POST.get('userquantity')
 a = editupdaterecord.objects.all()
 print(a)
   #  if results in a < quantity:
 saverecord = editupdaterecord(userquantity = quantity)
 saverecord.save()

   return render(request , 'index.html' ,{"editupdaterecord":results})


On Tue, Jun 22, 2021 at 3:55 PM mayank sandikar <
mayanksandikar191...@gmail.com> wrote:

> my index.html is
>
> 
> 
>  Edit 
> 
> .button {
>   border: none;
>   color: black;
>   padding: 15px 32px;
>   text-align: center;
>   text-decoration: none;
>   display: inline-block;
>   font-size: 16px;
>   margin: 4px 2px;
>   cursor: pointer;
>
> }
>
> .button2 {background-color: #008CBA;}
>
> 
>
>
> 
> 
>
>
> 
>  
> 
> 
>   
> ID
> Itemname
> Quantity
>
>  rate
>   amount
>   
>
>   {% for displayemp in editupdaterecord%}
>   
>   {{displayemp.id}}
>   {{displayemp.Itemname}}
>   {{displayemp.quantity}} 
>{{displayemp.rate}} 
>   {{displayemp.basicamount}} 
>
>   
>{% endfor %}
>
>
>   
>  {% csrf_token %}
>
> 
>   
> ID
> Itemname
> Quantity
>
> userquantity
> amount
>   
>
>   {% for displayemp in editupdaterecord%}
>   
>   {{displayemp.id}}
>   {{displayemp.Itemname}}
>   {{displayemp.quantity}} 
>
>
>   
>
>{% csrf_token %}
>   
>{{displayemp.amount2}} 
>   
>{% endfor %}
>
>
>
> 
>
> Add
>
>
> 
> 
> 
>
>
>
>
> On Tue, Jun 22, 2021 at 3:49 PM mayank sandikar <
> mayanksandikar191...@gmail.com> wrote:
>
>> Hello sir,
>> I'm trying to insert the data in the table. For example in database
>> Itemname quantity price user-quantity amount
>> pen20  5   00
>> book  20 10  00
>>
>> in my database I'm getting this result
>> pen20      5   00
>> book  20 10  00
>>  20
>>
>> I want to take the itemname, quantity, and price in the last row as well.
>> In my html front view (screenshot 50) only the last text box is active in
>> the user quantity column.
>>
>> please help me.
>> thank you
>>
>>
>>
>> On Tue, Jun 22, 2021 at 2:58 PM DJANGO DEVELOPER 
>> wrote:
>>
>>> according to your code, you're trying to update the product record.
>>> right?
>>> If so, then you're doing things the right way.
>>>
>>> On Tue, Jun 22, 2021 at 9:50 AM mayank sandikar <
>>> mayanksandikar191...@gmail.com> wrote:
>>>
>>>> hello , sir your mobile no. is not on whatsapp. please assist me  with
>>>> this
>>>>
>>>> On Mon, Jun 21, 2021 at 10:09 PM Onyemordi Daniel <
>>>> onyemordidan...@gmail.com> wrote:
>>>>
>>>>> Hello, have your problem been solved if no kindly contact me on
>>>>> WhatsApp 08167997730 to assist you better.
>>>>>
>>>>> On Mon, 21 Jun 2021, 07:07 mayank sandikar, <
>>>>> mayanksandikar191...@gmail.com> wrote:
>>>>>
>>>>>> https://github.com/Mayanksandikar/3-database
>>>>>>
>>>>>>
>>>>>> On Sun, Jun 20, 2021 at 4:08 PM Luciano Martins 
>>>>>> wrote:
>>>>>>
>>>>>>> Post your code on github and provide the link here
>>>>>>>
>>>>>>> Em sábado, 19 de junho de 2021 às 22:00:24 UTC-3,
>>>>>>> mayanksand...@gmail.com escreveu:
>>>>>>>
>>>>>>>> I have a few errors in my program.
>>>>>>>> 1. HTML
>>>>>>>> In my front view only my last text box is working and all the upper
>>>>>>>> text boxes are unassessable.
>>>>

Re: Help me Please - Django and python program

2021-06-22 Thread mayank sandikar
my index.html is



 Edit 

.button {
  border: none;
  color: black;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin: 4px 2px;
  cursor: pointer;

}

.button2 {background-color: #008CBA;}









 


  
ID
Itemname
Quantity

 rate
  amount
  

  {% for displayemp in editupdaterecord%}
  
  {{displayemp.id}}
  {{displayemp.Itemname}}
  {{displayemp.quantity}} 
   {{displayemp.rate}} 
  {{displayemp.basicamount}} 

  
   {% endfor %}
   

  
 {% csrf_token %}


  
ID
Itemname
Quantity

userquantity
amount
  

  {% for displayemp in editupdaterecord%}
  
  {{displayemp.id}}
  {{displayemp.Itemname}}
  {{displayemp.quantity}} 


  

   {% csrf_token %}
  
   {{displayemp.amount2}} 
  
   {% endfor %}


   


Add









On Tue, Jun 22, 2021 at 3:49 PM mayank sandikar <
mayanksandikar191...@gmail.com> wrote:

> Hello sir,
> I'm trying to insert the data in the table. For example in database
> Itemname quantity price user-quantity amount
> pen20  5   00
> book  20 10  00
>
> in my database I'm getting this result
> pen20  5   00
> book  20 10  00
>  20
>
> I want to take the itemname, quantity, and price in the last row as well.
> In my html front view (screenshot 50) only the last text box is active in
> the user quantity column.
>
> please help me.
> thank you
>
>
>
> On Tue, Jun 22, 2021 at 2:58 PM DJANGO DEVELOPER 
> wrote:
>
>> according to your code, you're trying to update the product record. right?
>> If so, then you're doing things the right way.
>>
>> On Tue, Jun 22, 2021 at 9:50 AM mayank sandikar <
>> mayanksandikar191...@gmail.com> wrote:
>>
>>> hello , sir your mobile no. is not on whatsapp. please assist me  with
>>> this
>>>
>>> On Mon, Jun 21, 2021 at 10:09 PM Onyemordi Daniel <
>>> onyemordidan...@gmail.com> wrote:
>>>
>>>> Hello, have your problem been solved if no kindly contact me on
>>>> WhatsApp 08167997730 to assist you better.
>>>>
>>>> On Mon, 21 Jun 2021, 07:07 mayank sandikar, <
>>>> mayanksandikar191...@gmail.com> wrote:
>>>>
>>>>> https://github.com/Mayanksandikar/3-database
>>>>>
>>>>>
>>>>> On Sun, Jun 20, 2021 at 4:08 PM Luciano Martins 
>>>>> wrote:
>>>>>
>>>>>> Post your code on github and provide the link here
>>>>>>
>>>>>> Em sábado, 19 de junho de 2021 às 22:00:24 UTC-3,
>>>>>> mayanksand...@gmail.com escreveu:
>>>>>>
>>>>>>> I have a few errors in my program.
>>>>>>> 1. HTML
>>>>>>> In my front view only my last text box is working and all the upper
>>>>>>> text boxes are unassessable.
>>>>>>> 2. Database
>>>>>>> I am getting only the user quantity in the database but not getting
>>>>>>> the itemname, price and total amount in it.
>>>>>>>
>>>>>>> I don't know where it is going wrong, I've been stuck here for the
>>>>>>> last 4 days. I'm a beginner in django and python. Which logic is used 
>>>>>>> for
>>>>>>> this program?
>>>>>>> Please, please help me.
>>>>>>>
>>>>>>> PFA
>>>>>>>
>>>>>> --
>>>>>> 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/9feed719-8ab5-4523-80a1-ad062fe1999en%40googlegroups.com
>>>>>> <https://groups.google.com/d/msgid/django-user

Re: Help me Please - Django and python program

2021-06-22 Thread mayank sandikar
Hello sir,
I'm trying to insert the data in the table. For example in database
Itemname quantity price user-quantity amount
pen20  5   00
book  20 10  00

in my database I'm getting this result
pen20  5   00
book  20 10  00
 20

I want to take the itemname, quantity, and price in the last row as well.
In my html front view (screenshot 50) only the last text box is active in
the user quantity column.

please help me.
thank you



On Tue, Jun 22, 2021 at 2:58 PM DJANGO DEVELOPER 
wrote:

> according to your code, you're trying to update the product record. right?
> If so, then you're doing things the right way.
>
> On Tue, Jun 22, 2021 at 9:50 AM mayank sandikar <
> mayanksandikar191...@gmail.com> wrote:
>
>> hello , sir your mobile no. is not on whatsapp. please assist me  with
>> this
>>
>> On Mon, Jun 21, 2021 at 10:09 PM Onyemordi Daniel <
>> onyemordidan...@gmail.com> wrote:
>>
>>> Hello, have your problem been solved if no kindly contact me on WhatsApp
>>> 08167997730 to assist you better.
>>>
>>> On Mon, 21 Jun 2021, 07:07 mayank sandikar, <
>>> mayanksandikar191...@gmail.com> wrote:
>>>
>>>> https://github.com/Mayanksandikar/3-database
>>>>
>>>>
>>>> On Sun, Jun 20, 2021 at 4:08 PM Luciano Martins 
>>>> wrote:
>>>>
>>>>> Post your code on github and provide the link here
>>>>>
>>>>> Em sábado, 19 de junho de 2021 às 22:00:24 UTC-3,
>>>>> mayanksand...@gmail.com escreveu:
>>>>>
>>>>>> I have a few errors in my program.
>>>>>> 1. HTML
>>>>>> In my front view only my last text box is working and all the upper
>>>>>> text boxes are unassessable.
>>>>>> 2. Database
>>>>>> I am getting only the user quantity in the database but not getting
>>>>>> the itemname, price and total amount in it.
>>>>>>
>>>>>> I don't know where it is going wrong, I've been stuck here for the
>>>>>> last 4 days. I'm a beginner in django and python. Which logic is used for
>>>>>> this program?
>>>>>> Please, please help me.
>>>>>>
>>>>>> PFA
>>>>>>
>>>>> --
>>>>> 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/9feed719-8ab5-4523-80a1-ad062fe1999en%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/django-users/9feed719-8ab5-4523-80a1-ad062fe1999en%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/CAOS5mPyWASHhqgx947GwftVcmMq9PD9D6PLyHA5Kgv9DqY5GHQ%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAOS5mPyWASHhqgx947GwftVcmMq9PD9D6PLyHA5Kgv9DqY5GHQ%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/CA%2B-W-o66GbpFyKAbGCmeawjndTBUk%3DwqJaV%2B5Nf27siQmnA8Hw%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CA%2B-W-o66GbpFyKAbGCmeawjndTBUk%3DwqJaV%2B5Nf27siQmnA8Hw%40mail.gmail.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Dja

Re: Help me Please - Django and python program

2021-06-22 Thread DJANGO DEVELOPER
according to your code, you're trying to update the product record. right?
If so, then you're doing things the right way.

On Tue, Jun 22, 2021 at 9:50 AM mayank sandikar <
mayanksandikar191...@gmail.com> wrote:

> hello , sir your mobile no. is not on whatsapp. please assist me  with
> this
>
> On Mon, Jun 21, 2021 at 10:09 PM Onyemordi Daniel <
> onyemordidan...@gmail.com> wrote:
>
>> Hello, have your problem been solved if no kindly contact me on WhatsApp
>> 08167997730 to assist you better.
>>
>> On Mon, 21 Jun 2021, 07:07 mayank sandikar, <
>> mayanksandikar191...@gmail.com> wrote:
>>
>>> https://github.com/Mayanksandikar/3-database
>>>
>>>
>>> On Sun, Jun 20, 2021 at 4:08 PM Luciano Martins 
>>> wrote:
>>>
>>>> Post your code on github and provide the link here
>>>>
>>>> Em sábado, 19 de junho de 2021 às 22:00:24 UTC-3,
>>>> mayanksand...@gmail.com escreveu:
>>>>
>>>>> I have a few errors in my program.
>>>>> 1. HTML
>>>>> In my front view only my last text box is working and all the upper
>>>>> text boxes are unassessable.
>>>>> 2. Database
>>>>> I am getting only the user quantity in the database but not getting
>>>>> the itemname, price and total amount in it.
>>>>>
>>>>> I don't know where it is going wrong, I've been stuck here for the
>>>>> last 4 days. I'm a beginner in django and python. Which logic is used for
>>>>> this program?
>>>>> Please, please help me.
>>>>>
>>>>> PFA
>>>>>
>>>> --
>>>> 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/9feed719-8ab5-4523-80a1-ad062fe1999en%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/9feed719-8ab5-4523-80a1-ad062fe1999en%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/CAOS5mPyWASHhqgx947GwftVcmMq9PD9D6PLyHA5Kgv9DqY5GHQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAOS5mPyWASHhqgx947GwftVcmMq9PD9D6PLyHA5Kgv9DqY5GHQ%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/CA%2B-W-o66GbpFyKAbGCmeawjndTBUk%3DwqJaV%2B5Nf27siQmnA8Hw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CA%2B-W-o66GbpFyKAbGCmeawjndTBUk%3DwqJaV%2B5Nf27siQmnA8Hw%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/CAOS5mPxJXuV8vBvtFMYGkiiGqm5%3DZxhyuFBaxF_Q2COhZYWnBw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAOS5mPxJXuV8vBvtFMYGkiiGqm5%3DZxhyuFBaxF_Q2COhZYWnBw%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/CAKPY9pmTCn0i63Yb3VLfjpuK6aqyvkg4o2TGKv_rzGwOLiwh3A%40mail.gmail.com.


Re: Help me - Django and python

2021-06-22 Thread DJANGO DEVELOPER
your index.html


PASSWORD



{% if login == 'inactive' %}
User Inactive! Contact Admin!
{% elif login == 'invalid' %}
line 32 username or
password Invalid
{% endif%}
{% if tab_error == True %}
Invalid Tab Selected
{% endif %}



changed index.html


PASSWORD



{% if login == 'inactive' %}
User Inactive! Contact Admin!
{% else %}
line 32 username or
password Invalid
{% endif%}
{% if tab_error == True %}
Invalid Tab Selected
{% endif %}


On Tue, Jun 22, 2021 at 2:16 PM DJANGO DEVELOPER 
wrote:

> by seeing your code, it seems that only the 'else' part is working. have
> you provided value='{{dict_key.model_password_field}} in your html input
> element?
>
> On Tue, Jun 22, 2021 at 12:52 PM avdesh sharma 
> wrote:
>
>> Here is my View.py code
>>
>> from django.shortcuts import render
>> from django.http import HttpResponseRedirect
>> from django.urls import reverse
>> from django.contrib.auth import authenticate, logout, login
>> from django.contrib.auth.decorators import login_required
>> from student.models import *
>> from django.views.generic import TemplateView
>> import datetime, random
>> from django.contrib.auth.backends import BaseBackend
>> # Create your views here.
>>
>>
>> def index_view(request):
>> if request.method == 'POST':
>> username = request.POST.get('username')
>> password = request.POST.get('password')
>> tab_selected = request.POST.get('tab_selected')
>>
>> user = authenticate(username=username, password=password)
>> print(user)
>> if user:
>> # if get_user(username):
>> if user.is_active:
>> login(request, user)
>> request.session['username'] = username
>> request.session['tab_selected'] = tab_selected
>> if tab_selected == 'student_tab':
>> return HttpResponseRedirect(reverse('student:stud_home'))
>> elif tab_selected == 'dept_tab':
>> if username[:3] == 'hod':
>> return 
>> HttpResponseRedirect(reverse('student:hod_home'))
>> else:
>> return 
>> HttpResponseRedirect(reverse('student:dep_home'))
>> elif tab_selected == 'office_tab':
>> return HttpResponseRedirect(reverse('student:off_home'))
>> else:
>> user_login = 'inactive'
>> return render(request, 'student/index.html', 
>> context={'login': user_login})
>> else:
>> user_login = 'invalid'
>> return render(request, 'student/index.html', context={'login': 
>> user_login})
>> else:
>> return render(request, 'student/index.html', context={})
>>
>>
>> index.html
>>
>> 
>> PASSWORD
>> > class="form-control" name="password" placeholder="Enter Password">
>> 
>> 
>> {% if login == 'inactive' %}
>> User Inactive! Contact 
>> Admin!
>> {% elif login == 'invalid' %}
>> line 32 username or password 
>> Invalid
>> {% endif%}
>> {% if tab_error == True %}
>> Invalid Tab Selected
>> {% endif %}
>> 
>>
>>
>> On Tue, Jun 22, 2021 at 11:55 AM DJANGO DEVELOPER <
>> abubakarbr...@gmail.com> wrote:
>>
>>> can you please share your login view code?
>>>
>>> On Tue, Jun 22, 2021 at 10:12 AM avdesh sharma <
>>> avdeshsharma...@gmail.com> wrote:
>>>
 Hi All,

 I have an issue coming in my django code, even though the user id and
 password is present in sqlite3 db still  the user is giving '*None'*
 value
 user = authenticate(username=username, password=password)

 and I am not able to login with user and throwing this error.

 [image: image.png]




 --
 Warm Regards,
 Avdesh Kumar Sharma
 9650031844

 --
 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/CAF5Nfo65s-8c75FRkhF0rN7Sh0aUH6eKNBbQ--OMawNPCVX13w%40mail.gmail.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/CAKPY9p%3DSQDqv12b8K52FuG9mp40SM9sLFAQ4meaPM37NJxM4zQ%40mail.gmail.com
>>> 
>>> .
>>>
>>

Re: Help me - Django and python

2021-06-22 Thread DJANGO DEVELOPER
by seeing your code, it seems that only the 'else' part is working. have
you provided value='{{dict_key.model_password_field}} in your html input
element?

On Tue, Jun 22, 2021 at 12:52 PM avdesh sharma 
wrote:

> Here is my View.py code
>
> from django.shortcuts import render
> from django.http import HttpResponseRedirect
> from django.urls import reverse
> from django.contrib.auth import authenticate, logout, login
> from django.contrib.auth.decorators import login_required
> from student.models import *
> from django.views.generic import TemplateView
> import datetime, random
> from django.contrib.auth.backends import BaseBackend
> # Create your views here.
>
>
> def index_view(request):
> if request.method == 'POST':
> username = request.POST.get('username')
> password = request.POST.get('password')
> tab_selected = request.POST.get('tab_selected')
>
> user = authenticate(username=username, password=password)
> print(user)
> if user:
> # if get_user(username):
> if user.is_active:
> login(request, user)
> request.session['username'] = username
> request.session['tab_selected'] = tab_selected
> if tab_selected == 'student_tab':
> return HttpResponseRedirect(reverse('student:stud_home'))
> elif tab_selected == 'dept_tab':
> if username[:3] == 'hod':
> return 
> HttpResponseRedirect(reverse('student:hod_home'))
> else:
> return 
> HttpResponseRedirect(reverse('student:dep_home'))
> elif tab_selected == 'office_tab':
> return HttpResponseRedirect(reverse('student:off_home'))
> else:
> user_login = 'inactive'
> return render(request, 'student/index.html', 
> context={'login': user_login})
> else:
> user_login = 'invalid'
> return render(request, 'student/index.html', context={'login': 
> user_login})
> else:
> return render(request, 'student/index.html', context={})
>
>
> index.html
>
> 
> PASSWORD
>  class="form-control" name="password" placeholder="Enter Password">
> 
> 
> {% if login == 'inactive' %}
> User Inactive! Contact 
> Admin!
> {% elif login == 'invalid' %}
> line 32 username or password 
> Invalid
> {% endif%}
> {% if tab_error == True %}
> Invalid Tab Selected
> {% endif %}
> 
>
>
> On Tue, Jun 22, 2021 at 11:55 AM DJANGO DEVELOPER 
> wrote:
>
>> can you please share your login view code?
>>
>> On Tue, Jun 22, 2021 at 10:12 AM avdesh sharma 
>> wrote:
>>
>>> Hi All,
>>>
>>> I have an issue coming in my django code, even though the user id and
>>> password is present in sqlite3 db still  the user is giving '*None'*
>>> value
>>> user = authenticate(username=username, password=password)
>>>
>>> and I am not able to login with user and throwing this error.
>>>
>>> [image: image.png]
>>>
>>>
>>>
>>>
>>> --
>>> Warm Regards,
>>> Avdesh Kumar Sharma
>>> 9650031844
>>>
>>> --
>>> 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/CAF5Nfo65s-8c75FRkhF0rN7Sh0aUH6eKNBbQ--OMawNPCVX13w%40mail.gmail.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/CAKPY9p%3DSQDqv12b8K52FuG9mp40SM9sLFAQ4meaPM37NJxM4zQ%40mail.gmail.com
>> 
>> .
>>
>
>
> --
> Warm Regards,
> Avdesh Kumar Sharma
> 9650031844
>
> --
> 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/CAF5Nfo7JkSetxb-kfGAjnRLJiCBG%2BvOEcgj38Oe0migcXEffvg%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To 

Re: Help me - Django and python

2021-06-22 Thread avdesh sharma
Here is my View.py code

from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.contrib.auth import authenticate, logout, login
from django.contrib.auth.decorators import login_required
from student.models import *
from django.views.generic import TemplateView
import datetime, random
from django.contrib.auth.backends import BaseBackend
# Create your views here.


def index_view(request):
if request.method == 'POST':
username = request.POST.get('username')
password = request.POST.get('password')
tab_selected = request.POST.get('tab_selected')

user = authenticate(username=username, password=password)
print(user)
if user:
# if get_user(username):
if user.is_active:
login(request, user)
request.session['username'] = username
request.session['tab_selected'] = tab_selected
if tab_selected == 'student_tab':
return HttpResponseRedirect(reverse('student:stud_home'))
elif tab_selected == 'dept_tab':
if username[:3] == 'hod':
return HttpResponseRedirect(reverse('student:hod_home'))
else:
return HttpResponseRedirect(reverse('student:dep_home'))
elif tab_selected == 'office_tab':
return HttpResponseRedirect(reverse('student:off_home'))
else:
user_login = 'inactive'
return render(request, 'student/index.html',
context={'login': user_login})
else:
user_login = 'invalid'
return render(request, 'student/index.html',
context={'login': user_login})
else:
return render(request, 'student/index.html', context={})


index.html


PASSWORD



{% if login == 'inactive' %}
User Inactive! Contact Admin!
{% elif login == 'invalid' %}
line 32 username or
password Invalid
{% endif%}
{% if tab_error == True %}
Invalid Tab Selected
{% endif %}



On Tue, Jun 22, 2021 at 11:55 AM DJANGO DEVELOPER 
wrote:

> can you please share your login view code?
>
> On Tue, Jun 22, 2021 at 10:12 AM avdesh sharma 
> wrote:
>
>> Hi All,
>>
>> I have an issue coming in my django code, even though the user id and
>> password is present in sqlite3 db still  the user is giving '*None'*
>> value
>> user = authenticate(username=username, password=password)
>>
>> and I am not able to login with user and throwing this error.
>>
>> [image: image.png]
>>
>>
>>
>>
>> --
>> Warm Regards,
>> Avdesh Kumar Sharma
>> 9650031844
>>
>> --
>> 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/CAF5Nfo65s-8c75FRkhF0rN7Sh0aUH6eKNBbQ--OMawNPCVX13w%40mail.gmail.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/CAKPY9p%3DSQDqv12b8K52FuG9mp40SM9sLFAQ4meaPM37NJxM4zQ%40mail.gmail.com
> 
> .
>


-- 
Warm Regards,
Avdesh Kumar Sharma
9650031844

-- 
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/CAF5Nfo7JkSetxb-kfGAjnRLJiCBG%2BvOEcgj38Oe0migcXEffvg%40mail.gmail.com.


Re: Help me - Django and python

2021-06-22 Thread DJANGO DEVELOPER
I think you're not returning anything in your model.

On Tue, Jun 22, 2021 at 11:24 AM DJANGO DEVELOPER 
wrote:

> can you please share your login view code?
>
> On Tue, Jun 22, 2021 at 10:12 AM avdesh sharma 
> wrote:
>
>> Hi All,
>>
>> I have an issue coming in my django code, even though the user id and
>> password is present in sqlite3 db still  the user is giving '*None'*
>> value
>> user = authenticate(username=username, password=password)
>>
>> and I am not able to login with user and throwing this error.
>>
>> [image: image.png]
>>
>>
>>
>>
>> --
>> Warm Regards,
>> Avdesh Kumar Sharma
>> 9650031844
>>
>> --
>> 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/CAF5Nfo65s-8c75FRkhF0rN7Sh0aUH6eKNBbQ--OMawNPCVX13w%40mail.gmail.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/CAKPY9pkhbyHHZ_gJHbBaVMZZshhGL2ML9c2wURxfJ27X%2B%2B4ETQ%40mail.gmail.com.


Re: Help me - Django and python

2021-06-22 Thread DJANGO DEVELOPER
can you please share your login view code?

On Tue, Jun 22, 2021 at 10:12 AM avdesh sharma 
wrote:

> Hi All,
>
> I have an issue coming in my django code, even though the user id and
> password is present in sqlite3 db still  the user is giving '*None'*
> value
> user = authenticate(username=username, password=password)
>
> and I am not able to login with user and throwing this error.
>
> [image: image.png]
>
>
>
>
> --
> Warm Regards,
> Avdesh Kumar Sharma
> 9650031844
>
> --
> 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/CAF5Nfo65s-8c75FRkhF0rN7Sh0aUH6eKNBbQ--OMawNPCVX13w%40mail.gmail.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/CAKPY9p%3DSQDqv12b8K52FuG9mp40SM9sLFAQ4meaPM37NJxM4zQ%40mail.gmail.com.


Help me - Django and python

2021-06-21 Thread avdesh sharma
Hi All,

I have an issue coming in my django code, even though the user id and
password is present in sqlite3 db still  the user is giving '*None'* value
user = authenticate(username=username, password=password)

and I am not able to login with user and throwing this error.

[image: image.png]




-- 
Warm Regards,
Avdesh Kumar Sharma
9650031844

-- 
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/CAF5Nfo65s-8c75FRkhF0rN7Sh0aUH6eKNBbQ--OMawNPCVX13w%40mail.gmail.com.


Re: Help me Please - Django and python program

2021-06-21 Thread mayank sandikar
hello , sir your mobile no. is not on whatsapp. please assist me  with  this

On Mon, Jun 21, 2021 at 10:09 PM Onyemordi Daniel 
wrote:

> Hello, have your problem been solved if no kindly contact me on WhatsApp
> 08167997730 to assist you better.
>
> On Mon, 21 Jun 2021, 07:07 mayank sandikar, <
> mayanksandikar191...@gmail.com> wrote:
>
>> https://github.com/Mayanksandikar/3-database
>>
>>
>> On Sun, Jun 20, 2021 at 4:08 PM Luciano Martins 
>> wrote:
>>
>>> Post your code on github and provide the link here
>>>
>>> Em sábado, 19 de junho de 2021 às 22:00:24 UTC-3,
>>> mayanksand...@gmail.com escreveu:
>>>
>>>> I have a few errors in my program.
>>>> 1. HTML
>>>> In my front view only my last text box is working and all the upper
>>>> text boxes are unassessable.
>>>> 2. Database
>>>> I am getting only the user quantity in the database but not getting the
>>>> itemname, price and total amount in it.
>>>>
>>>> I don't know where it is going wrong, I've been stuck here for the last
>>>> 4 days. I'm a beginner in django and python. Which logic is used for this
>>>> program?
>>>> Please, please help me.
>>>>
>>>> PFA
>>>>
>>> --
>>> 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/9feed719-8ab5-4523-80a1-ad062fe1999en%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/9feed719-8ab5-4523-80a1-ad062fe1999en%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/CAOS5mPyWASHhqgx947GwftVcmMq9PD9D6PLyHA5Kgv9DqY5GHQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAOS5mPyWASHhqgx947GwftVcmMq9PD9D6PLyHA5Kgv9DqY5GHQ%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/CA%2B-W-o66GbpFyKAbGCmeawjndTBUk%3DwqJaV%2B5Nf27siQmnA8Hw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CA%2B-W-o66GbpFyKAbGCmeawjndTBUk%3DwqJaV%2B5Nf27siQmnA8Hw%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/CAOS5mPxJXuV8vBvtFMYGkiiGqm5%3DZxhyuFBaxF_Q2COhZYWnBw%40mail.gmail.com.


Re: Help me Please - Django and python program

2021-06-21 Thread Onyemordi Daniel
Hello, have your problem been solved if no kindly contact me on WhatsApp
08167997730 to assist you better.

On Mon, 21 Jun 2021, 07:07 mayank sandikar, 
wrote:

> https://github.com/Mayanksandikar/3-database
>
>
> On Sun, Jun 20, 2021 at 4:08 PM Luciano Martins 
> wrote:
>
>> Post your code on github and provide the link here
>>
>> Em sábado, 19 de junho de 2021 às 22:00:24 UTC-3, mayanksand...@gmail.com
>> escreveu:
>>
>>> I have a few errors in my program.
>>> 1. HTML
>>> In my front view only my last text box is working and all the upper text
>>> boxes are unassessable.
>>> 2. Database
>>> I am getting only the user quantity in the database but not getting the
>>> itemname, price and total amount in it.
>>>
>>> I don't know where it is going wrong, I've been stuck here for the last
>>> 4 days. I'm a beginner in django and python. Which logic is used for this
>>> program?
>>> Please, please help me.
>>>
>>> PFA
>>>
>> --
>> 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/9feed719-8ab5-4523-80a1-ad062fe1999en%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/9feed719-8ab5-4523-80a1-ad062fe1999en%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/CAOS5mPyWASHhqgx947GwftVcmMq9PD9D6PLyHA5Kgv9DqY5GHQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAOS5mPyWASHhqgx947GwftVcmMq9PD9D6PLyHA5Kgv9DqY5GHQ%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/CA%2B-W-o66GbpFyKAbGCmeawjndTBUk%3DwqJaV%2B5Nf27siQmnA8Hw%40mail.gmail.com.


Re: PLS HELP!! - SCRAPE YOUTUBE CHANNEL EMAIL

2021-06-21 Thread Sunday Iyanu Ajayi
You can use python package : beautifulsoup and selenium
*AJAYI Sunday *
(+234) 806 771 5394
*sunnexaj...@gmail.com *



On Sun, Jun 20, 2021 at 1:59 AM Vrushang Desai 
wrote:

> Hi Guys ,
> Anyone knows how to scrape Youtube Channels Emails?
>
> With Django/Python?
>
> If yes,
> Pls reply!
> Thanks.
>
> --
> 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/75971331-aa7a-41e3-879f-42bd80bf7984n%40googlegroups.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/CAKYSAw3sbzxmHK%3D4GkEcSUW6DigzpfhxHzEDTkg-EJhza7oa4A%40mail.gmail.com.


Re: Help me Please - Django and python program

2021-06-21 Thread mayank sandikar
https://github.com/Mayanksandikar/3-database


On Sun, Jun 20, 2021 at 4:08 PM Luciano Martins  wrote:

> Post your code on github and provide the link here
>
> Em sábado, 19 de junho de 2021 às 22:00:24 UTC-3, mayanksand...@gmail.com
> escreveu:
>
>> I have a few errors in my program.
>> 1. HTML
>> In my front view only my last text box is working and all the upper text
>> boxes are unassessable.
>> 2. Database
>> I am getting only the user quantity in the database but not getting the
>> itemname, price and total amount in it.
>>
>> I don't know where it is going wrong, I've been stuck here for the last 4
>> days. I'm a beginner in django and python. Which logic is used for this
>> program?
>> Please, please help me.
>>
>> PFA
>>
> --
> 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/9feed719-8ab5-4523-80a1-ad062fe1999en%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/9feed719-8ab5-4523-80a1-ad062fe1999en%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/CAOS5mPyWASHhqgx947GwftVcmMq9PD9D6PLyHA5Kgv9DqY5GHQ%40mail.gmail.com.


Re: PLS HELP!! - SCRAPE YOUTUBE CHANNEL EMAIL

2021-06-20 Thread Jacob Greene
Might be easier and more reliable to use the API.

https://developers.google.com/youtube/v3

On Sun, Jun 20, 2021, 7:21 AM Priyesh Ranjan 
wrote:

> yes i can do that for you
>
> On Sun, Jun 20, 2021 at 6:29 AM Vrushang Desai 
> wrote:
>
>> Hi Guys ,
>> Anyone knows how to scrape Youtube Channels Emails?
>>
>> With Django/Python?
>>
>> If yes,
>> Pls reply!
>> Thanks.
>>
>> --
>> 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/75971331-aa7a-41e3-879f-42bd80bf7984n%40googlegroups.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/CAB51kLSj84dBb-g1Qi72HtSxVaCKai9-mz-8H%3DUV-bGfC4O60g%40mail.gmail.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/CAF-Y%3De4zNfkTE88Y1Dj8qQqMU5GsPBHu%2B7mEM%2BUek1MjJYCa8w%40mail.gmail.com.


<    1   2   3   4   5   6   7   8   9   10   >