Re: formating

2013-10-28 Thread Leonardo Giordani
I think that the extra space between "floatformat:" and "2" is confusing the template system. Try using "floatformat:2" without spaces. Leo Leonardo Giordani Author of The Digital Cat My profile on About.me - My GitHub page

Digging up Django class-based views - 1

2013-10-28 Thread Leonardo Giordani
Hi all, I want to share with you a post about class-based views. Hope you find it useful. http://lgiordani.github.io/blog/2013/10/28/digging-up-django-class-based-views-1/ Leonardo Giordani Author of The Digital Cat My profile on About.me

django-stdimage NoneType problem

2013-10-28 Thread Oscar Carballal
Hi, I'm starting to port my project (e-cidadania) into python 3 and django 1.6rc1, but I'm currently facing a problem that I can't understand. When I try to do a runserver or a syncdb or any other command, it breaks with this message: ➜ src git:(python3) ✗ ./manage.py syncdb TypeError: 'NoneTyp

South migration when custom field definitions change

2013-10-28 Thread graeme
I have an app that uses some custom model fields. These are subclasses of standard fields. I have tried to include as many defaults as possible in custom field to stick to DRY. I have written South introspection rules for these that work fine when I change a model What happens when I change t

Re: formating

2013-10-28 Thread fabricio
> does not work > -- 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 email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@

Re: Digging up Django class-based views - 1

2013-10-28 Thread Michal Sládek
Very nice, thank you! Looking forward to read the next part. Michal -- 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 email to django-users+unsubscr...@googlegroups.com.

Backwards relation not showing up via related_name in inherited models

2013-10-28 Thread Joshua Orvis
I'm using Django 1.6 RC1 and Python 3.3 with the following models: class StepBlueprint(models.Model): parents = models.ManyToManyField('self', blank=True, null=True, related_name='children') name = models.CharField( max_length=100 ) def __str__(self): return self.name clas

Re: Backwards relation not showing up via related_name in inherited models

2013-10-28 Thread Daniel Roseman
On Monday, 28 October 2013 07:29:39 UTC, Joshua Orvis wrote: > I'm using Django 1.6 RC1 and Python 3.3 with the following models: > > class StepBlueprint(models.Model): > parents = models.ManyToManyField('self', blank=True, null=True, > related_name='children') > name = models.CharField

Re: formating

2013-10-28 Thread Leonardo Giordani
Can you please paste the code with a good formatting? To pastebin or similar? I'd like to see model, view and template. Leonardo Giordani Author of The Digital Cat My profile on About.me - My GitHub page

Re: Digging up Django class-based views - 1

2013-10-28 Thread Timothy W. Cook
Very timely for me. Well written post for those of us just getting started with Django. Thanks, looking forward to the next installment. --Tim On Mon, Oct 28, 2013 at 6:01 AM, Leonardo Giordani < giordani.leona...@gmail.com> wrote: > Hi all, > > I want to share with you a post about class-ba

Re: formating

2013-10-28 Thread fabricio
no meu modelo valor_ultimacompra = models.DecimalField(u'Vlr.Ult.Compra', max_digits=18, decimal_places=2, default=0, blank=True, null=True) no template {% extends "base.html" %} {% load humanize %} {% load foundation %} {{form.valor_ultimacompra|foundation| floatformat:2 }} -- You rec

Re: formating

2013-10-28 Thread Leonardo Giordani
What is foundation? You said that {{form.valor_ultimacompra}} works. What about {{form.valor_ultimacompra|foundation}} ? Leonardo Giordani Author of The Digital Cat My profile on About.me - My GitHub page

Re: formating

