Python problem

2019-12-15 Thread Soumen Khatua
Hi Folks,
I'm stucking in this problem from 5 hours but still I'm not bale to logic
to solve this problem, Please help me guys to solve this problem:

Example:-
input: h123456ello
output: o123456lleh

input: th34isisast56ring3
output: gn34irtsasi56siht3

Thank you in advance.

regards,
Soumen

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


Re: Python problem

2019-12-15 Thread Chetan Ganji
# input: h123456ello
# output: o123456lleh

# input: th34isisast56ring3
# output: gn34irtsasi56siht3


order = {}
characters = ""
input_string = "h123456ello"
# input_string = "th34isisast56ring3"
counter = 0
output_string = ""


for index, character in enumerate(input_string):
order[index] = character

for item in range(0, len(input_string)):
if input_string[item].isalpha():
characters += input_string[item]

# reversing the string
characters = characters[::-1]

for index, item in enumerate(range(0, len(input_string))) :
if input_string[item].isalpha():
order[index] = characters[counter]
counter += 1

for index in range(0, len(input_string)):
output_string += order[index]

print()
print(input_string)
print(output_string)
print()




Regards,
Chetan Ganji
+91-900-483-4183
ganji.che...@gmail.com
http://ryucoder.in


On Sun, Dec 15, 2019 at 8:14 PM Soumen Khatua 
wrote:

> Hi Folks,
> I'm stucking in this problem from 5 hours but still I'm not bale to logic
> to solve this problem, Please help me guys to solve this problem:
>
> Example:-
> input: h123456ello
> output: o123456lleh
>
> input: th34isisast56ring3
> output: gn34irtsasi56siht3
>
> Thank you in advance.
>
> regards,
> Soumen
>
> --
> 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/CAPUw6Wa8LqGGnqbsiKvYrBw6WQkBaqjm9b8Re65PM3zJr1rdkA%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/CAMKMUjsLe0zo9_B70dNNq%2Bk_xwOTGt-cs%2BGeqagM-wZk8yYzLA%40mail.gmail.com.


Re: Python problem

2019-12-15 Thread Gil Obradors
Chetan, you're a genius!

Missatge de Chetan Ganji  del dia dg., 15 de des.
2019 a les 16:28:

> # input: h123456ello
> # output: o123456lleh
>
> # input: th34isisast56ring3
> # output: gn34irtsasi56siht3
>
>
> order = {}
> characters = ""
> input_string = "h123456ello"
> # input_string = "th34isisast56ring3"
> counter = 0
> output_string = ""
>
>
> for index, character in enumerate(input_string):
> order[index] = character
>
> for item in range(0, len(input_string)):
> if input_string[item].isalpha():
> characters += input_string[item]
>
> # reversing the string
> characters = characters[::-1]
>
> for index, item in enumerate(range(0, len(input_string))) :
> if input_string[item].isalpha():
> order[index] = characters[counter]
> counter += 1
>
> for index in range(0, len(input_string)):
> output_string += order[index]
>
> print()
> print(input_string)
> print(output_string)
> print()
>
>
>
>
> Regards,
> Chetan Ganji
> +91-900-483-4183
> ganji.che...@gmail.com
> http://ryucoder.in
>
>
> On Sun, Dec 15, 2019 at 8:14 PM Soumen Khatua 
> wrote:
>
>> Hi Folks,
>> I'm stucking in this problem from 5 hours but still I'm not bale to logic
>> to solve this problem, Please help me guys to solve this problem:
>>
>> Example:-
>> input: h123456ello
>> output: o123456lleh
>>
>> input: th34isisast56ring3
>> output: gn34irtsasi56siht3
>>
>> Thank you in advance.
>>
>> regards,
>> Soumen
>>
>> --
>> 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/CAPUw6Wa8LqGGnqbsiKvYrBw6WQkBaqjm9b8Re65PM3zJr1rdkA%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/CAMKMUjsLe0zo9_B70dNNq%2Bk_xwOTGt-cs%2BGeqagM-wZk8yYzLA%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/CAK-JoTStv3AUaAt7gOJjUhXtmqxXgaDqE3eC_fj5ak48Gb73Cg%40mail.gmail.com.


how to update many to many fields in django?

2019-12-15 Thread Ahmad Ebrahim
I'm struggling with this problem for 2 weeks please help me.

https://stackoverflow.com/questions/59269426/how-to-update-many-to-many-fields


regards.

-- 
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/acaae2ac-b322-4549-90ef-79f1aa4757d4%40googlegroups.com.


Re: Python problem

2019-12-15 Thread Soumen Khatua
Thanks a lot.

On Sun, Dec 15, 2019 at 9:07 PM Gil Obradors  wrote:

