Re: Input Widget with multiple input_type attr

2017-10-20 Thread mohammad k
forms.CharField(widget=forms.HiddenField) On Oct 21, 2017 12:45 AM, "gugsrs" wrote: Hello, I am having some problems with django 1.11 widgets, I was using django-widget-tweaks to help rendering form fields, but now when I set a type="hidden" attribute to an Input Field, django creates the widge

Input Widget with multiple input_type attr

2017-10-20 Thread gugsrs
Hello, I am having some problems with django 1.11 widgets, I was using django-widget-tweaks to help rendering form fields, but now when I set a type="hidden" attribute to an Input Field, django creates the widget with both type="text" and type="hidden" attributes. That happens because when the w

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

2017-10-20 Thread Matthew Pava
In my project, I have a contacts model. I have separate models, such as Person, Institution, Supplier, or Shipper that all have a foreign key to contacts. So it looks like you’re doing it the way that I would do it. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Be

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

2017-10-20 Thread Jani Tiainen
I would be a bit cautious with generic foreignkeys since they don’t provide database integrity checks. IOW, you can break your data very easily. > On 20 Oct 2017, at 19.55, Ruben Alves wrote: > > You can use Generic Key: > https://docs.djangoproject.com/en/1.11/ref/contrib/contenttypes/ >

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

2017-10-20 Thread Ruben Alves
You can use Generic Key: https://docs.djangoproject.com/en/1.11/ref/contrib/contenttypes/ Em sexta-feira, 20 de outubro de 2017 07:59:35 UTC-2, Antonis Christofides escreveu: > > Hello, > > Two real examples that I've faced: > > class MeteorologicalStation(models.Model): > ...

Re: Start Gunicorn on boot

2017-10-20 Thread Ricardo Daniel Quiroga
Use supervisor to start gunicorn on init see this guide http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/ gunicorn_start.bash #!/bin/bash NAME="hello_app" # Name of the application DJANGODIR=/webapps/hello_django/hello # Django project directory SOCKFILE=/we

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

2017-10-20 Thread Jani Tiainen
Hi. I've resolved such a case with two nullable fkeys and a discriminator field to tell which one fkey is used. 20.10.2017 12.59 "Antonis Christofides" kirjoitti: Hello, Two real examples that I've faced: class MeteorologicalStation(models.Model): ... owner = models.Foreig

dynamic choices based on another field input.

2017-10-20 Thread rajeev yadla
hi have a form which have two fields. one field has a foreignkey from model A(in image) base field. and another field is a drop down box where the choices should be dynamic based on first field selection. the choices should all the values of field Os from second model B associated with the Ba

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

2017-10-20 Thread Antonis Christofides
Hello, Two real examples that I've faced: class MeteorologicalStation(models.Model):     ... owner = models.ForeignKey(to a person or organization) class Document(models.Model):      ... authors = models.ManyToManyKey(to persons or organizations) What I do is I c

Re: Start Gunicorn on boot

2017-10-20 Thread Nonverbis M
Antonis, thank you. Yes, this is upstart. I'll try it with systemd as you suggested. > > -- 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..

Re: Start Gunicorn on boot

2017-10-20 Thread Antonis Christofides
Hello, Is this upstart? I thought that Ubuntu doesn't use upstart any more, but that it uses systemd instead (since version 15.04 IIRC). Maybe it contains upstart for backwards compatibility, but I think it's not a good idea to invest in learning upstart right now. If you want to do it with syste

Start Gunicorn on boot

2017-10-20 Thread Nonverbis M
*Ubuntu 16.04.3 Desktop version.* *gunicorn (version 19.7.1)* *virtualenv 15.1.0* I'd like Gunicorn to start on boot. Gunicorn is integrated with *Django*. */etc/init/photoarchive.conf* description "Gunicorn server for photoarchive" start on runlevel [2345] stop on runlevel [!2345] resp

Re: HELP WITH THIS CODE!!

2017-10-20 Thread Jani Tiainen
Hi. As pointed out, your code isn't Django related. If you feel that official Django tutorial isn't explaining things in-depth Django girls do have excellent tutorial. https://tutorial.djangogirls.org/en/ 20.10.2017 0.00 "Giovanny ordoñez" kirjoitti: > >