2013-10-28 Thread fabricio mata de castro Mata
the problem is that Form.valor_ultimacompra | tag this bringing all the input if you Form.valor_ultimacompra.value works but then I lose the input would make automatic? {{Form.valor_ultimacompra | floatformat: 2}} 2013/10/28 Leonardo Giordani > What is foundation? > You said that > > {{fo

Re: Psycopg2 on Mac OS X (Snow Leopard)

2013-10-28 Thread Tom Lockhart
On 2013-10-27, at 7:46 AM, Doug Snyder wrote: > I don't have a very specific answer for your question. I just started doing > my django dev on OSX coming from Ubuntu > My understanding is that Home Brew is a better solution than Mac Ports, I > have heard some people being very critical of Mac

'module' object has no attribute 'urlpatterns'

2013-10-28 Thread abhijeet shete
Hi Folks, I have developed one app say "XYZ" and I am using it in my django project as symblik link. I am trying to access urlpatterns in urls.py module from django project in my "XYZ" app as *from django.conf import settings* * from importlib import import_module * ** * root_urls =

ImportError: No module named django.core.wsgi even if sys.path contains my virtualenv

2013-10-28 Thread Giovanni Allegri
I'm getting mad with this error. I've setup Apache and wsgi configuration as usual, but this time I'm on CentOS instead of Debian, and I don't know it very well. Anyway, I tried all the ways to give mod_wsgi the chance to peak from my virtualenv libraries, both setting them with python-path argum

Re: Backwards relation not showing up via related_name in inherited models

2013-10-28 Thread Joshua Orvis
Thank you for responding, that's extremely helpful. I'm still failing to query against it though. How would I implement a query for the get_children() method in the example above? That is, for any given instance of FlowBlueprint how do I get all objects with a relation to it? On Monday, Octo

Re: ImportError: No module named django.core.wsgi even if sys.path contains my virtualenv

2013-10-28 Thread Timothy W. Cook
CentOS is a bit of a PITA. Because it is so secure. Try turning off SELinux http://www.centos.org/docs/5/html/5.2/Deployment_Guide/sec-sel-enable-disable.html To test this out from the commandline: $setenforce 0 How to actually make it work WITH SELinux? I haven't figured that out yet. HTH,

Re: ImportError: No module named django.core.wsgi even if sys.path contains my virtualenv

2013-10-28 Thread G. Allegri
Hi Timothy, I'm on a managed server, so I cannot do system changes that would require reboot. Anyway, setenforce says that SELinux is disabled (even setenforce 1). Do you think it is SELinux to block Python module loading? If I activate my virtualenv from shell I can load Django. giovanni 2013

Re: Django Tutorials

2013-10-28 Thread Jasvir Singh
On Mon, Oct 28, 2013 at 12:20 AM, Mario Osorio wrote: > From a noob: > You seem to have some good articles, but you should at the very least revise > your typography. Thanks Marlo. Typography is on top priority now. I'll add new post after revising typography. -- Jasvir Singh Grewal Blog:http

Re: Django Tutorials

2013-10-28 Thread Jasvir Singh
On Mon, Oct 28, 2013 at 11:01 AM, Diogene Laerce wrote: > I find it nice. A table of contents with links to each articles would be > great. ;) Thanks Diogene. Keep reviewing it. You comments will boost up my confidence. :) -- Jasvir Singh Grewal Blog:http://jasvirsinghgrewal91.wordpress.com/

Re: Backwards relation not showing up via related_name in inherited models

2013-10-28 Thread Daniel Roseman
On Monday, 28 October 2013 15:11:24 UTC, Joshua Orvis wrote: > Thank you for responding, that's extremely helpful. I'm still failing to > query against it though. How would I implement a query for the > get_children() method in the example above? That is, for any given > instance of FlowBlue

Re: Django Tutorials

2013-10-28 Thread Jasvir Singh
On Sat, Oct 26, 2013 at 9:12 PM, Pepsodent Cola wrote: > Maybe make the text typography easier to see and read? Thanks for your suggestion. This is one the best suggestions that I have got about my blog. Now I am working on it. I'll let you know when it's done. Then you can again review it. :) -

Re: Django Tutorials

2013-10-28 Thread Nigel Legg
I have looked at this a few times, and now I have realised what was bugging me. Because this tutorial is a series of blog posts, when you access it, you get to the most recently posted article, which may not be the article you are looking for and will not be the start of the tutorial. I think the b

Re: city selector for django

2013-10-28 Thread Nigel Legg
Following the link you posted I found a test project, is that not a usage example? Cheers, Nigel 07914 740972 On 28 October 2013 16:01, rush wrote: > Hi, > > It's pretty hard to find lightweight and easy city selector app with ready > to use database. > > After a while, I've found a django-ci

Re: Django Tutorials

2013-10-28 Thread Jasvir Singh
On Mon, Oct 28, 2013 at 9:48 PM, Nigel Legg wrote: > I have looked at this a few times, and now I have realised what was bugging > So I think that it would be much more useful and accessible if it was a > series of pages rather than a series of blog posts. Even I was thinking this too. Soon I'

Re: city selector for django

2013-10-28 Thread rush
Hi, nope. unfortunately test_project has only URLs.Py . anything else is missing or broken. like templates directory is a link to itself. 28.10.13, 20:32, "Nigel Legg" ": > > Following the link you posted I found a test project, is that not a usage > example? > > Cheers, Nigel > 07914 740972

Re: city selector for django

2013-10-28 Thread Nigel Legg
OK. The readme makes it sound like it should work. maybe you should contact the django-cities-light team? Cheers, Nigel 07914 740972 On 28 October 2013 16:35, rush wrote: > Hi, > > nope. unfortunately test_project has only URLs.Py . anything else is > missing or broken. like templates direct

Re: Django Tutorials

2013-10-28 Thread Nigel Legg
Cool, I'll take another look at it then. Cheers, Nigel 07914 740972 On 28 October 2013 16:35, Jasvir Singh wrote: > On Mon, Oct 28, 2013 at 9:48 PM, Nigel Legg wrote: > > I have looked at this a few times, and now I have realised what was > bugging > > > > > So I think that it would be much

Re: ImportError: No module named django.core.wsgi even if sys.path contains my virtualenv

2013-10-28 Thread Timothy W. Cook
Al I know is that I can run Django from a virtualenv using the development server. I have to disable SELinux to get Apache to run my Django app via WSGI. I am sure there are settings that you can make (have made) to SELinux to allow access but I have not studied it to find out what they are.

django.utils.copycompat is deprecated