> Chetan, you're a genius!
>
> Missatge de Chetan Ganji  del dia dg., 15 de des.
> 2019 a les 16:28:
>
>> # input: h123456ello
>> # output: o123456lleh
>>
>> # input: th34isisast56ring3
>> # output: gn34irtsasi56siht3
>>
>>
>> order = {}
>> characters = ""
>> input_string = "h123456ello"
>> # input_string = "th34isisast56ring3"
>> counter = 0
>> output_string = ""
>>
>>
>> for index, character in enumerate(input_string):
>> order[index] = character
>>
>> for item in range(0, len(input_string)):
>> if input_string[item].isalpha():
>> characters += input_string[item]
>>
>> # reversing the string
>> characters = characters[::-1]
>>
>> for index, item in enumerate(range(0, len(input_string))) :
>> if input_string[item].isalpha():
>> order[index] = characters[counter]
>> counter += 1
>>
>> for index in range(0, len(input_string)):
>> output_string += order[index]
>>
>> print()
>> print(input_string)
>> print(output_string)
>> print()
>>
>>
>>
>>
>> Regards,
>> Chetan Ganji
>> +91-900-483-4183
>> ganji.che...@gmail.com
>> http://ryucoder.in
>>
>>
>> On Sun, Dec 15, 2019 at 8:14 PM Soumen Khatua 
>> wrote:
>>
>>> Hi Folks,
>>> I'm stucking in this problem from 5 hours but still I'm not bale to
>>> logic to solve this problem, Please help me guys to solve this problem:
>>>
>>> Example:-
>>> input: h123456ello
>>> output: o123456lleh
>>>
>>> input: th34isisast56ring3
>>> output: gn34irtsasi56siht3
>>>
>>> Thank you in advance.
>>>
>>> regards,
>>> Soumen
>>>
>>> --
>>> 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/CAPUw6Wa8LqGGnqbsiKvYrBw6WQkBaqjm9b8Re65PM3zJr1rdkA%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/CAMKMUjsLe0zo9_B70dNNq%2Bk_xwOTGt-cs%2BGeqagM-wZk8yYzLA%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/CAK-JoTStv3AUaAt7gOJjUhXtmqxXgaDqE3eC_fj5ak48Gb73Cg%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/CAPUw6WZGftF_GZP1fm4E-FDNvYPvfO5uiQbVgX%2BVv_NwA%3DMQvA%40mail.gmail.com.


Re: gunicorn.errors.HaltServer:

2019-12-15 Thread Integr@te System
Hi Issuer,

Try to run command: --preload to whatsup with worker processes and app and
server.

On Sun, Dec 15, 2019, 13:32 Ram  wrote:

> Hi,
>
> I followed this document
> 
> and I’m hitting this error. Could you let me know what I’m missing? I tried
> several things the whole day and nothing has worked? Please let me know if
> you have any solution on this error?
>
> >>> $ sudo systemctl status gunicorn.socket
> >>> Failed to dump process list, ignoring: No such file or directory
> >>> ● gunicorn.socket - gunicorn socket
> >>>Loaded: loaded (/etc/systemd/system/gunicorn.socket; enabled;
> vendor preset: enabled)
> >>>Active: active (listening) since Sun 2019-12-15 05:15:27 UTC; 17s
> ago
> >>>Listen: /home/xx/myproject/myapp/myapp.sock (Stream)
> >>>CGroup: /system.slice/gunicorn.socket
> >>>
> >>> Dec 15 05:15:27 ubuntu-s-01 systemd[1]: Listening on gunicorn socket.
> >>>
> >>>
> >>> $ sudo systemctl status gunicorn.service
> >>> ● gunicorn.service - gunicorn daemon
> >>>Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled;
> vendor preset: enabled)
> >>>Active: failed (Result: exit-code) since Sun 2019-12-15 04:22:54
> UTC; 53min ago
> >>>  Main PID: 15788 (code=exited, status=1/FAILURE)
> >>>
> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: self.stop()
> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:   File
> "/home/xx/myproject/xxenv/lib/python3.6/site-packages/gunicorn/arbi
> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: time.sleep(0.1)
> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:   File
> "/home/xx/myproject/xxkenv/lib/python3.6/site-packages/gunicorn/arbi
> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: self.reap_workers()
> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:   File
> "/home/xx/myproject/xxenv/lib/python3.6/site-packages/gunicorn/arbi
> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: raise
> HaltServer(reason, self.WORKER_BOOT_ERROR)
> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:
> gunicorn.errors.HaltServer: 
> >>> Dec 15 04:22:54 ubuntu-s-01 systemd[1]: gunicorn.service: Main process
> exited, code=exited, status=1/FAILURE
> >>> Dec 15 04:22:54 ubuntu-s-01 systemd[1]: gunicorn.service: Failed with
> result 'exit-code'.
>
> --
> 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%2BOi5F1FL%3D3eBo7KAu%3DsmSV%2BuCUnUHk7q32TdkkeVGMznUtp7Q%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/CAP5HUWrcFKT1y_Z0tkQ2qp5Gf-RJ9TPKu33Kmudka1sAu3rymw%40mail.gmail.com.


Re: how to update many to many fields in django?

2019-12-15 Thread Motaz Hejaze
Call me on skype lets see your code and your problem ..

My skype :

m3tz-hjze

On Sun, 15 Dec 2019, 5:49 pm Ahmad Ebrahim,  wrote:

> I'm struggling with this problem for 2 weeks please help me.
>
>
> https://stackoverflow.com/questions/59269426/how-to-update-many-to-many-fields
>
>
> regards.
>
> --
> 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/acaae2ac-b322-4549-90ef-79f1aa4757d4%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/CAHV4E-eS23P4_V1-6SoHE%2BqczpXgPB0miNsr%3DF8iVQPEBLt1pg%40mail.gmail.com.


