Re: Registering a stand-alone test app

2015-02-10 Thread Avraham Serour
This could be an issue with your pythonpath , it looks like the ./app folder is being added twice to the path, so the import complains it found a module with this name in multiple locations On Feb 11, 2015 8:07 AM, "Nicole Harris" wrote: > Hi All, > > I have an app

Registering a stand-alone test app

2015-02-10 Thread Nicole Harris
Hi All, I have an app in my root folder named 'bdd'. It contains an (empty) models.py as well as some files for running behave tests. I have added this app to INSTALLED_APPS in my settings.py so that I can run the tests with the Django Behave

Re: cache.set(key, timeout=0)

2015-02-10 Thread Russell Keith-Magee
Hi Thomas, You are correct - if you set timeout=0, the cached value immediately expire (effectively "don't cache"). This appears to be an oversight of the documentation; the section you reference includes a discussion of the None value, but not the 0 value - a clarification would definitely be

Re: Logging transaction statements?

2015-02-10 Thread Carl Meyer
On 02/10/2015 04:03 PM, Erik Cederstrand wrote: >> But `self.connection.set_isolation_level()` is called in >> `_set_autocommit()`, and that should be sufficient. (The >> `_set_isolation_level()` method is dead code in 1.7 and has since >> been removed, but what really matters is that >>

Re: Logging transaction statements?

2015-02-10 Thread Erik Cederstrand
> Den 10/02/2015 kl. 23.45 skrev Carl Meyer : > > Yes, that's what I said :-) Thanks for the great explanations; I didn't see your previous answer before posting my latest reply, hence the duplicate explanations :-) > >> My code relies on isolation level "Serializable" for a

Re: Logging transaction statements?

2015-02-10 Thread Carl Meyer
Hi Erik, On 02/10/2015 03:30 PM, Erik Cederstrand wrote: > Den 10/02/2015 kl. 21.27 skrev Erik Cederstrand > : >> >> Running this in parallel in two processes on the same machine >> returns this after a while: >> >> Process A: [...] >> >> Process B: [...] Traceback

Re: Logging transaction statements?

2015-02-10 Thread Erik Cederstrand
Den 10/02/2015 kl. 21.27 skrev Erik Cederstrand : > > Running this in parallel in two processes on the same machine returns this > after a while: > > Process A: > [...] > > Process B: > [...] > Traceback (most recent call last): > File "tmp.py", line 30, in >

Re: Logging transaction statements?

2015-02-10 Thread Carl Meyer
On 02/10/2015 02:46 PM, Carl Meyer wrote: > On 02/10/2015 01:27 PM, Erik Cederstrand wrote: >>> Den 10/02/2015 kl. 18.34 skrev Carl Meyer >> >: >>> >>> I assume you're using the 'db' cache backend? Otherwise, it wouldn't >>> make sense to expect

Re: Logging transaction statements?

2015-02-10 Thread Carl Meyer
On 02/10/2015 01:27 PM, Erik Cederstrand wrote: >> Den 10/02/2015 kl. 18.34 skrev Carl Meyer > >: >> >> I assume you're using the 'db' cache backend? Otherwise, it wouldn't >> make sense to expect transactions to affect cache calls at all. > > Yes, I'm

Re: Dropzone.js and images POST on new object

2015-02-10 Thread Karim
On Tue, Feb 10, 2015 at 7:25 PM, James Schneider wrote: > I wouldn't store binary data like an image in a session, especially if you > have a DB-backed session system. > > ​[] > > ​Thank you James.​ -- Karim N. Gorjux -- You received this message because you are

Re: Logging transaction statements?

2015-02-10 Thread Erik Cederstrand
Hi Carl, > Den 10/02/2015 kl. 18.34 skrev Carl Meyer >: > > I assume you're using the 'db' cache backend? Otherwise, it wouldn't > make sense to expect transactions to affect cache calls at all. Yes, I'm using the db backend. > The difference

Re: Tests and read-only database

2015-02-10 Thread Scot Hacker
On Tuesday, February 10, 2015 at 12:55:57 AM UTC-8, Avraham Serour wrote: > > you can tell django to use sqlite for tests, it will create an in memory > sqlite > Thanks Avraham. Having a bit of trouble finding specifics on this in the documentation, but this works neatly: if 'test' in

Re: django 1.7 migration generates wrong column name for foreign key to a one-to-one model