2013-10-28 Thread tino
Hello, I am getting the following in apache error log. [error] /home/findme/virtualenv/lib/python2.7/site-packages/django/utils/copycompat.py:10: DeprecationWarning: django.utils.copycompat is deprecated; use the native copy module instead Is this something to worry about? Regards Tino -

django difference between - one to one, many to one and many to many

2013-10-28 Thread Aamu Padi
So, this is my first time learning computer language. And I chose python and django. Now, I got many of the basic concepts of python and also django. I can create new page with the views and all other stuff. But I am still confused with the relations, i.e. one to one, many to one, and many t

Re: Psycopg2 on Mac OS X (Snow Leopard)

2013-10-28 Thread Adam Portier
Good afternoon, I just had this exact same problem and it took me a while to find the solution. On OSx there is a separate library path variable for .dylib library files. I added the following to my .bashrc (or.bash_env or however you set up your shell environment). export DYLD_LIBRARY_PATH=

Re: Psycopg2 on Mac OS X (Snow Leopard)

2013-10-28 Thread Skip Montanaro
> I just had this exact same problem and it took me a while to find the > solution. > > On OSx there is a separate library path variable for .dylib library files. I > added the following to my .bashrc (or.bash_env or however you set up your > shell environment). > > export > DYLD_LIBRARY_PATH="/usr

Re: django difference between - one to one, many to one and many to many

2013-10-28 Thread C. Kirby
Those concepts are actually RDBMS (Database) ideas. You would probably be better off reading up on those. This looks to be a pretty good explanation: http://net.tutsplus.com/tutorials/databases/sql-for-beginners-part-3-database-relationships/ On Monday, October 28, 2013 2:06:20 PM UTC-5, Aamu Pa

Re: Django ManyToMany performance?

2013-10-28 Thread Ruturaj Dhekane
Thanks Daniel and Robin. Have we seen the scales where Many-to-many DBs through Django work well? Like 50K articles in 5K publications. The aim of this question was to make a design choice too - whether I should use Django constructs/calls directly or should i write my own SQL to make queries - as

Re: Django Tutorials

2013-10-28 Thread Mario R. Osorio
I will say it again ... I DID read thru some of the articles, if at least the first few lines. I did like the feeling I get from the blog. IMHO, everyones' comment here has been for the best and you should not feel low confidence for any reason. On the contrary: Had you not received any comments, T

Querying across Generic Relations

2013-10-28 Thread Lee Hinde
I have a table, Credit, that I want to query based on a value several hops away. There's a CreditLineItems that has a Generic Foreign Key to one of two tables, each of which has a Foreign Key to the table I want to search. I've not as yet setup a reverse relation in the related tables. My question

Re: (3rd party app) How to safely reverse a custom user model admin url?

2013-10-28 Thread Ivan VenOsdel
No takers? Maybe I am giving everyone a case of TL;DR. More simply, how do I put {{ app_label }}_{{ model_name }}_changelist in a template for a custom auth_user model without knowing the details of said model? I am guessing I don't want to refer to settings.auth_user_model in the template. I

What's the difference between assertIn and assertContains?

2013-10-28 Thread Pepsodent Cola
# List word def test_VIEW_Index_WORD_List_word(self): w = self.create_word() url = reverse('navi_polls:index') resp = self.client.get(url) self.assertEqual(resp.status_code, 200) *self.assertIn*(w.rosword, resp.content) # What's the difference betwee

Re: Digging up Django class-based views - 1

2013-10-28 Thread Pepsodent Cola
Thanks Leo! I started out learning Django from the 1.5 tutorial which introduced CBVs but it made parts of the code inconsistent which further confused me as a newbie. Having to keep track of all the new MVC concepts at the same time was confusing for me. On Monday, October 28, 2013 9:01:4

Re: What's the difference between assertIn and assertContains?

2013-10-28 Thread Simon Charette
assertContains performs additional assertion such as the status code of the request and provides a way to perform comparison based on HTML semantic instead of character-by-character equality. Under the hood it also handles streaming and deferred response gracefully. I suggest you take a look at th

Re: Django Tutorials

2013-10-28 Thread Jasvir Singh
On Tue, Oct 29, 2013 at 2:05 AM, Mario R. Osorio wrote: >you should not feel low > confidence for any reason. On the contrary: Had you not received any > comments, THEN you should worry! No, I am not feeling low. As I have already said that typography is on top priority. While wrting these article

Re: (3rd party app) How to safely reverse a custom user model admin url?

2013-10-28 Thread Mike Dewhirst
On 29/10/2013 8:15am, Ivan VenOsdel wrote: More simply, how do I put {{app_label}}_{{model_name}}_changelist in a template for a custom auth_user model without knowing the details of said model? I am guessing I don't want to refer to settings.auth_user_model in the template. It feels like the on

How to Structure Single App Projects

2013-10-28 Thread trojactory
Hi, Whenever I am working on small projects, it seems like an overkill to create an app usually with the same name as the website (and the project's name with a small modification). For instance, if I am creating a project for a small intranet application called Foo. I usually end up with a st