Re: Looking for internship

2019-12-15 Thread talha qamar
python

On Wed, Dec 11, 2019 at 5:23 PM Abhishek Satbhai <
abhishek07satb...@gmail.com> wrote:

> Which programing languages you know?
>
> On Wednesday, December 11, 2019 at 9:33:37 AM UTC+5:30, Anirudh choudhary
> wrote:
>>
>> Hello all
>> I am looking for internship in Delhi or pune. I am currently in 6 sem of
>> engineering mechatronics in ADYPU.
>> I am ready to work as part time , full time, home based.
>> Thankyou
>>
>> --
> 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/06076220-1c81-43ff-bd8c-280b6d1c1590%40googlegroups.com
> 
> .
>


-- 



Muhammad Talha

*Jounair ERP Deveeloper*
Engineering Research & IT Services Provider (Pvt.) Ltd.
m: +923419174036







*This e-mail and any files transmitted with it are confidential to the
intended recipient and may be privileged. If you are not the intended
recipient, please immediately notify the sender. Whilst we have used
Anti-Virus software to alert us to the presence of computer viruses, we
cannot guarantee that this email and any files transmitted with it are free
from them.*N : Think before print do you really need this on paper. 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/CAJEPo9g0gNpz7kTgeO_yPq940YQ-DEAfGbTj8ekCb0x%3DNot1mw%40mail.gmail.com.


I am creating a project management app Each user has multiple projects and each project has a set of data When first logged in the user sees a list of all the projects only he created.i am able to do

2019-12-15 Thread Raviteja Reddy


class projectsmodel(models.Model):
added_by = 
models.ForeignKey(settings.AUTH_USER_MODEL,null=True,blank=True,on_delete=models.SET_NULL)
projects=models.CharField(max_length=300)

def save_model(self,request,obj,form,change):
obj.added_by=request.User
super().save_model(request,obj,form,change)
def __str__(self):
return self.projects

My BOQ Model,it is the model that needs to be filtered based on project it 
is redirected from

class boqmodel(models.Model):
project_name = models.ForeignKey(projectsmodel, null=True, blank=True, 
on_delete=models.SET_NULL)
code = models.IntegerField()
building = models.ForeignKey(building, on_delete=models.SET_NULL, null=True)
level = models.ForeignKey(level, on_delete=models.SET_NULL, null=True)
activity = models.ForeignKey(activity, on_delete=models.SET_NULL, null=True)
subactivity = models.ForeignKey(sub_activity, on_delete=models.SET_NULL, 
null=True)
duration = models.IntegerField()
linkactivity = models.CharField(max_length=300, null=True, blank=True)
linktype = models.CharField(choices=choicestype, max_length=300, null=True, 
blank=True)
linkduration = models.IntegerField(default=0)
plannedstart = models.DateField(null=True, blank=True)
plannedfinish = models.DateField(null=True, blank=True)
actualstart = models.DateField(null=True, blank=True)
actualfinish = models.DateField(null=True, blank=True)

-- 
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/0ff70f63-df88-430a-ba3c-4b0273395999%40googlegroups.com.


user login not working anyone please help

2019-12-15 Thread Sai Yuva Teja Gorthy
github repo is https://github.com/Yuvateja01/project.please 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/ab63ca8f-a3a5-4c44-9b15-6ccb9eda1e83%40googlegroups.com.


Re: [Django] How to render a form 'n' number of times based on the dropdown selected integer in main Form

2019-12-15 Thread Dominick Del Ponte
If you don't want to use JS you'll need to have the first form POST in
order to send the number of forms to render to the backend. Then you should
be able to use formsets

with the 'extra' attribute to render multiple identical forms.


Dominick
delponte.d...@gmail.com



On Sun, Dec 15, 2019 at 6:23 AM Dilipkumar Noone  wrote:

> 1.I have the below requirement in django to implement.
>
> a)I have a main form with a few fields [text input fields,choice fields ]
>
> b)Based on the user input on integer field from the dropdown box in a
> template, i need to display few more fields waiting for the user input.
> Ex:If user selected an integer :3 i need to display another form 3 times
> containing few fields [ text input fields,choice fields] in the same html
> django template.[Say it is SubForm1]
>
> c) Again based on dropdown selection in subform1
>
> i need to display few more fields waiting for the user input. Ex:If user
> selected an integer :4 i need to display another form 3 times containing
> few fields [ text input fields,choice fields] in the same html django
> template.[Say it is SubForm2]
>
>
> How to accomplish this .Can some one please share if any tutorial or any
> similar post already done at any place
>
> Basically i dont know much javascript/jquery .
>
>
> can we accomplish this only using django forms & templates with out using
> javascript or jquery?
>
>
>
> --
> 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/da38e49c-c49a-4236-acf1-f79e4dfb678a%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/CALLhV5TGM-Jc7PA8cvir2JSo_RxzcBPgDQh9wZDJVmsX5EOUug%40mail.gmail.com.


Re: gunicorn.errors.HaltServer:

2019-12-15 Thread Ram
Hi Integr,

Thank you for the answer but I don't see '--preload' option for the same
command. Am I missing anything?

