Re: django.conf.urls.defaults is deprecated

2013-01-07 Thread nkryptic
.py:3: > > DeprecationWarning: django.conf.urls.defaults is deprecated; use > django.conf.urls instead > DeprecationWarning) > > And the compiled settings.py continue to match =( > > 2013/1/6 nkryptic <nkry...@gmail.com > > >> In your urls.py file, you

Re: Architectural question - decoupling modules but keeping some interaction

2013-01-07 Thread nkryptic
Based on what you're describing, I'd recommend you look through the code for django-cms. While it doesn't do exactly what you describe, they are using a "plugin" system which might give you some ideas. github: https://github.com/divio/django-cms website: https://www.django-cms.org/ On Monday,

Re: InMemoryUploadedFile no `encoding` Attribute

2013-01-06 Thread nkryptic
The InMemoryUloadedFile has the following inheritance: django.core.files.uploadedfile.InMemoryUploadedFile - django.core.files.uploadedfile.UploadedFile --- django.core.files.base.File --django.core.files.utils.FileProxyMixin FileProxyMixin defines a propery "encoding", that simply calls

Re: django.conf.urls.defaults is deprecated

2013-01-06 Thread nkryptic
In your urls.py file, you probably have something like: from django.conf.urls.defaults import patterns, url, include change that to: from django.conf.urls import patterns, url, include On Sunday, January 6, 2013 9:57:25 AM UTC-5, Thiago wrote: > > Hello, > > I am having this "DeprecationWarning:

Re: Multiple model inheritance

2013-01-06 Thread nkryptic
yes, yes, no and yes. Abstract models should inherit form models.Model. Abstract models should always have a Meta class with abstract=True. The order matters when it comes to shared functionality. Here's how I would code those models you had: class Taggable(models.Model): tag =

Re: Modelforms and class based views

2013-01-05 Thread nkryptic
Multiple forms with generic views are a problem - you can't really use the form processing ones as they expect a single form. But, say you want a view that has a Pet form and and Owner form class Owner(models.Model): name = models.CharField(max_length=100) email =

Re: How to add an element of derived data to a Django model?

2013-01-05 Thread nkryptic
Don't add it to the fields for the ModelAdmin, add it to the 'list_display': class myModelAdmin(admin.ModelAdmin): list_display = ('a', 'b', 'c') On Saturday, January 5, 2013 4:25:11 PM UTC-5, Saqib Ali wrote: > > > I tried Aaron's method. Django validated the model. > However, when I added

Re: Django app custom settings testing

2013-01-05 Thread nkryptic
it > won't be a piece of sh... Sorry again, I got carried away. > > -- > Tres42 > Pedro J. Aramburu > > > On Fri, Jan 4, 2013 at 12:59 PM, nkryptic <nkry...@gmail.com > > wrote: > >> The only thing I've seen which handles all the cases you mention is

Re: Run Individual doctest in model.py or views.py

2013-01-04 Thread nkryptic
In the example, animals would be the app modules which contains a models.py file and/or tests.py. "classify" would be a function in either models.py or tests.py with a doctest string as the comment. $ ./manage.py test animals.Bear The above would run the doctest comment on the class Bear in

Re: Django app custom settings testing

2013-01-04 Thread nkryptic
The only thing I've seen which handles all the cases you mention is http://passingcuriosity.com/2010/default-settings-for-django-applications/ . That may also be what you were referring to about seeing something on github. As to your new question, I think that would work, because every time

Re: Django won't send 500 or 404 emails, but django.core.mail.EmailMessage and django.utils.log.AdminEmailHandler work

2013-01-04 Thread nkryptic
The 404 emails are sent via the mail_managers method, which uses emails from the django.conf.settings.MANAGERS setting, as opposed to errors which go to the ADMINS. Double-check what MANAGERS (and ADMINS) is actually set to: $ python manage.py shell >>> from django.conf import settings >>>