Save as new and files

2009-10-24 Thread Pawel Pilitowski
Hey, Just wondering if "save as new" should also save any files (in this case images) along with everything else? Currently OtherInlines' information gets copied to the saved as new object, but any images associated with the original object are not. models.py: class ProductImage(models.M

Re: Interesting code abstraction Challenge

2009-10-24 Thread Preston Holmes
I think a base class with subclasses is the best approach. Define as much common behavior as possible, set up defaults for those fields needed by your outbound API How are you handling the branching lookup of what subclass to use? You might name the subclasses in some way that they can be derive

Re: Foreign Key Admin UI Error (from a new user)

2009-10-24 Thread David Nolen
Thanks for the reply. The base model just looks like this: class ArtBaseModel(models.Model): created = models.DateTimeField() # models.DateTimeField(editable=False) modified = models.DateTimeField() # models.DateTimeField(editable=False) def save(self): if not self.id:

Re: Replicating Google Groups in Django

2009-10-24 Thread Julien Phalip
Thank you Clifford and all for your tips. There are apparently a few options to explore. I'll give them a shot and see how far I get. Cheers! Julien On Oct 25, 4:35 am, CLIFFORD ILKAY wrote: > Preston Holmes wrote: > > It doesn't seem like it would be that hard to combine django- > > extension

No such table error when using threads

2009-10-24 Thread BlueBird
Hi, I've got a strange behavior. My application is split between a web frontend and a backend which use the DB to exchange tasks and results. The problem is with the backend. It's just a regular program, accessing the DB to fetch tasks, completing them and then storing the result in a DB. The pr

FormSets with different, single, ModelChoice's selected

2009-10-24 Thread ty
Hi All, I have a simple model Node defined as such: class Node(models.Model): name = models.CharField(max_length=255, unique=True) description = models.CharField(max_length=255) active = models.BooleanField(default=True) Now I want to create a formset of this form: class NodeSelect

Re: nginx, apache, and odd admin error

2009-10-24 Thread rd-london
Sorry meant to add. Key sources of information: - http://wiki.nginx.org/NginxHttpProxyModule#proxy_redirect - http://forum.slicehost.com/comments.php?DiscussionID=3065 R On Oct 24, 8:58 pm, rd-london wrote: > Looks like I nailed the reverse proxy arrangement, apologies to all on > this mailin

Re: nginx, apache, and odd admin error

2009-10-24 Thread rd-london
Looks like I nailed the reverse proxy arrangement, apologies to all on this mailing list, this particular issue isn't something specific to Django: - Definitely do not need to configure SetRemoteAddrFromForwardedFor middleware ( http://code.djangoproject.com/browser/django/trunk/django/middlewar

Re: Need Help Migrating to Windows 7 (64-bit), Python 2.6, Django 1.1

2009-10-24 Thread Tim Valenta
I would still raise the warning of caution, that certain external Python libraries do not have 64-bit versions, like PIL. I tried the whole 64-bit Python thing, and I just couldn't do it because of some library dependancies. I also use a setup like yours on Windows 7, except with MySQL, and a 32

SQL syntax error in Admin