>
> $ sudo systemctl --preload gunicorn.service
>> systemctl: unrecognized option '--preload'
>>
> $ sudo systemctl status gunicorn.service --preload
> systemctl: unrecognized option '--preload'
> $ sudo systemctl --help | grep preload
>

~Ram



On Sun, Dec 15, 2019 at 10:32 AM Integr@te System 
wrote:

> Hi Issuer,
>
> Try to run command: --preload to whatsup with worker processes and app and
> server.
>
> On Sun, Dec 15, 2019, 13:32 Ram  wrote:
>
>> Hi,
>>
>> I followed this document
>> 
>> and I’m hitting this error. Could you let me know what I’m missing? I tried
>> several things the whole day and nothing has worked? Please let me know if
>> you have any solution on this error?
>>
>> >>> $ sudo systemctl status gunicorn.socket
>> >>> Failed to dump process list, ignoring: No such file or directory
>> >>> ● gunicorn.socket - gunicorn socket
>> >>>Loaded: loaded (/etc/systemd/system/gunicorn.socket; enabled;
>> vendor preset: enabled)
>> >>>Active: active (listening) since Sun 2019-12-15 05:15:27 UTC; 17s
>> ago
>> >>>Listen: /home/xx/myproject/myapp/myapp.sock (Stream)
>> >>>CGroup: /system.slice/gunicorn.socket
>> >>>
>> >>> Dec 15 05:15:27 ubuntu-s-01 systemd[1]: Listening on gunicorn socket.
>> >>>
>> >>>
>> >>> $ sudo systemctl status gunicorn.service
>> >>> ● gunicorn.service - gunicorn daemon
>> >>>Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled;
>> vendor preset: enabled)
>> >>>Active: failed (Result: exit-code) since Sun 2019-12-15 04:22:54
>> UTC; 53min ago
>> >>>  Main PID: 15788 (code=exited, status=1/FAILURE)
>> >>>
>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: self.stop()
>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:   File
>> "/home/xx/myproject/xxenv/lib/python3.6/site-packages/gunicorn/arbi
>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: time.sleep(0.1)
>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:   File
>> "/home/xx/myproject/xxkenv/lib/python3.6/site-packages/gunicorn/arbi
>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: self.reap_workers()
>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:   File
>> "/home/xx/myproject/xxenv/lib/python3.6/site-packages/gunicorn/arbi
>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: raise
>> HaltServer(reason, self.WORKER_BOOT_ERROR)
>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:
>> gunicorn.errors.HaltServer: 
>> >>> Dec 15 04:22:54 ubuntu-s-01 systemd[1]: gunicorn.service: Main
>> process exited, code=exited, status=1/FAILURE
>> >>> Dec 15 04:22:54 ubuntu-s-01 systemd[1]: gunicorn.service: Failed with
>> result 'exit-code'.
>>
>> --
>> 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%2BOi5F1FL%3D3eBo7KAu%3DsmSV%2BuCUnUHk7q32TdkkeVGMznUtp7Q%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/CAP5HUWrcFKT1y_Z0tkQ2qp5Gf-RJ9TPKu33Kmudka1sAu3rymw%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/CA%2BOi5F3J4%2B3XevY0QmgEVYVqbyiKf0aAXJhF4fkn65sBOGmXgA%40mail.gmail.com.


Re: I am creating a project management app Each user has multiple projects and each project has a set of data When first logged in the user sees a list of all the projects only he created.i am able to

2019-12-15 Thread Parth Joshi
Question is trimmed in the subject line. Can you paste it in description?




> On 15-Dec-2019, at 10:50 PM, Raviteja Reddy  wrote:
> 
> https://groups.google.com/d/msgid/django-users/0ff70f63-df88-430a-ba3c-4b0273395999%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/69286006-520D-4B63-9379-96032359C4AE%40gmail.com.


Daphne SIGKILLS on production server

2019-12-15 Thread Vaisagh Viswanathan
Hi,

We recently changed to django 2.x and channels. 2.2 from a system that has
been running relatively stable on channels 1.x for almost 3 years now. Our
tests did not show any issues when we were running django channels in our
test servers. And even when we tried load testing with frequent requests,
the errors were not unexpected i.e. there would be conenctions dropped and
a few 502s.  ANd as soon as the load was cut off things would work fine.

This changed drastically when we deployed it in our prod environment. Our
daphne process SIGKILLS every few minutes and as a result our websockets
connections are extremely unstable and requires frequent reconnects. Our
setup is such that we have an AWS ALB sitting in front of NGINX that
directs all non-websockets traffic to a gunicorn process (which is pretty
stable) and all websockets traffic to a daphne process.

We tried Uvicorn in the middle as well, howeer Uvicorn wouldn't sigkill
itself but it was just as unresponsive.

Our ELB logs show a steady stream of 502 errors.

We have been dealing with these issues for around 2 days now and are
completely lost. If you coud give some advice on where we should be looking
at. What could be causing SIGKILLS, that would be seriously awesome.

Regards,
Vaisagh

-- 
_This message contains confidential information and is intended only for 
the individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately by e-mail if you have received this e-mail by mistake and 
delete this e-mail from your system. E-mail transmission cannot be 
guaranteed to be secure or error-free as information could be intercepted, 
corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. 
The sender therefore does not accept liability for any errors or omissions 
in the contents of this message, which arise as a result of e-mail 
transmission. "impress.ai " and "Impress" are brands of 
Ideatory Pte. Ltd., #08-01, 80 Robinson Road, Singapore - 068898, 
https://impress.ai ._

