dumpdata --format=yaml, dates, and USE_TZ

2013-12-04 Thread James Schneider
Hello all, I'm hitting strange runtime errors when using some fixtures, and I wanted to validate with others before I file a bug for 1.6... Here are two examples of dumpdata commands using the same database and same data: $ python manage.py dumpdata auth.user --format=json --indent=4 { "pk"

Re: Inconsistent Django test results depending upon how the test is called in Django 1.5.1 running on Python 2.7.4

2013-12-04 Thread Russell Keith-Magee
On Mon, Dec 2, 2013 at 4:41 PM, Paul Whipp wrote: > Hi Russ, > > Thanks for your detailed response, deserving of this detailed > investigation: > > I eventually found that it is the simple declaration of a model within the > test suites that is causing the problem: > > django.contrib.contents.tes

Re: Complex validation

2013-12-04 Thread Mike Dewhirst
On 5/12/2013 3:04pm, Lachlan Musicman wrote: Hola, I have an object Part that has a method part_number() part_number is a function that returns an identifying string based on a number of different vars on the model. part_number needs to be unique, but the building of the part_number is complex

Re: Complex validation

2013-12-04 Thread Mike Dewhirst
On 5/12/2013 3:18pm, Lachlan Musicman wrote: Actually, as a corollary to my previous question, I can't tell from the Docs whether the model's validation process (in particular, the clean() method) is called at save() or called when validating via a form? clean() isn't called by save() it is cal

Re: Complex validation

2013-12-04 Thread Lachlan Musicman
Actually, as a corollary to my previous question, I can't tell from the Docs whether the model's validation process (in particular, the clean() method) is called at save() or called when validating via a form? IE, I want the clean() method invoked at save - so that data imported via fixtures or SQ

Re: Django application

2013-12-04 Thread Lachlan Musicman
Sandeep, Have you read this part of the documentation? https://docs.djangoproject.com/en/1.6/howto/deployment/ cheers L. On 5 December 2013 15:07, Lachlan Musicman wrote: > Which web server are you using to serve it on the host server? > > Apache, nginx are the most likely... > > And how do yo

Re: Django application

2013-12-04 Thread Lachlan Musicman
Which web server are you using to serve it on the host server? Apache, nginx are the most likely... And how do you have that web server configured? cheers L. On 5 December 2013 13:53, Sandeep kaur wrote: > Hello, > I installed a django app "zebra" in my django site. This application is > wor

Complex validation

2013-12-04 Thread Lachlan Musicman
Hola, I have an object Part that has a method part_number() part_number is a function that returns an identifying string based on a number of different vars on the model. part_number needs to be unique, but the building of the part_number is complex enough that it cannot just be done via class M

Django application

2013-12-04 Thread Sandeep kaur
Hello, I installed a django app "zebra" in my django site. This application is working with runserver but not on host server. I want it running on host server ASAP. What could be the probable reason for this behavior of app? Your help will be appreciated. -- Sandeep Kaur E-Mail: mkaurkha...@gmail

Re: Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Matt Schloepp
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'django', 'USER': 'matt', 'PASSWORD':'***', 'HOST': '127.0.0.1', 'PORT': '5432', }, 'OPTIONS': { 'autocommit': True, } I forgot to post DB settings On Wedn

Re: Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Matt Schloepp
Django is 1.6 and Python is 2.7.5. On Windows 8.1, no virtual-env, but my actual project will be on a *nix VM. I accidentally download and install a development version, I think removed it before installing 1.6 but no previous django versions were installed on this system. Maybe dropping my db

Re: Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Thomas Lockhart
On 12/4/13 9:18 AM, Matt Schloepp wrote: I'm running Django on Windows with PostgreSQL database. I'm in tutorial 5 and have copy/pasted the code after it's initial failure. I've been following the tutorials to this point, with only a little side experimentation, and everything has been working.

Re: Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Matt Schloepp
Commenting out my Postgresql DB and putting back the default options for the sqlite DB fixed the issue. Is there a tests.py variable I could use to create an If..Else that would allow this to be automatic and not force me to edit my settings.py every time I wanted to run a test. -- You recei

Handle django sessions when doing file-operations

2013-12-04 Thread sachin
Hello guys, Need your help again. I m writing an app which does following file/dir operations: 1. Create a directory 2. Untar contents of some tarballs into it. 3. Do some more file operations like create a new file, open it for appending more text, finally cose it(file content varies upon per

Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Matt Schloepp
I'm running Django on Windows with PostgreSQL database. I'm in tutorial 5 and have copy/pasted the code after it's initial failure. I've been following the tutorials to this point, with only a little side experimentation, and everything has been working. It looks like it DB related since I'm no

Re: need some explanation

2013-12-04 Thread Tom Evans
On Wed, Dec 4, 2013 at 7:20 AM, Hussain Nagri wrote: > Hello, > I am new to Django and trying to learn myself. > My question is that when we create models in model.py then after each class > we define a '__unicode__'. Is it necessary that we define this method ? It > gets called every time I try t

need some explanation

2013-12-04 Thread Hussain Nagri
Hello, I am new to Django and trying to learn myself. My question is that when we create models in model.py then after each class we define a '__unicode__'. Is it necessary that we define this method ? It gets called every time I try to fetch any data from that model. what if I don’t want it to

Re: db performance with model inheritance vs. alternatives

2013-12-04 Thread Matthias Dahl
Hello @all, just to be clear and honest upfront: I've just posted this question on http://stackoverflow.com/questions/20373194/db-performance-with-model-inheritance-vs-alternatives as well. I hope this is okay and doesn't upset anyone. Thanks again. So long, Matthias -- Dipl.-Inf. (FH) Matt

db performance with model inheritance vs. alternatives

2013-12-04 Thread Matthias Dahl
Hello @all, sorry for the cryptic subject but summarizing what this mail is about, is kind of hard. :) So please bear with me for a moment... I am working on an application that is designed to be highly modular and extendable (by means of plugins). So basically you have models that are stripped d

Re: How to query multiple described objects exist in a many to many field

2013-12-04 Thread Tom Evans
On Wed, Dec 4, 2013 at 10:24 AM, Aamu Padi wrote: > How do I check whether there is a thread containing only the sender (user 1) > and the recipient (user 2), and no other users. > > models.py > > class Thread(models.Model): > user = models.ManyToManyField(User) > is_hidden = m

How to query multiple described objects exist in a many to many field

2013-12-04 Thread Aamu Padi
How do I check whether there is a thread containing only the sender (user 1) and the recipient (user 2), and no other users. models.py class Thread(models.Model): user = models.ManyToManyField(User) is_hidden = models.ManyToManyField(User, related_name='hidden_thread', blank=T