2009-10-24 Thread Tim Valenta
If there's nothing I can determine here, I'll move over to submitting a ticket on the matter. Wanted to check in here first. Using... Django 1.2 SVN revision 11653, (updated just 2 minutes ago) MySQL 5.1.31 Models: class Category(models.Model): category = models.CharField() class Question(

Re: Replicating Google Groups in Django

2009-10-24 Thread CLIFFORD ILKAY
Preston Holmes wrote: > It doesn't seem like it would be that hard to combine django- > extensions export_emails command with Mailmans sync_members script > inside a cron job or a URL triggered script. > > Usage: /usr/share/mailman/bin/sync_members [options] -f file listname If users can manage

Re: Need Help Migrating to Windows 7 (64-bit), Python 2.6, Django 1.1

2009-10-24 Thread JimR
Turns out the problem was with PostgreSQL. The prior installation was running 8.3 (not 8.4 as noted). The new installation was using 8.4. Dropping back to 8.3 on the new installation corrected the issue for me. I'm sure there are migration issues to consider moving from 8.3 to 8.4, but I'll lea

Re: Advantages of using ManyToManyField(Bar, through='Foo_Bar') syntax vs not declaring a ManyToManyField at all

2009-10-24 Thread Preston Holmes
The way I think of the value of the "through" table approach is when you want to attach information to the relationship that does not belong on either model. I like a band/musician example. A person can be a part of many bands A band has many people so here we have a classic M2M But a person

Re: Replicating Google Groups in Django

2009-10-24 Thread Preston Holmes
It doesn't seem like it would be that hard to combine django- extensions export_emails command with Mailmans sync_members script inside a cron job or a URL triggered script. Usage: /usr/share/mailman/bin/sync_members [options] -f file listname -Preston On Oct 23, 6:06 am, Julien Phalip wrote:

Problem with conflicting flatpages between vhosts

2009-10-24 Thread Adam Olsen
I've got a problem with flatpages. I've got a single apache instance running mod_python, and two different django sites that it's serving. Both django sites have completely different databases... different database engines even (one is postgres, one is sqlite3), but the flatpages are conflicting.

who using Dajax? it modify the encoding of my data,how to make my data keeping utf-8? thanks.

2009-10-24 Thread hao he
What steps will reproduce the problem? 1.there is a field in the join_request_form。 2.submit the form data like this: Dajax.friends_app_invite({ 'data':$('#join_request_form').formSerialize () }); 3.in the django end. data = QueryDict(request.POST['data']) join_request_form = MultiJoinReq

Re: Interesting code abstraction Challenge

2009-10-24 Thread Jason Beaudoin
Anyone else have thoughts on this, with respect to design considerations, implementing in python versus using some of django's tools.. ? On Fri, Oct 23, 2009 at 8:22 AM, Jason Beaudoin wrote: > 2009/10/23 kmike : >> >> Maybe you don't have enough information to make an abstraction right >> now

Re: Advice on checking optionally installed applications/features

2009-10-24 Thread Ethan Jucovy
On Sat, Oct 24, 2009 at 10:00 AM, Mark (Nosrednakram) < nosrednak...@gmail.com> wrote: > def using_reversion(): >try: >import reversion >return True >except ImportError: >return False >except: >pass > I'd still leave out the `bare except` entirely so ot

Re: Advice on checking optionally installed applications/features

2009-10-24 Thread Mark (Nosrednakram)
Thank you! I made the changes an believe I understand the reasoning for all of your advice. I now have the following in my_stteing.py: from django.conf import settings def using_reversion(): try: import reversion return True except ImportError: return False e

Re: Foreign Key Admin UI Error (from a new user)

2009-10-24 Thread Tom Evans
On Fri, 2009-10-23 at 13:22 -0700, David Nolen wrote: > My admin looks something like the following- > > class TitleInline(admin.TabularInline): > model = Title > extra = 1 > > class WorkAdmin(admin.ModelAdmin): > inlines = [TitleInline] > admin.site.register(Work, WorkAdmin) > > >

Re: nginx, apache, and odd admin error

2009-10-24 Thread Tom Evans
On Fri, 2009-10-23 at 10:05 -0700, rd-london wrote: > > On a slightly separate note - forgetting the reverse proxy arrangment > for a moment, how would one serve admin on a separate port? > > Thanks for any help, > R Can't help with the other bit, but - in apache or nginx? In apache you'd simp

Re: Model design

2009-10-24 Thread Vinicius Mendes | meiocodigo.com
On Oct 24, 7:14 am, Caisys wrote: > Thanks !!! I also felt the second sounds more "right" which leads to > two requirements, the first is for convenience but the second is a > must: > > 1) On the admin page for add Place I will put 2 or 3 slots for adding > Subplace to a place ... is there a wa

Re: Model design

2009-10-24 Thread Caisys
Thanks !!! I also felt the second sounds more "right" which leads to two requirements, the first is for convenience but the second is a must: 1) On the admin page for add Place I will put 2 or 3 slots for adding Subplace to a place ... is there a way where the first one would be filled with "defa

Strange error: Error was: 'module' object has no attribute 'validators'

2009-10-24 Thread Alexey Moskvin
Hi! I'm using dango 0.97 pre (yep, my site still was not upgraded to be compatible with trunk). I use apache + fastcgi for it. And I have a strange problem: sometimes (I can't guess the order) some of the views throw such error: Tried audio_index in module mysite.audio.views. Error was: 'module'

Re: Most effective and stable Django set up on a production server?

2009-10-24 Thread Graham Dumpleton
Apache error logs for the host/virtual host the application is running in normally. Graham On Oct 24, 7:54 pm, DjangoRocks wrote: > hi, > may i know how ( or where ) do i get the  traceback from the error > logs? > > ( i'm kind of a server noob ) > > On Oct 19, 12:47 pm, Graham Dumpleton > wro

Re: Most effective and stable Django set up on a production server?

2009-10-24 Thread DjangoRocks
hi, may i know how ( or where ) do i get the traceback from the error logs? ( i'm kind of a server noob ) On Oct 19, 12:47 pm, Graham Dumpleton wrote: > On Oct 19, 2:23 pm, DjangoRocks wrote: > > > Hi all, > > as per the subject: what is the most effective and stable Django set > > up options

RE: watermark using django-watermark

2009-10-24 Thread DjangoRocks
Hi al, I understand that there is a google code fourm for django-watermark, but i am really trying to get some help here with regards to using django-watermarks Here's what happened: 1. My installation of django-watermark is successful and the issues occurred after i typed in the watermark filte

spaces in urls

2009-10-24 Thread Kenneth Gonsalves
hi, I used to handle spaces in my urls by using [\w\s]+, and it used to work. Now I am getting this error: http://127.0.0.1:8886/message/This%20item%20is%20still%20under%20construction/ not found. latest svn head. -- regards Kenneth Gonsalves Senior Project Officer NRC-FOSS http://nrc