-- 
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/CADjVUwkjG856hP6XXuj4_fmKdoY05ZVY88qVoUW-1SRR%2Bd16EA%40mail.gmail.com.


Re: Daphne SIGKILLS on production server

2019-12-15 Thread Vaisagh Viswanathan
I forgot to mention supervisor is my process manager.

On Monday, December 16, 2019 at 12:08:55 PM UTC+8, Vaisagh Viswanathan 
wrote:
>
> Hi,
>
> We recently changed to django 2.x and channels. 2.2 from a system that has 
> been running relatively stable on channels 1.x for almost 3 years now. Our 
> tests did not show any issues when we were running django channels in our 
> test servers. And even when we tried load testing with frequent requests, 
> the errors were not unexpected i.e. there would be conenctions dropped and 
> a few 502s.  ANd as soon as the load was cut off things would work fine. 
>
> This changed drastically when we deployed it in our prod environment. Our 
> daphne process SIGKILLS every few minutes and as a result our websockets 
> connections are extremely unstable and requires frequent reconnects. Our 
> setup is such that we have an AWS ALB sitting in front of NGINX that 
> directs all non-websockets traffic to a gunicorn process (which is pretty 
> stable) and all websockets traffic to a daphne process. 
>
> We tried Uvicorn in the middle as well, howeer Uvicorn wouldn't sigkill 
> itself but it was just as unresponsive. 
>
> Our ELB logs show a steady stream of 502 errors. 
>
> We have been dealing with these issues for around 2 days now and are 
> completely lost. If you coud give some advice on where we should be looking 
> at. What could be causing SIGKILLS, that would be seriously awesome. 
>
> Regards,
> Vaisagh
>
>
> *This message contains confidential information and is intended only for 
> the individual named. If you are not the named addressee you should not 
> disseminate, distribute or copy this e-mail. Please notify the sender 
> immediately by e-mail if you have received this e-mail by mistake and 
> delete this e-mail from your system. E-mail transmission cannot be 
> guaranteed to be secure or error-free as information could be intercepted, 
> corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. 
> The sender therefore does not accept liability for any errors or omissions 
> in the contents of this message, which arise as a result of e-mail 
> transmission. "impress.ai " and "Impress" are brands of 
> Ideatory Pte. Ltd., #08-01, 80 Robinson Road, Singapore - 068898, 
> https://impress.ai .*
>

-- 
_This message contains confidential information and is intended only for 
the individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately by e-mail if you have received this e-mail by mistake and 
delete this e-mail from your system. E-mail transmission cannot be 
guaranteed to be secure or error-free as information could be intercepted, 
corrupted, lost, destroyed, arrive late or incomplete, or contain viruses. 
The sender therefore does not accept liability for any errors or omissions 
in the contents of this message, which arise as a result of e-mail 
transmission. "impress.ai " and "Impress" are brands of 
Ideatory Pte. Ltd., #08-01, 80 Robinson Road, Singapore - 068898, 
https://impress.ai ._

-- 
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/8b5653b4-c756-4e25-a3f0-fa5caeaca856%40googlegroups.com.


Re: gunicorn.errors.HaltServer:

2019-12-15 Thread Ram
I changed the files as follows but the error is the same.

> cat /etc/systemd/system/gunicorn.socket
> [Unit]
> Description=gunicorn socket
>
> [Socket]
> ListenStream=/run/gunicorn.sock
> #ListenStream=/home/xx/myproject/myapp/myapp.sock
>
> [Install]
> WantedBy=sockets.target
>
> $ cat /etc/systemd/system/gunicorn.service
> [Unit]
> Description=gunicorn daemon
> Requires=gunicorn.socket
> After=network.target
>
> [Service]
> User=xx
> Group=www-data
> WorkingDirectory=/home/xx/myproject/myapp/myapp
> WorkingDirectory=/home/xx/myproject/myapp
> ExecStart=/home/xx/myproject/xxenv/bin/gunicorn \
>   --access-logfile - \
>   --workers 3 \
>   --bind unix:/run/gunicorn.sock \
>   myapp.wsgi:application
>
> [Install]
> WantedBy=multi-user.target
> $
>
>
On Sun, Dec 15, 2019 at 3:28 PM Ram  wrote:

