Re: Using gedit for django development

2011-09-13 Thread Tundebabzy
I'm submit this on Hacker News On Sep 13, 1:35 am, Mario Gudelj wrote: > This is awesome dude. I was looking for something like this since I moved to > Ubuntu. > > On 13 September 2011 10:12, Micah Carrick wrote: > > > > > > > > > I've written a blog post on using gedit, the default text editor

Re: Newbie problem installing Django

2011-09-13 Thread Karen Tracey
I suspect the problem is using WinZip to try to unzip the tarball. Other users on this list have reported the same issue in the past. It seems that at least some versions of WinZip fail to extract 0-byte files from the archive file. This is a major problem for any type of Python source project sinc

Generic relation content_type does not exist

2011-09-13 Thread Bastian Ballmann
Hi all django lovers, I've got the problem that I want to check a model using the clean() method on the model class. My model has a generic relationship and i have to access the content_type property within the clean() method to get the job done. Now content_type is _sometimes_ defined and s

Re: Using gedit for django development

2011-09-13 Thread Cal Leeming [Simplicity Media Ltd]
That's pretty nice, didn't realise gedit could be so pretty! On Tue, Sep 13, 2011 at 1:12 AM, Micah Carrick wrote: > I've written a blog post on using gedit, the default text editor in GNOME, > as a Django IDE. If you're a Linux user and you've never considered using > gedit for development then

Re: Using gedit for django development

2011-09-13 Thread Thomas Weholt
Very nice. Did some work on making a plug-in for the Editra editor with the same goal but your project looks much better, Thanks! Thomas On Tue, Sep 13, 2011 at 2:12 AM, Micah Carrick wrote: > I've written a blog post on using gedit, the default text editor in GNOME, > as a Django IDE. If you're

Create/update/delete generic views

2011-09-13 Thread David
Hello This is my code so far from urls.py from django.views.generic import ListView, create_update url(r'^reportwriting/types/edit/(?P\d+)/?$', create_update.update_object( model=Type )), I am trying to use the new CRUD generic views but am repeatedly getting the followi

Re: django form radio input layout

2011-09-13 Thread NateB
Hello again, So, as I said in the email below, the answer I got to my "iterating radio input" question worked, but was a tad brittle (and having looked at a bunch of ways to solve this, it seemed to be more or less the best answer at the time). After having a great deal of trouble maintaining th

Re: Create/update/delete generic views

2011-09-13 Thread Daniel Roseman
On Tuesday, 13 September 2011 12:40:59 UTC+1, David wrote: > > Hello > > This is my code so far from urls.py > > from django.views.generic import ListView, create_update > > url(r'^reportwriting/types/edit/(?P\d+)/?$', > create_update.update_object( > model=Type > )),

Email settings to use localhost's email

2011-09-13 Thread Christos Jonathan Hayward
I have a Pinax social project that earlier was holding emails as rejected (they came from webmaster@localhost), and near the beginning of settings.py added: DEFAULT_FROM_EMAIL = 'Orthodox Network ' EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_USE_TLS = True EMAIL_HOST = 'mai

Re: Create/update/delete generic views

2011-09-13 Thread David
Hi Daniel That is very helpful and I have it working now. Is there a way to have my success_url go to my ListView class-based view as it isn't named? url(r'^reportwriting/types/$', ListView.as_view( model=Type, paginate_by=2 )), url(r'^reportwriting/types/edit/(?P\d+)/?$',

Re: Create/update/delete generic views

2011-09-13 Thread David
Or alternatively to redirect to the update form that has just been submitted. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to djan

Re: Create/update/delete generic views

