multiple databases - two questions

2016-11-03 Thread Mike Dewhirst
(this one might be easier to read) I am planning some utility helper code to push selected records and their children from our staging database into the production database. The current database would be 'default' and I could add a second one called 'production' then read from 'default' and wr

multiple databases - two questions

2016-11-03 Thread Mike Dewhirst
I am planning some utility helper code to push selected records and their children from our staging database into the production database. The current database would be 'default' and I could add a second one called 'production' then read from 'default' and write to 'production'. (I need to chec

RE: ListField, JSONField and DictField

2016-11-03 Thread Matthew Pava
I do see them available as Postgres fields because Postgres supports them natively. I assume that they aren’t by default in model Fields because other databases may not support them natively. https://docs.djangoproject.com/en/1.10/ref/contrib/postgres/fields/ From: django-users@googlegroups.c

ListField, JSONField and DictField

2016-11-03 Thread Lekan Wahab
Hi guys, This question just came to me this evening and I've really been thinking about it. Can someone explain to me why Django doesn't have ListField, JSONField or DictField by default in its model Fields? I mean, these are obviously things that would ease a lot of work so why aren't they avai

Admin site - prepopulating field based on foreign key

2016-11-03 Thread dodrian
I'm having trouble with my admin site, would appreciate any pointers. I have these three models in my database with relationships as shown: class Customer(models.Model): name=models.CharField(max_length=30) class Location(models.Model): name=models.CharField(max_length=30) customer = model

RE: How to fetch data from LDAP to html textbox

2016-11-03 Thread Matthew Pava
We use a package called django-auth-ldap. https://pythonhosted.org/django-auth-ldap/ It saves some of the LDAP data into the User model everytime the user logs in. We also have our own Employee model that has a foreign key to the User model, and if the user logs in without an employee record th

Re: django 1.10 error (SSL error: called a function you should not call)

2016-11-03 Thread Melvyn Sopacua
On Thursday 03 November 2016 12:11:29 Luc Jean wrote: > (SSL error: called a function you should not call) > It seems to occur while querying the database. > > # django/db/backends/utils.py line 64 > return self.cursor.execute(sql, params) This would only make sense if you use SSL to connect to

Re: How to GROUP BY in django?

2016-11-03 Thread Melvyn Sopacua
On Thursday 03 November 2016 03:15:31 Awadhesh Meshram wrote: > How to GROUP BY using any identical field in database in Django? https://www.google.com/search?q=django+group+by Grouping is called "aggregation" in DBA lingo. -- Melvyn Sopacua -- You received this message because you are subscri

Re: Do you modify third party code used in your projects?

2016-11-03 Thread Melvyn Sopacua
On Thursday 03 November 2016 02:11:16 Peter Dermott wrote: > I'm using the Mezzanine / Cartridge combo to set up an online store > for the company I'm working with, so far I've been extending the base > cartridge models and overriding templates to do what I need (adding > extra fields, different t

Re: How to GROUP BY in django?

2016-11-03 Thread Vinicius Assef
Maybe this can help you: https://docs.djangoproject.com/en/1.10/topics/db/aggregation/ On 3 November 2016 at 08:15, Awadhesh Meshram wrote: > How to GROUP BY using any identical field in database in Django? > > -- > You received this message because you are subscribed to the Google Groups > "Dja

django 1.10 error (SSL error: called a function you should not call)

2016-11-03 Thread Luc Jean
Hello, I have a Python 3.5/Django 1.10 app served by Apache/mod_wsgi over SSL. It is connected to a Postgres 9.5.2 database (with psycopg2==2.6.2) and is running on a server at AlwaysData It works fine most of time but I have sometimes an error that I don't understand. (SSL error: called a f

Re: How to GROUP BY in django?

2016-11-03 Thread GMail
Hi, if you're planning to group your data after it was retrieved from database, you could use itertools.groupby(): https://docs.python.org/3/library/itertools.html#itertools.groupby If grouping has to take place during databas

How to GROUP BY in django?

2016-11-03 Thread Awadhesh Meshram
How to GROUP BY using any identical field in database in Django? -- 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 po

Re: Do you modify third party code used in your projects?

2016-11-03 Thread Antonis Christofides
Hello, In such cases, I try to contribute my fixes to the third-party project. If this is not possible (or until it is done), rather than copy the third party code in my project and go through the hassle of having to maintain it, I prefer monkey-patching, especially if there are only a few fixes.

Do you modify third party code used in your projects?

2016-11-03 Thread Peter Dermott
I'm currently working on my first Django app after years of working with WordPress and right now I'm feeling a little lost so please be gentle. I'm using the Mezzanine / Cartridge combo to set up an online store for the company I'm working with, so far I've been extending the base cartridge

Re: Minify HTML in Django

2016-11-03 Thread Web Architect
Will go through Django Compressor. Thanks. On Tuesday, November 1, 2016 at 3:22:56 PM UTC+5:30, somecallitblues wrote: > > Take a look at Django Compressor. > > On Tuesday, 1 November 2016, Web Architect > wrote: > >> Hi, >> >> Is there an optimal and efficient way to minify HTML in Django? >>

Re: Minify HTML in Django

2016-11-03 Thread Web Architect
Will go through Django Compressor. On Tuesday, November 1, 2016 at 3:22:56 PM UTC+5:30, somecallitblues wrote: > > Take a look at Django Compressor. > > On Tuesday, 1 November 2016, Web Architect > wrote: > >> Hi, >> >> Is there an optimal and efficient way to minify HTML in Django? >> >> I tri