> Hi Integr,
>
> Thank you for the answer but I don't see '--preload' option for the same
> command. Am I missing anything?
>
>>
>> $ sudo systemctl --preload gunicorn.service
>>> systemctl: unrecognized option '--preload'
>>>
>> $ sudo systemctl status gunicorn.service --preload
>> systemctl: unrecognized option '--preload'
>> $ sudo systemctl --help | grep preload
>>
>
> ~Ram
>
>
>
> On Sun, Dec 15, 2019 at 10:32 AM Integr@te System <
> datacentral...@gmail.com> wrote:
>
>> Hi Issuer,
>>
>> Try to run command: --preload to whatsup with worker processes and app
>> and server.
>>
>> On Sun, Dec 15, 2019, 13:32 Ram  wrote:
>>
>>> Hi,
>>>
>>> I followed this document
>>> 
>>> and I’m hitting this error. Could you let me know what I’m missing? I tried
>>> several things the whole day and nothing has worked? Please let me know if
>>> you have any solution on this error?
>>>
>>> >>> $ sudo systemctl status gunicorn.socket
>>> >>> Failed to dump process list, ignoring: No such file or directory
>>> >>> ● gunicorn.socket - gunicorn socket
>>> >>>Loaded: loaded (/etc/systemd/system/gunicorn.socket; enabled;
>>> vendor preset: enabled)
>>> >>>Active: active (listening) since Sun 2019-12-15 05:15:27 UTC; 17s
>>> ago
>>> >>>Listen: /home/xx/myproject/myapp/myapp.sock (Stream)
>>> >>>CGroup: /system.slice/gunicorn.socket
>>> >>>
>>> >>> Dec 15 05:15:27 ubuntu-s-01 systemd[1]: Listening on gunicorn socket.
>>> >>>
>>> >>>
>>> >>> $ sudo systemctl status gunicorn.service
>>> >>> ● gunicorn.service - gunicorn daemon
>>> >>>Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled;
>>> vendor preset: enabled)
>>> >>>Active: failed (Result: exit-code) since Sun 2019-12-15 04:22:54
>>> UTC; 53min ago
>>> >>>  Main PID: 15788 (code=exited, status=1/FAILURE)
>>> >>>
>>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: self.stop()
>>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:   File
>>> "/home/xx/myproject/xxenv/lib/python3.6/site-packages/gunicorn/arbi
>>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: time.sleep(0.1)
>>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:   File
>>> "/home/xx/myproject/xxkenv/lib/python3.6/site-packages/gunicorn/arbi
>>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: self.reap_workers()
>>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:   File
>>> "/home/xx/myproject/xxenv/lib/python3.6/site-packages/gunicorn/arbi
>>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: raise
>>> HaltServer(reason, self.WORKER_BOOT_ERROR)
>>> >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:
>>> gunicorn.errors.HaltServer: 
>>> >>> Dec 15 04:22:54 ubuntu-s-01 systemd[1]: gunicorn.service: Main
>>> process exited, code=exited, status=1/FAILURE
>>> >>> Dec 15 04:22:54 ubuntu-s-01 systemd[1]: gunicorn.service: Failed
>>> with result 'exit-code'.
>>>
>>> --
>>> 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%2BOi5F1FL%3D3eBo7KAu%3DsmSV%2BuCUnUHk7q32TdkkeVGMznUtp7Q%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/CAP5HUWrcFKT1y_Z0tkQ2qp5Gf-RJ9TPKu33Kmudka1sAu3rymw%40mail.gmail.com
>> 
>> .
>>
>

-- 
You received this message becau

Re: gunicorn.errors.HaltServer:

2019-12-15 Thread Ram
Wanted to know whether this is a bug specific to gunicorn?

>
> pip show gunicorn
Name: gunicorn
Version: 20.0.2
Summary: WSGI HTTP Server for UNIX
Home-page: http://gunicorn.org


On Sun, Dec 15, 2019 at 9:58 PM Ram  wrote:

> I changed the files as follows but the error is the same.
>
>> cat /etc/systemd/system/gunicorn.socket
>> [Unit]
>> Description=gunicorn socket
>>
>> [Socket]
>> ListenStream=/run/gunicorn.sock
>> #ListenStream=/home/xx/myproject/myapp/myapp.sock
>>
>> [Install]
>> WantedBy=sockets.target
>>
>> $ cat /etc/systemd/system/gunicorn.service
>> [Unit]
>> Description=gunicorn daemon
>> Requires=gunicorn.socket
>> After=network.target
>>
>> [Service]
>> User=xx
>> Group=www-data
>> WorkingDirectory=/home/xx/myproject/myapp/myapp
>> WorkingDirectory=/home/xx/myproject/myapp
>> ExecStart=/home/xx/myproject/xxenv/bin/gunicorn \
>>   --access-logfile - \
>>   --workers 3 \
>>   --bind unix:/run/gunicorn.sock \
>>   myapp.wsgi:application
>>
>> [Install]
>> WantedBy=multi-user.target
>> $
>>
>>
> On Sun, Dec 15, 2019 at 3:28 PM Ram  wrote:
>
>> Hi Integr,
>>
>> Thank you for the answer but I don't see '--preload' option for the same
>> command. Am I missing anything?
>>
>>>
>>> $ sudo systemctl --preload gunicorn.service
 systemctl: unrecognized option '--preload'

