Re: JSONField() ordering and removing latest

2020-02-04 Thread Andrew C.
Usually, something that has multiple versions could be in an autoincrement field as the primary key. Then, in a JSONB field with GIN index (since you’re using PostgreSQL), you would have a dict of each version, like this: { “1”: { # beginning of article 1 “versions”: { “1”: { “title”: “Blah1”,

Re: Django - Extending models with multi role users and multiple requirement types

2020-02-04 Thread Mike Dewhirst
On 5/02/2020 10:14 am, Zameer Ahmed wrote: Thanks Mike for taking time off to read long question and response is much appreciated. In all the discussion you just told me what not to do for laying down my model structure. Now I have idea somewhat not to do. Can you kindly laydown minimal

Re: contrib.sites Admin problem

2020-02-04 Thread Mike Dewhirst
On 4/02/2020 7:00 pm, Mike Dewhirst wrote: Tomorrow I'm going to examine contenttype permissions. Maybe that's where to hide things. Yes indeed. Foot in mouth again. Removing view permissions to site models drops it from the Admin. Thank you Ori and  Maninder for taking time - sorry to

Re: JSONField() ordering and removing latest

2020-02-04 Thread Jody Fitzpatrick
I would change the model a bit, instead of having the timestamp as the key, i would set it in the dict. I believe that would be cleaner and would allow you to do a bit more of what you are going for. On Thursday, January 30, 2020 at 10:38:33 AM UTC-5, wagner wrote: > > Hello together, > i have

Re: [django-channels] I want to use aioredis connection pool ,not create new connection in every AsyncWebsocketConsumer.connect .Where can I put the code.

2020-02-04 Thread Nathan Jones
Hi, Did you ever work out how to do this? The only way I could work out how to use a shared pool was to go back to the regular sync `redis` library and use sync_to_async, for example `settings.py` REDIS_PRO_POOL = redis.ConnectionPool(host='localhost', port=6379, db=3) `consumer.py` class

Re: Django - Extending models with multi role users and multiple requirement types

2020-02-04 Thread Zameer Ahmed
Thanks Mike for taking time off to read long question and response is much appreciated. In all the discussion you just told me what not to do for laying down my model structure. Now I have idea somewhat not to do. Can you kindly laydown minimal structure where I can achieve multiple user roles? I

Re: Lots of errors after deploying and going live

2020-02-04 Thread Mike Dewhirst
Dave You are absolutely right. Django does go smoothly on the local machine. However, if you relocate that exact smoothness to a different environment there will definitely be some jagged edges to contend with. I'm sure you remember tweaking things to achieve local smoothity. You will have

recurring slot booking/reservations

2020-02-04 Thread Siddhartha Satyakama
I'm looking for a code to see models,forms,views for creating recurring slot booking app without any external module everything from scratch. Please help how should I start?? Suppose if i want to block calender dates if booked how should I do it? P.S. I'm new to Django so please help! -- You

Re: Python Django Training

2020-02-04 Thread ARYAN JADHAV
Please add me in the group Whatsapp-+91 9403605636 On Saturday, February 1, 2020 at 7:12:52 PM UTC+5:30, Srikanth K wrote: > > Hi, > > I am from Hyderabad. I am Python Developer by Profession. I am eager take > up any Python , Django Training (online Preferrable or Weekends). Members > who

Re: json null value in a PostgreSQL jsonb column

2020-02-04 Thread Макс Вернер
I created a ticket about the similliar problem, but after answer I don't sure that it's bug. Nevertheless, I think It looks contradictory, because you use python None in case of creating, but {{{ __isnull=True }}} in case of filtering. In case,

Re: CURL Command

2020-02-04 Thread 'Rak , Václav' via Django users
so check reuest header *Content-Type: application/json * this should be in request, check request headers in postman ;) Vena On Tue, 4 Feb 2020 at 12:15, Soumen Khatua wrote: > curl -i -X POST -H "Authorization: Basic Nzc5NzcyNzU0MDpzb3VtZW4xMjM=" > http://127.0.0.1:8000/job_post/ --data

The process that didn't die.

2020-02-04 Thread Ørjan Tønder
I have a problem I can't wrap my head around when I ssh into remote server: muad@podde:~$ ssh hub [venv] muad@hub:~ % cd tonder [venv] muad@hub:~/tonder % python manage.py start_bot [bot starts fine and the process stays attached] muad@podde:~$ xkill

Re: Python Django Training

2020-02-04 Thread Srikanth K
Hi all, Thank you for your interest shown. I will send the course content tommorow for python. Candidates who are interested can contact me at srikanth1...@yahoo.com. I will let you you know more detail s about the course and pricing. P.S. please contact me individually. Regards, Srikanth On Mon,

Re: CURL Command

2020-02-04 Thread Soumen Khatua
Okay,sorry I thought Wireshark some code snippet. Now i got it. Thank you On Tue, Feb 4, 2020 at 5:46 PM Kasper Laudrup wrote: > Hi Soumen, > > On 04/02/2020 13.02, Soumen Khatua wrote: > > Yeah I did whatever you said but still I'm facing the same issue, But > > same code is working in Httpie

Re: CURL Command

2020-02-04 Thread Kasper Laudrup
Hi Soumen, On 04/02/2020 13.02, Soumen Khatua wrote: Yeah I did whatever you said but still I'm facing the same issue, But same code is working in Httpie and POSTMAN.That's why I'm surprised. No you didn't. Try to compare the POST data being sent using the different clients, then it

Re: CURL Command

2020-02-04 Thread Soumen Khatua
Yeah I did whatever you said but still I'm facing the same issue, But same code is working in Httpie and POSTMAN.That's why I'm surprised. On Tue, Feb 4, 2020 at 5:29 PM Kasper Laudrup wrote: > Hi Soumen, > > Did you read the rest of my answer past the first two lines? > > On 04/02/2020 12.50,

Re: CURL Command

2020-02-04 Thread Kasper Laudrup
Hi Soumen, Did you read the rest of my answer past the first two lines? On 04/02/2020 12.50, Soumen Khatua wrote: My views.py file *def post(self, request,*args, **kwargs):         """         Create a Job record         :param format: Format of the Job records to return to         :param

Re: CURL Command

2020-02-04 Thread Soumen Khatua
My views.py file *def post(self, request,*args, **kwargs):"""Create a Job record:param format: Format of the Job records to return to :param request: Request object for creating Job records:return: Returns a Job record"""

Re: CURL Command

2020-02-04 Thread Kasper Laudrup
Hi Soumen, On 04/02/2020 12.14, Soumen Khatua wrote: curl -i -X POST -H "Authorization: Basic Nzc5NzcyNzU0MDpzb3VtZW4xMjM=" http://127.0.0.1:8000/job_post/ --data '{"job_description":"Python Developers"}' Here I'm passing the data of job_description but still I'm getting an error like: * *

Re: CURL Command

2020-02-04 Thread Soumen Khatua
curl -i -X POST -H "Authorization: Basic Nzc5NzcyNzU0MDpzb3VtZW4xMjM=" http://127.0.0.1:8000/job_post/ --data '{"job_description":"Python Developers"}' Here I'm passing the data of job_description but still I'm getting an error like: *HTTP/1.1 400 Bad RequestDate: Tue, 04 Feb 2020

Re: CURL Command

2020-02-04 Thread Kasper Laudrup
Hi Soumen, On 04/02/2020 09.01, Soumen Khatua wrote: Hi Folks, Actually now I'm usng POSTMAN for all operation like GET,POST,PUT,PATCH and DELETE. But I want to do the same thing by using Curl Command, Could anyone tell me what are the commands for CURL.I'm providing my end point below and

Lots of errors after deploying and going live

2020-02-04 Thread Dave Ko
Hi guys, so this is a very general post, I have been working on a django blog following Corey Schafer's Django tutorial. Everything went smoothly on local machine, but once I deployed it, I am having all kinds of troubles. >From password_reset (still not solved) to uploading image ran into

Re: contrib.sites Admin problem

2020-02-04 Thread אורי
How are your models defined in sites? אורי u...@speedy.net On Tue, Feb 4, 2020 at 9:24 AM Mike Dewhirst wrote: > On 4/02/2020 5:47 pm, אורי wrote: > > Did you try `django_admin.site.unregister(Site)` before you register > > Site with your own admin? > > Yes. > > I have tried lots of things but

CURL Command

2020-02-04 Thread Soumen Khatua
Hi Folks, Actually now I'm usng POSTMAN for all operation like GET,POST,PUT,PATCH and DELETE. But I want to do the same thing by using Curl Command, Could anyone tell me what are the commands for CURL.I'm providing my end point below and most important I'm using Basic Authentication. 1)

Re: contrib.sites Admin problem

2020-02-04 Thread Mike Dewhirst
Tomorrow I'm going to examine contenttype permissions. Maybe that's where to hide things. Back in the am Cheers Mike On 4/02/2020 6:23 pm, Mike Dewhirst wrote: On 4/02/2020 5:47 pm, אורי wrote: Did you try `django_admin.site.unregister(Site)` before you register Site with your own admin?