Re: testing unique_together IntegrityError

2012-11-10 Thread Mike Dewhirst
On 11/11/2012 4:45pm, Mike Dewhirst wrote: Can anyone help with some unit test guidance please? How can I trap an IntegrityError in a test to prove unique_together is working? I'm modelling a company and multiple divisions. A solo division doesn't need a division.name so I'm allowing it to be b

testing unique_together IntegrityError

2012-11-10 Thread Mike Dewhirst
Can anyone help with some unit test guidance please? How can I trap an IntegrityError in a test to prove unique_together is working? I'm modelling a company and multiple divisions. A solo division doesn't need a division.name so I'm allowing it to be blank. It's __unicode__() method returns

Re: docstrings for inherited models not showing in Admin Docs

2012-11-10 Thread Mike Dewhirst
David I think the solution is to look at the admindocs source and tweak it to do what you want and submit a patch. The target audience for admindocs is template authors. This means you are possibly trying to make admindocs do something it wasn't designed to do. I don't mean your specific pro

Re: AttributeError for unique field during ModelForm validation

2012-11-10 Thread Rohit Banga
I want to ensure that a username is unique hence the unique constraint. Is having a ModelForm with an abstract model is supported? If not I will consider dynamically creating an instance of derived model form. But it looks a lot cleaner with the abstract class. On Saturday, November 10, 2012 5

Re: AttributeError for unique field during ModelForm validation

2012-11-10 Thread Andrejus
Hi! I would try to set unique property within "real" model, not within abstract base class. Besides django creates unique pk on each model by default, so to my mind creating additional unique field is redundant. Not quite sure, but there seems to be some restrictions on use of unique property.

Is this a bug or am I doing it wrong? (trans tag)

2012-11-10 Thread Some Developer
In the documentation it is quite clear that the following syntax is correct in templates: {% load i18n %} {% trans "my_string" as blah_string %} {{ blah_string }} etc etc. This works fine if the original trans tag is inside a block but then the blah_string variable is only valid within that

AttributeError for unique field during ModelForm validation

2012-11-10 Thread Rohit Banga
I noticed a strange behavior with Django and filed a bug https://code.djangoproject.com/ticket/19271#ticket It is suggested that I first check on the support group if the bug is valid or not. Fair Enough. I have created a standalone project to demonstrate the problem. In order to run it you may

Re: Queries to multiple tables

2012-11-10 Thread Javier Guerra Giraldez
On Sat, Nov 10, 2012 at 6:15 AM, Tomas Ehrlich wrote: > I usualy put methods like this one into Model, although Manager is also > possible. Definitely not View or sth else. definitely in the model. you'd use it like this: accnt = get_object_or_404 (Account, pk=account_id) payee = get_object_or_

Re: What are projects/apps a beginner python developer should look?

2012-11-10 Thread Matthias Müller
Try youtube. Pretty cool series of django tutorial from HackedExistence. https://www.youtube.com/watch?v=yAyWM-iEIos&feature=youtube_gdata_player If the link does not work, search for HackedExistence and django. Good luck. Regards Matthias Am 10.11.2012 16:29 schrieb "HackTheDay" : > Hi, What a

Re: google app engine suggestion

2012-11-10 Thread Ashwin Kumar
wow thank you, can any one of you write a blog post about how to setup this environment or share a post which you have written earlier. With Best -Ashwin. +91-9959166266 On Sat, Nov 10, 2012 at 10:19 PM, Javier Guerra Giraldez wrote: > On Sat, Nov 10, 2012 at 3:51 AM, Kurtis Mullins > wrote

Re: google app engine suggestion

2012-11-10 Thread Javier Guerra Giraldez
On Sat, Nov 10, 2012 at 3:51 AM, Kurtis Mullins wrote: > I, personally, prefer Nginx and uWSGI but something else may be better for > your particular use case. same here. it's a little different from other solutions, but rock solid, and includes its own process management, so it's really close t

What are projects/apps a beginner python developer should look?

2012-11-10 Thread HackTheDay
Hi, What are apps/prjects (with detailed documentation) like Poll App which a new developer can play around to get a grip of Django and web dev? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://

Docstring for an inherited model

2012-11-10 Thread David Simmons
Hi I'm pretty new to Django and am trying to use doc strings to document my model in the admin interface. All works fine except for a model that uses inheritance. My Abstract base model is: class Account(models.Model): """ blah blah """ account_id = models.CharField(max_length=10, unique=True)

docstrings for inherited models not showing in Admin Docs

2012-11-10 Thread David Simmons
Hi I'm using Django 1.4.2. I have a base model: class Account(models.Model):account_id = models.CharField(max_length=10, unique=True)name = models.CharField(max_length=50)balance = models.DecimalField(max_digits=20, decimal_places=2) and I have child model that inheri

Re: Queries to multiple tables

2012-11-10 Thread Tomas Ehrlich
Hi Kristofer, I usualy put methods like this one into Model, although Manager is also possible. Definitely not View or sth else. Why I like Model more than Manager is this difference (suppose your method is called make_payment): Account.make_payment # via Model Account.objects.make_payme

Re: google app engine suggestion

2012-11-10 Thread Kurtis Mullins
Well for development purposes, I just recommend using Django's built-in "runserver" command. It will launch a relatively full-featured HTTP Server for testing on your own computer. The command is "python manage.py runserver" and you should be able to access it using localhost:8000 Otherwise, I thi