>>> $ sudo systemctl status gunicorn.service --preload
>>> systemctl: unrecognized option '--preload'
>>> $ sudo systemctl --help | grep preload
>>>
>>
>> ~Ram
>>
>>
>>
>> On Sun, Dec 15, 2019 at 10:32 AM Integr@te System <
>> datacentral...@gmail.com> wrote:
>>
>>> Hi Issuer,
>>>
>>> Try to run command: --preload to whatsup with worker processes and app
>>> and server.
>>>
>>> On Sun, Dec 15, 2019, 13:32 Ram  wrote:
>>>
 Hi,

 I followed this document
 
 and I’m hitting this error. Could you let me know what I’m missing? I tried
 several things the whole day and nothing has worked? Please let me know if
 you have any solution on this error?

 >>> $ sudo systemctl status gunicorn.socket
 >>> Failed to dump process list, ignoring: No such file or directory
 >>> ● gunicorn.socket - gunicorn socket
 >>>Loaded: loaded (/etc/systemd/system/gunicorn.socket; enabled;
 vendor preset: enabled)
 >>>Active: active (listening) since Sun 2019-12-15 05:15:27 UTC;
 17s ago
 >>>Listen: /home/xx/myproject/myapp/myapp.sock (Stream)
 >>>CGroup: /system.slice/gunicorn.socket
 >>>
 >>> Dec 15 05:15:27 ubuntu-s-01 systemd[1]: Listening on gunicorn
 socket.
 >>>
 >>>
 >>> $ sudo systemctl status gunicorn.service
 >>> ● gunicorn.service - gunicorn daemon
 >>>Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled;
 vendor preset: enabled)
 >>>Active: failed (Result: exit-code) since Sun 2019-12-15 04:22:54
 UTC; 53min ago
 >>>  Main PID: 15788 (code=exited, status=1/FAILURE)
 >>>
 >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: self.stop()
 >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:   File
 "/home/xx/myproject/xxenv/lib/python3.6/site-packages/gunicorn/arbi
 >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: time.sleep(0.1)
 >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:   File
 "/home/xx/myproject/xxkenv/lib/python3.6/site-packages/gunicorn/arbi
 >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: self.reap_workers()
 >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:   File
 "/home/xx/myproject/xxenv/lib/python3.6/site-packages/gunicorn/arbi
 >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]: raise
 HaltServer(reason, self.WORKER_BOOT_ERROR)
 >>> Dec 15 04:22:54 ubuntu-s-01 gunicorn[15788]:
 gunicorn.errors.HaltServer: 
 >>> Dec 15 04:22:54 ubuntu-s-01 systemd[1]: gunicorn.service: Main
 process exited, code=exited, status=1/FAILURE
 >>> Dec 15 04:22:54 ubuntu-s-01 systemd[1]: gunicorn.service: Failed
 with result 'exit-code'.

 --
 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%2BOi5F1FL%3D3eBo7KAu%3DsmSV%2BuCUnUHk7q32TdkkeVGMznUtp7Q%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.
>>> T

Re: I am creating a project management app Each user has multiple projects and each project has a set of data When first logged in the user sees a list of all the projects only he created.i am able to

2019-12-15 Thread Raviteja Reddy
I am creating a project management app Each user has multiple projects and 
each project has a set of data When first logged in the user sees a list of 
all the projects only he created.i am able to do this. Then when clicked on 
the project the data related only to that project is to be shown. How do i 
do that in django? My projects model

On Monday, December 16, 2019 at 1:32:45 AM UTC+5:30, Raviteja Reddy wrote:
>
> class projectsmodel(models.Model):
> added_by = 
> models.ForeignKey(settings.AUTH_USER_MODEL,null=True,blank=True,on_delete=models.SET_NULL)
> projects=models.CharField(max_length=300)
>
> def save_model(self,request,obj,form,change):
> obj.added_by=request.User
> super().save_model(request,obj,form,change)
> def __str__(self):
> return self.projects
>
> My BOQ Model,it is the model that needs to be filtered based on project it 
> is redirected from
>
> class boqmodel(models.Model):
> project_name = models.ForeignKey(projectsmodel, null=True, blank=True, 
> on_delete=models.SET_NULL)
> code = models.IntegerField()
> building = models.ForeignKey(building, on_delete=models.SET_NULL, 
> null=True)
> level = models.ForeignKey(level, on_delete=models.SET_NULL, null=True)
> activity = models.ForeignKey(activity, on_delete=models.SET_NULL, 
> null=True)
> subactivity = models.ForeignKey(sub_activity, on_delete=models.SET_NULL, 
> null=True)
> duration = models.IntegerField()
> linkactivity = models.CharField(max_length=300, null=True, blank=True)
> linktype = models.CharField(choices=choicestype, max_length=300, 
> null=True, blank=True)
> linkduration = models.IntegerField(default=0)
> plannedstart = models.DateField(null=True, blank=True)
> plannedfinish = models.DateField(null=True, blank=True)
> actualstart = models.DateField(null=True, blank=True)
> actualfinish = models.DateField(null=True, blank=True)
>
>

-- 
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/696df99c-0795-44d5-b5d6-c7562e58c11c%40googlegroups.com.


Re: Python problem... Chetan is really Genius

2019-12-15 Thread Balaji Shetty
Yes...

Definitely  I am also Ghetan Fan.

He has tremendous knowledge and Practical Experience of Django.

Cheers for Chetan

On Sunday, December 15, 2019, Gil Obradors  wrote:

