Re: Advice on checking optionally installed applications/features

2009-10-23 Thread Ethan Jucovy
On Fri, Oct 23, 2009 at 1:09 PM, Mark (Nosrednakram) wrote: > > Hello Django Users, > > I sometimes have reversion installed and sometimes have a > CACHE_BACKEND defined and came up with the following solution for > determining if I should register a model or use cache specific > functionality.

Re: Model design

2009-10-23 Thread Léon Dignòn
The second sounds more logically. On 23 Okt., 15:41, chefsmart wrote: > I would go with your second solution. > > On Oct 23, 5:17 pm, Caisys wrote: > > > > > Hi, > > I have classes for Event, Place and Subplace. Some of the Places are > > divided into different Halls (Subplace) and some have on

Re: how to cut and paste image into django app

2009-10-23 Thread Margie Roginski
Wow! Ok, that is cool. There is also a reference down in the comment section about how to do this with a new API that will be coming out in Firefox 3.6. IE, this is without gears: http://www.thecssninja.com/javascript/drag-and-drop-upload This also looks very interesting and the comments in t

django deployment using apache and mod_wsgi

2009-10-23 Thread Dhruv Adhia
I have complete application working on localhost and now I want to deploy that so other of my teammates can use it. I have centos, apache, python 2.5 django 1.1.1 I have my django project at /var/www/html/ipwn/carbon_chaos inside carbon_chaos folder I created apache folder and inside apache fol

Re: how to cut and paste image into django app

2009-10-23 Thread kmike
No, my code doesn't do that, sorry for not expressing this clear. Here is the example of drag-n-drop images upload: http://www.appelsiini.net/2009/10/drag-and-drop-file-upload-with-google-gears And here is the corresponding API documentation: http://code.google.com/intl/ru/apis/gears/api_deskt

Re: how to cut and paste image into django app

2009-10-23 Thread Margie Roginski
Thanks everyone for all of your comments - I've been off looking at these various choices, learning a bit about java/flash this morning. I was not able to get http://www.radinks.com/upload/dnd.php to work. It seems that even with the demo I have access privilege issues. Ariel, when you run the dem

Foreign Key Admin UI Error (from a new user)

2009-10-23 Thread David Nolen
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) My models look something like this- class Work(ArtBaseModel): def __unic

Definitive solution for foreignkey filtering in Admin

2009-10-23 Thread Tim Valenta
I've been searching for a while on how to intercept querysets in forms, to apply a custom filter to the choices on both foreignkey and m2m widgets. I'm surprised at how there are so many similar questions out there, dating back to 2006. I came across the documentation for ModelAdmin.formfield_fo

Re: Replicating Google Groups in Django

2009-10-23 Thread CLIFFORD ILKAY
Lakshman Prasad wrote: > You should use the lamson project, by Zed Shaw: http://lamsonproject.org/ Hello Lakshman, Unless Lamson has years of development behind it and does all the things that Mailman does "out of the box", it's not a replacement for Mailman. It would have to implement all the

Re: Replicating Google Groups in Django

2009-10-23 Thread CLIFFORD ILKAY
Julien Phalip wrote: > Hi, > > On one site I'm considering the possibility of replicating the (basic) > functionality of Google Groups in Django. The idea is: > > - There would be 5 different mailing lists. Users can subscribe to one > or more lists. > - People can purely use emails to access th

Re: how to cut and paste image into django app

2009-10-23 Thread Javier Guerra
On Fri, Oct 23, 2009 at 1:29 PM, Ariel Nunez wrote: > I found this while googling: "drag and drop upload": > > http://www.radinks.com/upload/dnd.php > > Seems to use a combination of Java (applet) + PHP (server) and is not > open source. i tried this one several years ago. unfortunately, can't

Re: how to cut and paste image into django app

