Re: Migrations for forms fields

2016-08-16 Thread Gergely Polonkai
Hello, rename migrations in your head to database migrations, or even model to database migrations. The migration process takes all your models and applies all the changes in them to your database (usually an SQL instance in the wild). Forms, on the other hand, are just that: forms, that can get

Form Mixins with multilayered M2M models

2016-08-16 Thread Ali khan
Hi, I have three models like below: Shop: | Products | Variations Where Shop has a ForeignKey for products and then products has foreign key for variations. So Shop has no ForeignKey with Variations directly instead connected via

How to use django.contrib.postgres.forms widgets in the admin site

2016-08-16 Thread Jay Sheldon
Hi there, I just recently updated my database to postgres, looking to play with the django supported field types HStoreField and JSONField (reference: https://docs.djangoproject.com/en/1.8/ref/contrib/postgres/fields/ ) I got the install working fine, but in my admin section - the widgets that

Re: How to use django.contrib.postgres.forms widgets in the admin site

2016-08-16 Thread Elizabeth Mawer
Hi I accidentally got signed up with this group and actually don't want to receive emails. How do I unsubscribe? At the bottom of this email it says: To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com

Re: How to use django.contrib.postgres.forms widgets in the admin site

2016-08-16 Thread François Schiettecatte
Go to the group web page at : https://groups.google.com/group/django-users Click on the My Settings icon (human figure and gear icon, top right) and click ‘Leave this group’ François > On Aug 16, 2016, at 6:28 AM, Elizabeth Mawer > wrote: > > Hi > > I accidentally got signed up wi

Re: Web based IDE for django

2016-08-16 Thread Daniel França
hmm, not sure if I got what you want...but have you tried cloud9? https://c9.io/ On Tue, 16 Aug 2016 at 07:30 Jani Tiainen wrote: > Hi, > > Just for curiosity, can you point out any web based editor does what > you're asking for, even not Python based? > > To me it sounds that you want to have s

nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread 술욱
Hello I'm running (in production) and app that uses raw queries, something like: query = """ select table1.field1, table2.field3 from table1 left join table2 on test1.field1 = test2.field1 and test1.field2 = test2.field2 where table1.field1 = %(param1)s """ cursor = connections['database']

Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread M Hashmi
Reload Nginx and see if still its loading cached query. On Tue, Aug 16, 2016 at 8:18 AM, 술욱 wrote: > Hello > > I'm running (in production) and app that uses raw queries, something like: > > query = """ > select table1.field1, table2.field3 > from table1 left join table2 >on test1.field1 = te

Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread 술욱
I forgot to say I reloaded (and restarted) nginx and uwsgi, but the query is still cached Thanks anyway! 2016-08-16 12:24 GMT-03:00 M Hashmi : > Reload Nginx and see if still its loading cached query. > > On Tue, Aug 16, 2016 at 8:18 AM, 술욱 wrote: > >> Hello >> >> I'm running (in production

Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread Avraham Serour
How do you know the query is cached? On Aug 16, 2016 6:33 PM, "술욱" wrote: > I forgot to say I reloaded (and restarted) nginx and uwsgi, but the query > is still cached > > > Thanks anyway! > > > > > 2016-08-16 12:24 GMT-03:00 M Hashmi : > >> Reload Nginx and see if still its loading cached query

Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread Bill Freeman
Cached in browser, maybe? On Tue, Aug 16, 2016 at 11:43 AM, Avraham Serour wrote: > How do you know the query is cached? > > On Aug 16, 2016 6:33 PM, "술욱" wrote: > >> I forgot to say I reloaded (and restarted) nginx and uwsgi, but the query >> is still cached >> >> >> Thanks anyway! >> >> >> >>

Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread 술욱
Because this particular query runs in about 30 seconds and its result ends up in an excel file, which is generated with openpyxl from a template. If I change the template, the file returned by django is this new file, but its contents, the query result, doesn't (and it executes immediately). --

Re: Forcing Localization

2016-08-16 Thread Fred Stluka
Adam, Is it possible to force localization to a particular regional standard, no matter where I am viewing the page from? I don't know for sure, but it seems like some of these settings should be relevant.  It's a place to start anyhow.  Anyone have

How to save one field value from a model to another model field

2016-08-16 Thread Md. Ohiduzzaman
down votefavorite I designed two models: one model for storing Sitting date and another mode for storing Shifting date. Two model are linked by foreign key. Here is my two models: class Sitting(models.Model):

Subtracting UNIX_TIMESTAMPS broke in Django 1.10

2016-08-16 Thread Dan Edwards
I have a query that works in Django 1.9.9 but not 1.10. Running on CentOS 7, with python 2.7.5, and MySQL 5.6.23 on Amazon RDS Example: class TaskLog(models.Model): id = models.AutoField(primary_key=True) start = models.DateTimeField(auto_now_add=True) stop = models.DateTimeField(blan

How to save one field value from a model to another field of a linked model.

2016-08-16 Thread Md. Ohiduzzaman
I have designed a linked model named Shiftdate as: class Shiftdate(models.Model): shift_date = models.DateField(blank=False,unique=True) sit_date = models.ForeignKey(Sitting, on_delete=models.CASCADE) Using this model I changed sit_date to shift_date which

Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread Avraham Serour
did you checked if it cached in the browser? does nginx gets the request? if so what does it answers? On Tue, Aug 16, 2016 at 7:07 PM, 술욱 wrote: > Because this particular query runs in about 30 seconds and its result ends > up in an excel file, which is generated with openpyxl from a template.

Re: Advice on python version for new project

2016-08-16 Thread Avraham Serour
https://virtualenv.pypa.io/en/stable/ On Tue, Aug 16, 2016 at 1:36 AM, Rich Shepard wrote: > On Tue, 16 Aug 2016, Avraham Serour wrote: > > you should also create a virtualenv for the project >> > > Avraham, > > OK. Please point me to some docs for this. > > Regards, > > Rich > -- You recei

Re: Advice on python version for new project

2016-08-16 Thread Rich Shepard
On Tue, 16 Aug 2016, Avraham Serour wrote: https://virtualenv.pypa.io/en/stable/ Thanks, Avraham. Looks interesting. Rich

Re: Using the Django ORM in a long-running worker process

2016-08-16 Thread Daniel Tao
Can I bump this topic back to the top? 1. I actually don't know if this will work (not an experienced Google Groups user here). 2. Even if it does work, I don't know if this is considered bad form or something. If so, apologies. On Monday, August 15, 2016 at 11:28:26 AM UTC-5, Dani

Re: nginx+uwsgi, cache somewhere but I don't know where

2016-08-16 Thread 술욱
I found the problem. We run our MySql in master-slave. Somehow, our slave was out of sync. We updated some tables but this app was reading our slave. Thanks all!! 2016-08-16 15:58 GMT-03:00 Avraham Serour : > did you checked if it cached in the browser? does nginx gets the request? > if s

Re: Migrations for forms fields

2016-08-16 Thread ludovic coues
forms.Form are python class representing an HTML form. You use them to ask data to your user. Nothing more. models.Model are python class representing an entry in your database. You create them in python, always. Sometimes, you use a form by itself. For exemple, a login form will ask data, search

Re: New to Django

2016-08-16 Thread Wolf Painter
Anyone have any ideas? I'm really stuck here... -- 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 post to this group,

Re: New to Django

2016-08-16 Thread Luis Zárate
Hi, Try to implement a custom tag that can print Any dictionary in the form that you want. https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/ El martes, 16 de agosto de 2016, Wolf Painter escribió: > Anyone have any ideas? I'm really stuck here... > > -- > You received this m

Re: New to Django

2016-08-16 Thread Andrew Beales
Hi, you can use aggregation queries to count the child images connected to each server: # views.py from django.db.models import Count def servers(request): servers = Server.objects.all() for server in servers: server.child_images = server.images.aggregate(total=Count('base'))

Re: New to Django

2016-08-16 Thread Andrew Beales
All this talk about "child images on servers" has probably set off an alarm somewhere. On Wednesday, August 17, 2016 at 7:00:09 AM UTC+1, Andrew Beales wrote: > > Hi, you can use aggregation queries to count the child images connected to > each server: > > > # views.py > > from django.db.models

Re: Using the Django ORM in a long-running worker process

2016-08-16 Thread James Schneider
> My team has built a service comprising 3 main parts, a web application and 2 long-running worker processes that process events from a message exchange. All of these components interact with the same database and use the same underlying Django "app" for ORM models (i.e. the 2 worker processes call