> Chetan, you're a genius!
>
> Missatge de Chetan Ganji  del dia dg., 15 de des.
> 2019 a les 16:28:
>
>> # input: h123456ello
>> # output: o123456lleh
>>
>> # input: th34isisast56ring3
>> # output: gn34irtsasi56siht3
>>
>>
>> order = {}
>> characters = ""
>> input_string = "h123456ello"
>> # input_string = "th34isisast56ring3"
>> counter = 0
>> output_string = ""
>>
>>
>> for index, character in enumerate(input_string):
>> order[index] = character
>>
>> for item in range(0, len(input_string)):
>> if input_string[item].isalpha():
>> characters += input_string[item]
>>
>> # reversing the string
>> characters = characters[::-1]
>>
>> for index, item in enumerate(range(0, len(input_string))) :
>> if input_string[item].isalpha():
>> order[index] = characters[counter]
>> counter += 1
>>
>> for index in range(0, len(input_string)):
>> output_string += order[index]
>>
>> print()
>> print(input_string)
>> print(output_string)
>> print()
>>
>>
>>
>>
>> Regards,
>> Chetan Ganji
>> +91-900-483-4183
>> ganji.che...@gmail.com
>> http://ryucoder.in
>>
>>
>> On Sun, Dec 15, 2019 at 8:14 PM Soumen Khatua 
>> wrote:
>>
>>> Hi Folks,
>>> I'm stucking in this problem from 5 hours but still I'm not bale to
>>> logic to solve this problem, Please help me guys to solve this problem:
>>>
>>> Example:-
>>> input: h123456ello
>>> output: o123456lleh
>>>
>>> input: th34isisast56ring3
>>> output: gn34irtsasi56siht3
>>>
>>> Thank you in advance.
>>>
>>> regards,
>>> Soumen
>>>
>>> --
>>> 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/CAPUw6Wa8LqGGnqbsiKvYrBw6WQkBa
>>> qjm9b8Re65PM3zJr1rdkA%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/CAMKMUjsLe0zo9_B70dNNq%2Bk_
>> xwOTGt-cs%2BGeqagM-wZk8yYzLA%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/CAK-JoTStv3AUaAt7gOJjUhXtmqxXgaDqE
> 3eC_fj5ak48Gb73Cg%40mail.gmail.com
> 
> .
>


-- 
Mr Shetty Balaji
Asst. Prof.
IT Department
SGGS I&T
Nanded. My. India

-- 
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/CAECSbOv1xV2fzz-XG9v5OTy6R0WUWmeDLX_9FLUMnEhBFnb6ow%40mail.gmail.com.


Re: I am creating a project management app Each user has multiple projects and each project has a set of data When first logged in the user sees a list of all the projects only he created.i am able to

2019-12-15 Thread Dominick Del Ponte
I think you're looking for a detailView

.

You'll likely need to pass  in your URL config to the
view in order to filter the boqmodel by the foreignKey.

Here's a video explaining detailViews.


Dominick
delponte.d...@gmail.com



On Mon, Dec 16, 2019 at 4:07 PM Raviteja Reddy 
wrote:

> I am creating a project management app Each user has multiple projects and
> each project has a set of data When first logged in the user sees a list of
> all the projects only he created.i am able to do this. Then when clicked on
> the project the data related only to that project is to be shown. How do i
> do that in django? My projects model
>
> On Monday, December 16, 2019 at 1:32:45 AM UTC+5:30, Raviteja Reddy wrote:
>>
>> class projectsmodel(models.Model):
>> added_by = 
>> models.ForeignKey(settings.AUTH_USER_MODEL,null=True,blank=True,on_delete=models.SET_NULL)
>> projects=models.CharField(max_length=300)
>>
>> def save_model(self,request,obj,form,change):
>> obj.added_by=request.User
>> super().save_model(request,obj,form,change)
>> def __str__(self):
>> return self.projects
>>
>> My BOQ Model,it is the model that needs to be filtered based on project
>> it is redirected from
>>
>> class boqmodel(models.Model):
>> project_name = models.ForeignKey(projectsmodel, null=True, blank=True, 
>> on_delete=models.SET_NULL)
>> code = models.IntegerField()
>> building = models.ForeignKey(building, on_delete=models.SET_NULL, 
>> null=True)
>> level = models.ForeignKey(level, on_delete=models.SET_NULL, null=True)
>> activity = models.ForeignKey(activity, on_delete=models.SET_NULL, 
>> null=True)
>> subactivity = models.ForeignKey(sub_activity, on_delete=models.SET_NULL, 
>> null=True)
>> duration = models.IntegerField()
>> linkactivity = models.CharField(max_length=300, null=True, blank=True)
>> linktype = models.CharField(choices=choicestype, max_length=300, 
>> null=True, blank=True)
>> linkduration = models.IntegerField(default=0)
>> plannedstart = models.DateField(null=True, blank=True)
>> plannedfinish = models.DateField(null=True, blank=True)
>> actualstart = models.DateField(null=True, blank=True)
>> actualfinish = models.DateField(null=True, blank=True)
>>
>> --
> 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/696df99c-0795-44d5-b5d6-c7562e58c11c%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/CALLhV5T78NLfx8uTn9MJHf3jvTH7A%3Du%2BP4c-uTvOsf8nhSR1Cg%40mail.gmail.com.


Re: Python problem... Chetan is really Genius

2019-12-15 Thread sagar ninave
i am too @Balaji Shetty  . actually yesterday
evening he helped me to solved some problem on linked in where i was stuck.

-- 
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/CAA6pdZ9KLWmnw%2BCG%2BTt%3DxvxprzonEf_iKv6UFdHVx4Y5KBeP0w%40mail.gmail.com.