Re: makemigrations and language_code

2015-10-21 Thread 'Hugo Osvaldo Barrera' via Django users
On Tue, Oct 20, 2015, at 10:39, Aron Podrigal wrote: > Simply run > > ./manage.py makemigrations myapp > > > That will avoid running for all your installed apps. That's merely a workaround, but it still doesn't solve the problem. Mainly, other users of libapp will still encounter the same issue.

Re: Invalid HTTP_HOST, can someone explain why I am getting this?

2015-10-21 Thread frocco
I spoke with webfaction and they advised I change apache2 config to Listen 127.0.0.1:29627 instead of Listen 29627 On Monday, September 21, 2015 at 7:46:49 PM UTC-4, frocco wrote: > > I am using webfaction and django 1.5 > > Is this something webfaction and resolve? > > On Monday, September 21, 2

Re: Locking / serializing access to one element in database

2015-10-21 Thread Simon Charette
Hi Joakim, I would suggest you use select_for_update() in a transaction. It's hard to provide a full example without more details about the kind of calculation required. Does it need to be run on new_text even if n

Locking / serializing access to one element in database

2015-10-21 Thread Joakim Hove
Hello; this arises in the context of a django application - but it might be a more general Python/Postgres/... problem. [ The django application is existing all right - but the problem I am describing here is yet only in my head; I am seeking advice on how to proceed. ] Assume I have a model

Issues with django-storages and gunicorn processes

2015-10-21 Thread Mike Herring
I am using django-storages to store media files in Amazon S3. Gunicorn spaws three worker processes, each running their own copy of S3BotoStorage. When I go into filebrowser and upload a file, the current worker process adds it to its entries list, and therefore knows that the file exists. When

Re: Why django (when using inlineformset) run 20 times the same SQL for each record (form)?

2015-10-21 Thread Steadman
I don’t have any experience with Crispy Forms, but I wonder if you get the same number of queries when you just print out the form and helper? On 20 October 2015 at 14:26:45, Fellipe Henrique (felli...@gmail.com) wrote: Here is my view, model and form:   https://gist.github.com/fellipeh/f10824e6

Re: Validating data for use directly in a model (not via forms)

2015-10-21 Thread Yunti
Thanks, yes I did look at model validation in the docs - it looked to be tied to use via forms. I hadn't realised that it's not called automatically when an instance is created. So if I was to validate when using get_or_create method would I then manually call full_clean() after get_or_create

Re: Validating data for use directly in a model (not via forms)

2015-10-21 Thread Simon Charette
Hi Yunti, Did you read about model level validation ? Calling model_instance.full_clean() triggers validation but it's not implicitly called when you save an instance. For your date case you'll have to include a l

Validating data for use directly in a model (not via forms)

2015-10-21 Thread Yunti
I have a django project where I want to save web scraped data to the database via the django ORM- which will be used in the django app. The data is currently in the form of JSON -> converted to python dict via json.loads I setup my model with the narrowest/ most constrained field type possible

Re: Use of transactions

2015-10-21 Thread Esau Rodriguez
Hi, it's hard to say without seeing more code. In my mind right now is something like: * First transaction start ** T1: It reads maximum from DB (lets say is 100) ** T1: It will create 101 ** T1: It will create 102 * T2: Let say at this moment second transaction start ** T2: It reads maximum from D

Re: Use of transactions

2015-10-21 Thread César Bustíos Benites
Hello! Thank you for answering. So if that's the case then what is happening is that (according to question 1) the second transaction is getting the same number as the first one and complaining with the IntegrityError while trying to save. Is that correct? On Wednesday, October 21, 2015 at 10:

Re: Dynamic forms data is not getting sent in the POST

2015-10-21 Thread sushovan majumdar
Thanks James. I changed the rendering to move the fieldset inside the form tag and it works. Thank you so much On Wednesday, 21 October 2015 10:58:31 UTC-4, sushovan majumdar wrote: > > Hi James. > I'm copying the rendered HTML from browser view source: > > > > > > > > > > > > Co

Re: Use of transactions

