Re: Question about dot notation syntax (Django source)

2018-02-15 Thread Juan Pablo Romero Bernal
Hi, You must read: https://docs.python.org/3/tutorial/modules.html and https://docs.python.org/3/tutorial/datastructures.html#dictionaries Cheers, On Thu, Feb 15, 2018 at 8:06 PM, drone4four wrote: > In, “Password management in Django >

Question about dot notation syntax (Django source)

2018-02-15 Thread drone4four
In, “Password management in Django ”, it explains that this particular doc is for advanced users, like Django admins who need to choose different hashing algorithms. So it’s not really necessary for a

modelform selection options

2018-02-15 Thread sum abiut
I have a model.py class selection(models.Model): select=( (A','A'), ('B','B'), ('C','C'), ) options=models.CharField(max_length=7,choices=select) and form.py class order(forms.ModelForm): class Meta: model=selection fields=('Pay_options,) I want to

Chat with DjangoChannels and DRF

2018-02-15 Thread Darwin Vasquez
I'm trying to make a chat on real time for the web. I was playing with Django-Channels, and it seems to me that works fine. But now, I'm not sure. I need to make the chat over an api on REST. For that, I will using DRF, and to render the data I would make the website on another instance.

Create objects using a start date, an end date and time list

2018-02-15 Thread Kakar Nyori
I have an Event model, and each event will have different shows. class Event(models.Model): title = models.CharField(max_length=200) class Show(models.Model): event = models.ForeignKey(Event, on_delete=models.CASCADE) date_time = models.DateTimeField(unique=True)

Re: How to do "choices" from DB in form field without breaking migrations and such

2018-02-15 Thread C Kirby
Yeah, I meant to write about that. If you put a database filter in a field definition (model or form) it only runs it on start/restart. Using the method I put, or a callback function in the choices, allows the choices to reflect reality of the data. On Thu, Feb 15, 2018 at 12:24 PM,

Re: How to do "choices" from DB in form field without breaking migrations and such

2018-02-15 Thread jasonbnance
Thank you very much. This worked perfectly. Consequently it also fixed my issue of those select boxes not reflecting changes in the list until the web server was restarted since the data is now being pulled at instantiation instead of in the class definition. j On Thursday, February 15,

Re: How to do "choices" from DB in form field without breaking migrations and such

2018-02-15 Thread C. Kirby
You can set the choices in the form __init__ to handle the issue: class FooJBossForm(Form): biz_service = MultipleChoiceField( choices=[], required=False, label='Business Service', widget=SelectMultiple(attrs={'class': 'form-control'}), ) def

Re: How to do "choices" from DB in form field without breaking migrations and such

2018-02-15 Thread jasonbnance
I should have included that the reason I'm using a `MultipleChoiceField` instead of a `ModelMultipleChoiceField` here is because I want the POSTed variable to be the business service name (string) not the primary key of the selected record. j On Thursday, February 15, 2018 at 8:56:56 AM

How to do "choices" from DB in form field without breaking migrations and such

2018-02-15 Thread jasonbnance
Hello everyone, I have a form field that is pulling choices from the database: class FooJBossForm(Form): biz_service = MultipleChoiceField( choices=BizService.objects.filter( biz_unit__bu_name='Foo', ).order_by('bs_name').values_list('bs_name',

Re: chemistry character set

2018-02-15 Thread Mike Dewhirst
On 15/02/2018 10:19 PM, Hanne Moa wrote: On 2018-02-06 12:51, Mike Dewhirst wrote: Thank you. I think this is where we probably need to go. I asked the original question because I'm hoping the project will reach a tipping point and start to accumulate a growing number of multilingual users.

Laying out a form like "fieldsets" and "TabularInline" on a non-"admin" page

2018-02-15 Thread Carl Brubaker
I've been trying to make a form that will get customer information: First Name Last NameMI (etc) and have been running into issues I can't seem to resolve without doing it the hard way. I was just wondering if there was an easier method? Using generic views and edit views, the

Re: chemistry character set

2018-02-15 Thread Hanne Moa
On 2018-02-06 12:51, Mike Dewhirst wrote: > Thank you. I think this is where we probably need to go. I asked the > original question because I'm hoping the project will reach a tipping > point and start to accumulate a growing number of multilingual users. We > have our first multinational user

Re: Noob question: Is the User model compatible with subscription-style website?

2018-02-15 Thread Etienne Robillard
Le 2018-02-15 à 01:17, Tom Tanner a écrit : I'm working on a Django-powered subscription website with a Django-powered CMS backend. Can the User model, or a derived class, be made to be compatible with this idea? In my case, I want to store a user's username, password, and subscription ID.