2011-09-13 Thread David
Got it url(r'^reportwriting/types/$', ListView.as_view( model=Type, paginate_by=2 )), url(r'^reportwriting/types/edit/(?P\d+)/?$', UpdateView.as_view( model=Type, success_url='/reportwriting/types/' )), or url(r'^reportwriting/types/$', Lis

Re: Using gedit for django development

2011-09-13 Thread Andre Terra
Incredible! I'll have to take a look at this over the weekend. Have you given any thought to wrapping hyperlinks around modules, classes and functions for easier browsing? This is the #1 (okay, maybe the only) reason I use Aptana. Cheers, AT On Tue, Sep 13, 2011 at 7:33 AM, Thomas Weholt wrote:

Re: Using gedit for django development

2011-09-13 Thread Marc Aymerich
2 On Tue, Sep 13, 2011 at 2:12 AM, Micah Carrick wrote: > I've written a blog post on using gedit, the default text editor in GNOME, > as a Django IDE. If you're a Linux user and you've never considered using > gedit for development then this may be an interesting read for you. > > http://www.mi

Re: Norwegian Sorting

2011-09-13 Thread Tim Sawyer
> On Fri, Sep 9, 2011 at 10:18 PM, Tim Sawyer > wrote: >> Hi Folks, >> >> I have a django site which is against a postgres database which is UTF8. >>  I >> have a large droplist with international names in, and it doesn't appear >> to >> be sorting correctly. >> >> The list contains Ingvar Mæland

Custom modelformset returns empty list.

2011-09-13 Thread I159
I'm writing the custom modelformset. I need that forms to be sorted by value of field "ordering". I overloaded __iter__ and __getitem__ methods of BaseFormSet in my child formset class. *My code:* class SortedCatForms(BaseFormSet): def __iter__(self): print '__iter__' retu

Re: Using gedit for django development

2011-09-13 Thread Babatunde Akinyanmi
Oops! *i'll submit :D On 9/13/11, Tundebabzy wrote: > I'm submit this on Hacker News > > On Sep 13, 1:35 am, Mario Gudelj wrote: >> This is awesome dude. I was looking for something like this since I moved >> to >> Ubuntu. >> >> On 13 September 2011 10:12, Micah Carrick wrote: >> >> >> >> >> >>

Is there a way to provide a delete-hook on a custom field?

2011-09-13 Thread Jeff Heard
I have a custom field class that very nicely references a document in MongoDB, but I would like to have the document deleted if the record is deleted. That is, I have a MongoDBField that stores an object ID in a structured database using the regular Django ORM. The field back-references to the re

form success_url redirect to previous paginated page

2011-09-13 Thread David
This is my template: {% block content %} Report Writing Types {% for type in object_list %} {{ type.name }} Edit {% endfor %} {% if page_obj.has_previous %} previous {% endif %} Page {{ page_obj.numb

Re: Is there a way to provide a delete-hook on a custom field?

2011-09-13 Thread Jeff Heard
Thanks. That works! -- Jeff On Tue, Sep 13, 2011 at 11:13 AM, Shawn Milochik wrote: > You can use the post_delete signal in Django's signals. Then, assuming your > MongoDB collection name is derived from your model in a consistent manner > then you're all set. > > -- > You received this message

Re: Is there a way to provide a delete-hook on a custom field?

2011-09-13 Thread Shawn Milochik
You can use the post_delete signal in Django's signals. Then, assuming your MongoDB collection name is derived from your model in a consistent manner then you're all set. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: Newbie problem installing Django

2011-09-13 Thread fasteddie
Karen, Thank you very much. I will try to get another extractor and see if that fixes the problem. Ed Porter On Sep 12, 9:37 pm, Karen Tracey wrote: > I suspect the problem is using WinZip to try to unzip the tarball. Other > users on this list have reported the same issue in the past. It seems

installing django

2011-09-13 Thread re64
I am having trouble installing django. I cant seem to do it any suggestions -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to djang

Re: installing django

2011-09-13 Thread Shawn Milochik
On 09/13/2011 01:21 PM, re64 wrote: I am having trouble installing django. I cant seem to do it any suggestions https://code.djangoproject.com/wiki/UsingTheMailingList Pay special attention to the 'Prepare the Question' section. -- You received this message because you are subscribed to th

Re: Norwegian Sorting

2011-09-13 Thread Tom Evans
On Fri, Sep 9, 2011 at 10:18 PM, Tim Sawyer wrote: > Hi Folks, > > I have a django site which is against a postgres database which is UTF8.  I > have a large droplist with international names in, and it doesn't appear to > be sorting correctly. > > The list contains Ingvar Mæland and Børre Børrese

Re: installing django

2011-09-13 Thread Steven Elliott Jr
What exactly is the problem? Can you provide more detail? Platform, error messages, python version? What have you tried already? On Sep 13, 2011, at 1:21 PM, re64 wrote: > I am having trouble installing django. I cant seem to do it any > suggestions > > -- > You received this message becaus

Re: installing django

2011-09-13 Thread Babatunde Akinyanmi
You could at least try to be more specific On 9/13/11, re64 wrote: > I am having trouble installing django. I cant seem to do it any > suggestions > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to

setting the database when using a rawqueryset

2011-09-13 Thread Robert
I have inherited the support of a Django application and am new to the language so I would appreciate some advice. The application requires getting data from different databases depending on the client. The existing code uses the syntax: .objects.using(self.CLIENT_DB).get to connect to the corr

problem with "\"

2011-09-13 Thread Jonatas Emidio
First of all, so i'm sorry because i'm a python begginer and this is not a django project. I have a script.py that needs to use windows directories! How can i use split('\')? exemple: word = 'a\b\c\d' list_w = word.split('\') Thanks for any assistance! -- You received this message because y

Re: problem with "\"

2011-09-13 Thread Shawn Milochik
Better to use os.sep. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options,

Re: setting the database when using a rawqueryset

2011-09-13 Thread Andre Terra
Not exactly what you want, but https://docs.djangoproject.com/en/dev/topics/db/sql/#executing-custom-sql-directly Cheers, AT On Tue, Sep 13, 2011 at 5:51 PM, Robert wrote: > > I have inherited the support of a Django application and am new to the > language so I would appreciate some advice.

Re: problem with "\"

2011-09-13 Thread Jonatas Emidio
Thanks!! i tried but it's not working very well.. look... This code: import os a = 'a\b\c\d' print a.split(os.sep) Show me this messagem: ['a\x08','c','d'] My problem: I need to avoid or change some comands with "\" On 13 set, 17:57, Shawn Milochik wrote: > Better to use os.sep. -- You re

Re: problem with "\"

2011-09-13 Thread Karen Tracey
On Tue, Sep 13, 2011 at 4:52 PM, Jonatas Emidio wrote: > First of all, so i'm sorry because i'm a python begginer and this is > not a django project. > If your question has nothing to do with Django then please do not ask it here. There is a python list that would be far more appropriate: http://

Re: problem with "\"

2011-09-13 Thread Shawn Milochik
This is a Python question, not a Django issue. Check out the python-list group: http://mail.python.org/mailman/listinfo/python-list Also, split is working. You just have a non-ASCII character in your data. Please follow up on the Python list, as this is off-topic for this group. -- You rece

Re: problem with "\"

2011-09-13 Thread Jonatas Emidio de Souza
Hello Karen! Yes, but i'm alread sent to anothers python groups! This is for find answer more fast! Thanks for your atention and this another python group! 2011/9/13 Karen Tracey > On Tue, Sep 13, 2011 at 4:52 PM, Jonatas Emidio > wrote: > >> First of all, so i'm sorry because i'm a python beg

Re: problem with "\"

2011-09-13 Thread Jonatas Emidio de Souza
Shawn!!! that's truth os.sep works!! Thank A lot! 2011/9/13 Jonatas Emidio de Souza > Hello Karen! > Yes, but i'm alread sent to anothers python groups! This is for find answer > more fast! > Thanks for your atention and this another python group! > > > 2011/9/13 Karen Tracey > >> On Tue, Sep 1

Re: setting the database when using a rawqueryset

2011-09-13 Thread Robert
Thanks, AT. Actually this is the article where I learned how to do raw SQL in Django. It made life easy for complex queries. Unfortunately it does not specify how to dynamically set the database for the RawQuerySet. I am hoping there is an easy way to do it so I can avoid a complete rewrite. Th

Re: setting the database when using a rawqueryset

2011-09-13 Thread Robert
I apologize for using AT rather than your name, Andre. On Sep 13, 6:42 pm, Robert wrote: > Thanks, AT.  Actually this is the article where I learned how to do > raw SQL in Django. It made life easy for complex queries. > Unfortunately it does not specify how to dynamically set the database > for

Admin - delete with removing FK objects

2011-09-13 Thread galgal
I have 2 models class Article(models.Model): active = models.BooleanField(default=False, db_index=True) title = models.CharField(max_length=150) class ArticleGallery(models.Model): article = models.ForeignKey(Article) image = models.ImageField(upload_to=settings.ARTICLE_GALLE

Re: Alter the list of fields returned by a queryset without turning them into strings?

2011-09-13 Thread Joshua Russo
So, how I actually solved it was even a bit different: Document.objects.filter(documentType=1, event__eventType=1).annotate(Max('event__start_date')).order_by('event__start_date__max') I had to use the Max function because the relationship is actually a many to many. Even if it was just a stand

Re: Alter the list of fields returned by a queryset without turning them into strings?

2011-09-13 Thread Joshua Russo
I had previously typed (but obviously not sent) a thank you ... so, thank you. That was what I was looking for and did lead me to my ultimate solution. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit h

Re: order by + group by

2011-09-13 Thread Peter of the Norse
What are you trying to do? The outer GROUP BY destroys the inner ORDER BY. Try putting them on the same level and see what happens. On Sep 11, 2011, at 3:41 AM, Jonas H. wrote: > Hi! > > How can I express this SQL query > > SELECT ... FROM ( >SELECT ... FROM ... > ) > > in the ORM? Spec

Re: Admin - delete with removing FK objects

2011-09-13 Thread Jani Tiainen
14.9.2011 2:52, galgal kirjoitti: I have 2 models class Article(models.Model): active = models.BooleanField(default=False, db_index=True) title = models.CharField(max_length=150) class ArticleGallery(models.Model): article = models.ForeignKey(Article)