2015-02-10 Thread Dhelbegor
you using primary_key in one OnetoOneField, please create other Field id = AutoField(primary_key=True) ex: class AgentOrderRejection(models.Model): id_agent = models.AutoField(primary_key=True) agent = models.ForeignKey(AgentProfile) user = models.OneToOneField(USER_MODEL) or use

Re: Logging transaction statements?

2015-02-10 Thread Carl Meyer
Hi Erik, On 02/10/2015 10:28 AM, Erik Cederstrand wrote: > Hmm, I'm beginning to think I don't understand Django transactions. I > have the following two snippets, boiled down from my original code. The > first one calls cache methods via helper functions, the other one calls > the cache methods

Re: Logging transaction statements?

2015-02-10 Thread Erik Cederstrand
> Den 10/02/2015 kl. 17.15 skrev Erik Cederstrand : > > Hi list, > > I'm tracking down a bug in my app that shouldn't be happening with the > transaction statements I added in my code. In my logging settings, I can set > 'django.db.backends' to DEBUG to log the

Logging transaction statements?

2015-02-10 Thread Erik Cederstrand
Hi list, I'm tracking down a bug in my app that shouldn't be happening with the transaction statements I added in my code. In my logging settings, I can set 'django.db.backends' to DEBUG to log the queries (I'm using the postresql backend). I see 'SAVEPOINT' statements logged, but I also need

Re: Question about subdomains.

2015-02-10 Thread Tom Christie
> Are these 3 different apps in 1 project, or 3 different projects. Either are possible. It depends on the application. -- 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

Question about subdomains.

2015-02-10 Thread Chen Xu
Hi I am using Django to build a website. I saw some websites have www.ABC.com, support.ABC.com, and career.ABC.com. I wonder how this is achieved. Are these 3 different apps in 1 project, or 3 different projects. Thanks -- ⚡ Chen Xu ⚡ -- You received this message because you are subscribed

JsonResponse and Ajax function.

2015-02-10 Thread elcaiaimar
Hello! I've written a code to delete db registers and I want to call an ajax function when the delete is done. At the moment, when I click my delete button I only receive a message: {"status":"True","product_id":p.id} or {"status":"False"} and this should be sent to the ajax function and I

JsonResponse and ajax function

2015-02-10 Thread elcaiaimar
Hello! I've written a code to delete db registers and I want to call an ajax function when the delete is done. At the moment, when I click my delete button I only receive a message: {"status":"True","product_id":p.id} or {"status":"False"} and this should be sent to the ajax function and I

django 1.7 migration generates wrong column name for foreign key to a one-to-one model

2015-02-10 Thread Jack Peng
I ran into this problem trying to run manage.py test. The error I get looks like this: ALTER TABLE "quote_agentorderrejection" ADD CONSTRAINT "quote_agentor_agent_id_1388a6f8215473de_fk_user_agentprofile_id" FOREIGN KEY ("agent_id") REFERENCES "user_agentprofile" ("id") DEFERRABLE INITIALLY

Django: get profiles having auth.Group as foreign key

2015-02-10 Thread itsjay040
I have an model which uses auth.models Group as foreign key called Dashboard:- class Dashboard(models.Model): d_name = models.CharField(max_length=200) d_description = models.CharField(max_length=200) d_url = models.CharField(max_length=200) d_status =

Re: use apache instead of server by default

2015-02-10 Thread Thierry Granier
peraps but i have no choice and i must use apache. I don't understand the different docs tu use apache. Help please Thanks Le dimanche 8 février 2015 23:20:31 UTC+1, Thierry Granier a écrit : > > Hello > > i have installed python3.4 and django1.7 on debian jessie. > > runserver works with

Re: Tests and read-only database

2015-02-10 Thread Avraham Serour
you can tell django to use sqlite for tests, it will create an in memory sqlite if you need the data on the DB for the tests you can import when initializing the tests, dump a part of the data and call it test data On Tue, Feb 10, 2015 at 3:29 AM, Scot Hacker wrote: > My

cache.set(key, timeout=0)

2015-02-10 Thread Thomas Güttler
I want the cache timeout to be configurable: - N --> number of seconds - None --> cache for every - 0 --> do not cache at all. I am not sure if timeout=0 really does what I want. I could not find it explicitly in the docs: https://docs.djangoproject.com/en/1.7/topics/cache/#basic-usage I

Re: Dropzone.js and images POST on new object

2015-02-10 Thread James Schneider
I wouldn't store binary data like an image in a session, especially if you have a DB-backed session system. I would instead use a separate model just for the images so that they can be created on the fly by dropzone via an API call, and then you can save the ID of the image object in the session