2015-10-21 Thread Esau Rodriguez
Hi, Transactions are a different concept than locks. In few words a transaction means that the all the sentences within it are done or not done, but can't be half done (unless you have savepoints, and want to rollback to a particular point). The locks avoid other for making operations on the table

Re: Use of transactions

2015-10-21 Thread César Bustíos Benites
Anyone? T_T On Tuesday, October 20, 2015 at 1:02:27 PM UTC-5, César Bustíos Benites wrote: > > Hello, first, let me give you an idea of the problem I'm facing. This is a > company with a fruit packaging plant, they use several printers for the > barcodes they attach in fruit boxes, clamshells a

Re: django 1.8 , makemigrations throwing errors

2015-10-21 Thread Christoph Knapp
Hi, the errors disappear when the models.py file is changed by adding _id to the fields defined for the tables where the errors are exist. As an example for one table I changed class AuthUserUserPermissions( models.Model): user = models.ForeignKey(AuthUser) permission = models.ForeignK

Re: duplicated selenium test fails

2015-10-21 Thread Carl Meyer
On 10/21/2015 02:55 AM, Ulrich Laube wrote: > Am 21.10.2015 um 00:18 schrieb Carl Meyer: >> On 10/19/2015 03:03 AM, Ulrich Laube wrote: >>> It boils down to this: >>> [...] >>> Is it a known problem? >> >> Not really a problem - you just need to be aware that you can't rely on >> consistent databas

Re: django 1.8 , makemigrations throwing errors

2015-10-21 Thread Christoph Knapp
Hi, the errors disappear when the models.py file is changed by adding _id to the fields defined for the tables where the errors are exist. As an example for one table I changed [code] class AuthUserUserPermissions(models.Model): user = models.ForeignKey(AuthUser) permission = models.F

Re: save() prohibited to prevent data loss due to unsaved related object 'committee'

2015-10-21 Thread Tim Graham
You need to call super() in your custom method to ensure the object is actually saved to the database. On Wednesday, October 21, 2015 at 8:12:24 AM UTC-4, Yaniv Mirel wrote: > > The Committee.save() is: > def save(self, *args, **kwargs): >if not self.slug: >self.slug = 'committee-

Re: save() prohibited to prevent data loss due to unsaved related object 'committee'

2015-10-21 Thread Yaniv Mirel
The Committee.save() is: def save(self, *args, **kwargs): if not self.slug: self.slug = 'committee-%s' % self.id And yes, after removing that save function everything works fine. On Tuesday, October 20, 2015 at 9:32:20 PM UTC+3, Tim Graham wrote: > > What does the Committee.save() m

Deploying Django Application to AWS Beanstalk

2015-10-21 Thread Sudhanshu Shekhar
Hi, I am a Django newbie trying to deploy my own site to the AWS beanstalk (free tier) but am facing a lot of issues doing so. The current AWS documentation seems incomplete (they don't mention setting up databases etc). Can someone please tell me how to deploy a Django application to AWS. I a

Re: django 1.8 , makemigrations throwing errors

2015-10-21 Thread Christoph Knapp
Hi, I have the same problem. The models.py file was created by python manage.py inspectdb > models.py I just copied it over into my app and modified it. My output is readDatabase.AuthGroupPermissions: (models.E012) 'unique_together' refers to the non-existent field 'group_id'. readDatabase

Re: duplicated selenium test fails

2015-10-21 Thread Ulrich Laube
Thanks Carl! Am 21.10.2015 um 00:18 schrieb Carl Meyer: On 10/19/2015 03:03 AM, Ulrich Laube wrote: It boils down to this: [...] Is it a known problem? Not really a problem - you just need to be aware that you can't rely on consistent database IDs in tests. So there is no test isolation whe

Re: What is the recommended schema design for dynamic dates in Django for PostgreSQL?

2015-10-21 Thread Erik Cederstrand
> Den 20. okt. 2015 kl. 18.09 skrev Radek Svarz : > > Hi Erik, > > thanks for m2m suggestion. > > What do you think about using suggested view in DB? (@SO) (i.e. the DB would > do the conversion on the fly) In general, I think of DB views as either a performance optimization or a way to stor