Re: Django 1.11 and PostgreSQL 10 compatibility

2017-10-21 Thread Edandweb
Thanks On Thursday, 19 October 2017 12:27:50 UTC+3, Edandweb wrote: > > Hi, > > I am developing a new application in Python and Django, for the database > we want to use the last version of PostgreSQL v10. > The django Documentation says in > https://docs.djangoproject.com/en/1.11/ref/databases/

Django 1.11 - Best Datepicker to use?

2017-10-21 Thread Jack Zhang
I'm looking for a datepicker widget to use for a DateTime form field. I searched around and most of the answers were old Stack Overflow posts from 2011 about hacking the calendar datepicker widget from Django's Admin. The information about that was inconclusive and I couldn't get mine to work.

I may found a bug

2017-10-21 Thread otloal
Hi, I think I may discovered a bug in django, but I’m not sure [03:19am] The bug is this: 1. You make a ManyToManyField related the same model in wich you are creating the field [03:20am] Example: [03:21am] > > class WhatEver(models.Model): > > field = models.ManyToManyField(‘Whatever’, related_

Re: Django Forms

2017-10-21 Thread test
class PollForm(forms.Form): answer = forms.ChoiceField( widget=forms.RadioSelect, choices=cool_choices) def __init__(self, poll, *args, **kwargs): super(PollForm, self).__init__(*args, **kwargs) b = poll.choice_set.all() list_choice = [] fo

Re: Django Forms

2017-10-21 Thread James Schneider
Since each form is set to only allow you to select 1 multiple choice option, if I add many forms in one page, I can only select one option overall. So if I answer question 1, I can't answer any of the other questions without it unselecting question 1's answer. Does anyone know how to fix this? I

Django Forms

2017-10-21 Thread test
Hi, I have a form that contains a question and a multiple choice answer field. For example: What is your favorite color? - Blue - Green - Red - Yellow I render the page with a list of forms (or I guess formset?) and loop through them. So something like this. for form in formset:

Re: JSON editor for admin

2017-10-21 Thread Giorgi Jambazishvili
Hi there, I needed same thing, so ended up with this one: https://github.com/nnseva/django-jsoneditor hope it helps On Wednesday, October 11, 2017 at 6:49:48 PM UTC+4, Dave Ekhaus wrote: > > Hi All > > Can anyone recommend a working JSON editor that can be added to a > Django 1.11.x admin ?

Re: How to store a key to a something that can be either a person or an organization?

2017-10-21 Thread Antonis Christofides
Hello James, You are right that the correct term in everyday language for the superclass of organization and person is "entity". However, I didn't want to name it "entity" in the code, because, really, "entity" is a different thing in programming, it's a term like "object". It would be very confus

Re: How to store a key to a something that can be either a person or an organization?

2017-10-21 Thread James Schneider
What I do is I create a superclass that I call Lentity (short for "legal entity", despite the fact that it could refer to a group of people and is not necessary legal) and the two subclasses Person and Organization, with multi-table inheritance. Seems silly to name a model as such given that it c

Re: How to store a key to a something that can be either a person or an organization?

2017-10-21 Thread James Schneider
On Oct 20, 2017 4:15 AM, "Jani Tiainen" wrote: Hi. I've resolved such a case with two nullable fkeys and a discriminator field to tell which one fkey is used. Another option that is slightly safer is to override the save() method to set the opposing FK to None every time the model is saved. Yo