2009-10-23 Thread kmike
Google Gears can also be used in order to implement drag-n-drop image uploading. I beleive it is the easiest way because it only involves some javascript programming. You can also do other nice things with Google Gears (resize images client-side, for example; check http://bitbucket.org/kmike/gear

Re: how to cut and paste image into django app

2009-10-23 Thread Ariel Nunez
Hi Margie, I found this while googling: "drag and drop upload": http://www.radinks.com/upload/dnd.php Seems to use a combination of Java (applet) + PHP (server) and is not open source. But it seems to prove it is possible. Just perhaps not with simple HTML + JS. Regards, Ariel. On Oct 2

convert passing tests to beautiful test report?

2009-10-23 Thread Phlip
Djangoists: Given a bunch of unittests, how to convert them to some kind of literate or doc-stringed report? The goal is to show off all our tests! -- Phlip http://c2.com/cgi/wiki?ZeekLand --~--~-~--~~~---~--~~ You received this message because you are subs

setting 'choices' on a custom field

2009-10-23 Thread fink
problem: setting a form field's 'choices' in the __init__ of a field class does not affect the choices displayed in the resulting form. i suspect the problem lies somewhere in the custom field's handling of passed in values, but my form-fu is not strong enough to figure it out. for example, the

Advice on checking optionally installed applications/features

2009-10-23 Thread Mark (Nosrednakram)
Hello Django Users, I sometimes have reversion installed and sometimes have a CACHE_BACKEND defined and came up with the following solution for determining if I should register a model or use cache specific functionality. Since I'm not a Python Guru I'm asking an evaluation of this method before

Re: nginx, apache, and odd admin error

2009-10-23 Thread rd-london
Right, well, replying to myself ... and hoping someone else will jump in, here's where I'm upto ... Having read around a bit, I figured that the reverse proxy my well be losing the original IP address, so I looked into configuring "SetRemoteAddrFromForwardedFor" (http://code.djangoproject.com/bro

Re: Url params with space

2009-10-23 Thread Andrius A
Hi Sumanth, Yes we do. Use urlib.unquote_plus() Regards, Andrius On 23 Oct 2009 17:14, "Sumanth" wrote: Hi All, I have url as show below http://localhost:8000/view/1/1/?scenario=Base,%20Credit now when I do a request.REQUEST['scenario'] I see a value of 'Base,+Credit' I get char + instea

Appropriate decorator for use with database-level autocommit

2009-10-23 Thread Christophe Pettus
For a new project, I'm planning to use the database-level autocommit functionality for Postgres as described in: http://docs.djangoproject.com/en/dev/ref/databases/#ref-databases For view functions that do database modification, I'll wrap them in the appropriate start/end transaction

Url params with space

2009-10-23 Thread Sumanth
Hi All, I have url as show below http://localhost:8000/view/1/1/?scenario=Base,%20Credit now when I do a request.REQUEST['scenario'] I see a value of 'Base,+Credit' I get char + instead of space How do I retain space char ? Do we have a any functions or module which will return correct url e

Re: problem with test client

2009-10-23 Thread Ralph
Thanks! That was the missing piece. --~--~-~--~~~---~--~~ 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 t

An app that can provide user friendly, multiple / mass file upload functionality to other apps

2009-10-23 Thread Michiel
Hi, I want to create an app that makes it easy to do user friendly, multiple / mass file upload in your own apps. With user friendly I mean upload like Gmail, Flickr, ... where the user can select multiple files at once in the browse file dialog. The files are then uploaded sequentially or in par

Re: problem with test client

2009-10-23 Thread Daniel Roseman
On Oct 23, 4:16 pm, Ralph wrote: > I am using Django 1.1 with Python 2.6.1 and have a problem with > testing > views that require a login. I was hoping someone could enlighten me > were > it all goes wrong > > in the setup function of a unit test i am adding a user and create a > test client

problem with test client

2009-10-23 Thread Ralph
I am using Django 1.1 with Python 2.6.1 and have a problem with testing views that require a login. I was hoping someone could enlighten me were it all goes wrong in the setup function of a unit test i am adding a user and create a test client User.objects.create(username='myuser', password=

Re: Django basic tests are failing

2009-10-23 Thread jamesM
solved by changing the default collation of mysql server from utf8_bin to utf8_general_ci. in case you encounter something similar, do change db backend to sqlite3 and then rerun the test, if the tests pass - there's a problem with database server. j On Oct 23, 1:50 pm, jamesM wrote: > This ap

Re: how to cut and paste image into django app

2009-10-23 Thread Javier Guerra
On Thu, Oct 22, 2009 at 11:54 PM, Margie Roginski wrote: >  They want to use > an windows app called mwsnap to basically snap images from their > desktop, then ctrl-v to copy the image into my django app. is there any web app that does this? AFAICT, all use some upload button (maybe augmented w

Re: More than one stackedinline in admin

2009-10-23 Thread Karen Tracey
On Fri, Oct 23, 2009 at 8:24 AM, Caisys wrote: > > I tried: > > class child1Inline(admin.StackedInline): >model = child1 >extra = 2 > > class child2Inline(admin.StackedInline): >model = child2 >extra = 2 > > class child1Admin(admin.ModelAdm

Re: Replicating Google Groups in Django

2009-10-23 Thread Lakshman Prasad
You should use the lamson project, by Zed Shaw: http://lamsonproject.org/ On Fri, Oct 23, 2009 at 6:36 PM, Julien Phalip wrote: > > Hi, > > On one site I'm considering the possibility of replicating the (basic) > functionality of Google Groups in Django. The idea is: > > - There would be 5 diffe

Connecting to multiple db masters

2009-10-23 Thread dave
I've encountered the multiple database issue but with a twist. I want to propagate data across a dual master Oracle database setup which seems to be a little different topic than the online discussions I've seen. In order to do this I want to pass the url for both domains to Oracle as the connec

Re: Model design

2009-10-23 Thread chefsmart
I would go with your second solution. On Oct 23, 5:17 pm, Caisys wrote: > Hi, > I have classes for Event, Place and Subplace. Some of the Places are > divided into different Halls (Subplace) and some have only one. I > would like to know how design the relations between the classes. > > 1) Shoul

Re: Passing Parameter to form in inlineformset_factory

2009-10-23 Thread chefsmart
This is coming off untested, but with a couple of tweaks it should work. Try creating a dynamic class. In your views.py, do something like this: - def make_my_form(readonly): class MyForm(forms.ModelForm): def __init__(self, *args, **kwargs): if readOnly: Do stuf

Replicating Google Groups in Django

2009-10-23 Thread Julien Phalip
Hi, On one site I'm considering the possibility of replicating the (basic) functionality of Google Groups in Django. The idea is: - There would be 5 different mailing lists. Users can subscribe to one or more lists. - People can purely use emails to access the lists. - All the emails can then al

Re: Passing Parameter to form in inlineformset_factory

2009-10-23 Thread pjrhar...@gmail.com
Try using a lambda function. The problem is that the factory wants a callable that creates a form, not a form instance (ie it wants to be able to execute MyForm() for each form in the formset. Formset = inlineformset_factory(ModelA, ModelB form=lambda: MyForm (readOnly=True)) Note I've not tried

Re: More than one stackedinline in admin

2009-10-23 Thread Caisys
I tried: class child1Inline(admin.StackedInline): model = child1 extra = 2 class child2Inline(admin.StackedInline): model = child2 extra = 2 class child1Admin(admin.ModelAdmin): inlines = [child1Inline] class child2Admin(admin.Mod

Re: Interesting code abstraction Challenge

2009-10-23 Thread Jason Beaudoin
2009/10/23 kmike : > > Maybe you don't have enough information to make an abstraction right > now. If so I suggest to actually implement several API's in a dumb > way. After that it'll be clear what are the differences and what are > the common parts so making a good abstraction will be easier. I

Model design

2009-10-23 Thread Caisys
Hi, I have classes for Event, Place and Subplace. Some of the Places are divided into different Halls (Subplace) and some have only one. I would like to know how design the relations between the classes. 1) Should I put two columns in the Event one FK to Place and another FK to Hall? 2) Should I

Underscores in PKs

2009-10-23 Thread Eugene Mirotin
I have an application working with legacy DB. Some tables have humen-redable PKs, and some of them contain underscores. Django admin escapes them (for what reason?) and seems not unescaping. So these objects are unavailable for editing. The relevant bug (2 years old!) is here: http://code.djangopr

Re: Django basic tests are failing

2009-10-23 Thread jamesM
This apparently is my bad, i've just created an empty project, and all the tests of it pass. Am working on tracking down the problem. On Oct 23, 1:29 pm, jamesM wrote: > Hi guys, > > i've decided to practice some test-driven development with django and > bumped into some small problems. > No ide

Django basic tests are failing

2009-10-23 Thread jamesM
Hi guys, i've decided to practice some test-driven development with django and bumped into some small problems. No idea is this a bug or my bad, but after running python manage.py test i get the two tests which fail (error below). Both of them expects unicode value, but receives a simple string.

Re: Caching performance regression between django 1.0 and django 1.1.1

2009-10-23 Thread mt
On Oct 22, 1:46 pm, Russell Keith-Magee wrote: > On Thu, Oct 22, 2009 at 4:38 PM, mt wrote: > > > On Oct 19, 1:08 pm, Russell Keith-Magee > > wrote: > >> On Mon, Oct 19, 2009 at 6:52 PM, mt wrote: > > >> > Hi All, > >> > I recently upgraded a high traffic site from django 1.0 to django > >>

Re: Design decision

2009-10-23 Thread Léon Dignòn
callerlist will MAYBE use a database of another program (not django), or it uses a database of another django application. This is optional and I want callerlist to work with or without. For that i decided to create an application customerlist and develop a model Customer and an optional interface

Re: Interesting code abstraction Challenge

2009-10-23 Thread kmike
Maybe you don't have enough information to make an abstraction right now. If so I suggest to actually implement several API's in a dumb way. After that it'll be clear what are the differences and what are the common parts so making a good abstraction will be easier. On 23 окт, 11:06, Jason Beaudo

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

2009-10-23 Thread Monika Sulik
Thanks :) On Oct 22, 5:52 pm, Tom Evans wrote: > On Thu, 2009-10-22 at 07:57 -0700, Monika Sulik wrote: > > Hi, > > > I was wondering what exactly are the advantages of having code like > > this: > > > class Foo (models.Model): > >     bar_m2m = models.ManyToManyField(Bar,through='Foo_Bar') > >

Re: Queryset inspection in models.Manager not possible without breaking

2009-10-23 Thread Gerard
Matias, Thanx for your response. After having decided, for research sake, to apply the security in my views and see what the impact is I get run down on way to many places. All the great intelligence that Django has starts to get useless in my setup. E.g. when auto populating dropdown lists in

Re: Queryset inspection in models.Manager not possible without breaking

2009-10-23 Thread Matías Costa
On Fri, Oct 23, 2009 at 9:25 AM, Gerard wrote: > > Hi All, > > I'm trying to find a way to filter on a certain field (myowner) in my views. > If the field in the returned queryset is not unique then raise an exception. > The code in my manager: > > class UserFilteredManager(models.Manager): > >  

Queryset inspection in models.Manager not possible without breaking

2009-10-23 Thread Gerard
Hi All, I'm trying to find a way to filter on a certain field (myowner) in my views. If the field in the returned queryset is not unique then raise an exception. The code in my manager: class UserFilteredManager(models.Manager): def get_query_set(self): FullQuerySet = super(User