Re: Timeout for URLField?

2008-06-28 Thread Marcelo Ramos
2008/6/26 jabbercat <[EMAIL PROTECTED]>: > > Hello, > > does somebody know if there is a possibility to specify a timeout for > the URLField? I'm just using a URLField, but if the URL is not correct > the URLField needs a lot of time to response with an error. > > No. Django's builtin validators h

Bug with unique_together on mod_wsgi?

2008-06-28 Thread Julien
Hi, Since I switched my site from mod_python to mod_wsgi, the meta attribute 'unique_together' stopped working properly. When creating a duplicate entry, instead of getting the error message "Entry with this date already exists for the given slug." I get an exception: "MultipleObjectsReturned: g

Re: [Fwd: Custom field in JSON serializer]

2008-06-28 Thread Malcolm Tredinnick
On Sun, 2008-06-29 at 06:45 +0530, M.Ganesh wrote: [...] > Can I use the existing serializer with a list? If yes may be I can > construct the list by hand and then serialize. The list will have less > than 10 entries only Django's serializer is for serializing models (or querysets). However, s

Re: [Fwd: Custom field in JSON serializer]

2008-06-28 Thread M.Ganesh
Russell Keith-Magee wrote: > On Sat, Jun 28, 2008 at 6:03 PM, M.Ganesh <[EMAIL PROTECTED]> wrote: > >> people who asked after me got their answers, sometimes >> within 15 minutes. I've not got any answers >> > > Don't worry - we still love you. :-) > > >> How do I extend this to d

Re: ModelInheritance : how to do isinstance() on a parent class object

2008-06-28 Thread Malcolm Tredinnick
On Sat, 2008-06-28 at 17:55 -0700, [EMAIL PROTECTED] wrote: > I agree, having the ORM create O(n) table joins by default would be a > bad idea, but I wonder if we could provide an option to have it do > that. You can do whatever you like in your models. I don't think it should be part of the cor

Re: ModelInheritance : how to do isinstance() on a parent class object

2008-06-28 Thread [EMAIL PROTECTED]
I agree, having the ORM create O(n) table joins by default would be a bad idea, but I wonder if we could provide an option to have it do that. On Jun 28, 7:49 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2008-06-28 at 17:29 -0700, [EMAIL PROTECTED] wrote: > > Malcolm, does select_r

Re: ModelInheritance : how to do isinstance() on a parent class object

2008-06-28 Thread Malcolm Tredinnick
On Sat, 2008-06-28 at 17:29 -0700, [EMAIL PROTECTED] wrote: > Malcolm, does select_related work with 1-to-1's (and thus would do the > preloading)? No, it doesn't. You still have the O(n) table join problem, since it needs to query every single descendent table to find the right rows. Don't just

Re: ModelInheritance : how to do isinstance() on a parent class object

2008-06-28 Thread [EMAIL PROTECTED]
Malcolm, does select_related work with 1-to-1's (and thus would do the preloading)? On Jun 28, 6:34 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2008-06-28 at 16:29 -0700, Julien wrote: > > Hi, > > > You could try: > > > if hasattr(c, 'company') > >     # This is a company > > else

Re: checking for decorators or view meta properties

2008-06-28 Thread Julien
Hi, I'm not sure if I have see exactly what you mean by annotation in this context, but Python allows to add attribute dynamically to any object including functions. So, you could do like this: def my_view(request): ... my_view.some_annotation = 'bla' On Jun 29, 3:30 am, Leo Shklovskii <[

Re: ModelInheritance : how to do isinstance() on a parent class object

2008-06-28 Thread Malcolm Tredinnick
On Sat, 2008-06-28 at 16:29 -0700, Julien wrote: > Hi, > > You could try: > > if hasattr(c, 'company') > # This is a company > else: > # This is a person That will still cause a database lookup (possibly two, if the model isn't a company). This is because there's no way to know which i

Re: html and TextField

2008-06-28 Thread Malcolm Tredinnick
On Sat, 2008-06-28 at 18:05 -0500, Greg Lindstrom wrote: > I would like to store text with html markup in a table to be displayed > to the screen. When I created a TextField and placed html markup in > it, all of the tags were escaped automatically. It there a setting to > turn this off (I didn

Re: ModelInheritance : how to do isinstance() on a parent class object

2008-06-28 Thread Julien
Hi, You could try: if hasattr(c, 'company') # This is a company else: # This is a person Julien On Jun 29, 6:23 am, felix <[EMAIL PROTECTED]> wrote: > Contact > Company(Contact) > Person(Contact) > > If I have a Contact it might be a Person or a Company and I'm looking > for the best w

Re: ModelInheritance : how to do isinstance() on a parent class object

2008-06-28 Thread Malcolm Tredinnick
On Sat, 2008-06-28 at 13:23 -0700, felix wrote: > > Contact > Company(Contact) > Person(Contact) > > If I have a Contact it might be a Person or a Company and I'm looking > for the best way to find out. > Especially in cases where I'm listing these objects, doing a separate > trial and error da

html and TextField

2008-06-28 Thread Greg Lindstrom
I would like to store text with html markup in a table to be displayed to the screen. When I created a TextField and placed html markup in it, all of the tags were escaped automatically. It there a setting to turn this off (I didn't see it in the online documentation), or is there another field

Re: Encoding issue. Weird characters showing up.

2008-06-28 Thread jwpeddle
You were correct, it was an issue of the shell I entered the character with. Going into the Django admin section and saving it again stored the correct character. Thanks! On Jun 28, 12:03 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2008-06-27 at 05:17 -0700,jwpeddlewrote: > > I'm

ModelInheritance : how to do isinstance() on a parent class object

2008-06-28 Thread felix
Contact Company(Contact) Person(Contact) If I have a Contact it might be a Person or a Company and I'm looking for the best way to find out. Especially in cases where I'm listing these objects, doing a separate trial and error database query (as I show below) isn't the best solution. Actually i

checking for decorators or view meta properties

2008-06-28 Thread Leo Shklovskii
I'd like to write some code that modifies a page depending on whether the view that generated it requires login or not. Right now all such views are decorated with @login_required. My initial thoughts on how to do this (coming from java) would be to slap an annotation on the views that are sec

Re: django-filebrowser

2008-06-28 Thread Daniel Roseman
On Jun 28, 5:24 pm, Mario <[EMAIL PROTECTED]> wrote: > Hi, all! > > I'll try to install file browser application (http://code.google.com/p/ > django-filebrowser/) in my project and had some problems: > - Could not import filebrowser.views. Error was: cannot import name > ugettext > - Could not imp

django-filebrowser

2008-06-28 Thread Mario
Hi, all! I'll try to install file browser application (http://code.google.com/p/ django-filebrowser/) in my project and had some problems: - Could not import filebrowser.views. Error was: cannot import name ugettext - Could not import filebrowser.views. Error was: No module named safestring and s

Re: Displaying in template ManyToMany

2008-06-28 Thread dxLogan
It's working now, such simple syntax. =) Thank you very much for your help, I've been unable to find that command. On Jun 28, 3:39 pm, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Jun 28, 5:35 am, dxLogan <[EMAIL PROTECTED]> wrote: > > > > > Hi all, > > > I am a new user to Django. It's great

Re: Problems retrieving array from POST

2008-06-28 Thread elspiko
Thanks to everyone whose helped, I've finally got it doing what I want. I've ended up with the following(for those interested: $.post("/post_test/",{'data':data}); view: post_text = request.POST.getlist('data') . Thanks again --~--~-~--~~~---~--~~ You rec

Re: error on manipulator fields

2008-06-28 Thread cwurld
I tried the newforms-admin branch - it did not solve the problem. I am now back to revision 7776 of the trunk. I think the problem is in the documentation. It seems like you must add a "get_manipulator_field_objs" method to your customized class. For example, I added: def get_manipulator_field_o

Re: User Filtering

2008-06-28 Thread TiNo
You could take a look at jQuery (http://jquery.com/), and for example this jQuery plugin: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ On Jun 27, 3:36 pm, "M.Ganesh" <[EMAIL PROTECTED]> wrote: > TiNo wrote: > > Maybe even nicer, a selectbox containing all users, and an input t

Re: help request using python_twitter api with django and errno 25

2008-06-28 Thread Hani
Hi James, Thanks. Perfect response and very helpful. Greatly appreciate it. Hani On Jun 28, 1:03 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Fri, Jun 27, 2008 at 11:02 PM, Hani <[EMAIL PROTECTED]> wrote: > > My questions are: > > 1. can anyone explain the error a little better to me? >

Re: Django Apps

2008-06-28 Thread Russell Keith-Magee
On Sat, Jun 28, 2008 at 5:58 PM, keegan3d <[EMAIL PROTECTED]> wrote: > > Hey guys, > > I am new to Django and was wondering if there are any good places to > get Django apps like wikis, blogs, etc? http://djangoplugables.com/ Yours, Russ Magee %-) --~--~-~--~~~---~--

Re: [Fwd: Custom field in JSON serializer]

2008-06-28 Thread Russell Keith-Magee
On Sat, Jun 28, 2008 at 6:03 PM, M.Ganesh <[EMAIL PROTECTED]> wrote: > > people who asked after me got their answers, sometimes > within 15 minutes. I've not got any answers Don't worry - we still love you. :-) > How do I extend this to do the following: > > data = serializers.serialize('x

Re: [Fwd: Custom field in JSON serializer]

2008-06-28 Thread Will Larson
Ganesh, You'll need to create your own serializer. You can do this by subclassing django.core.serializers.base (or perhaps you might subclass the json one, there are a number of ways to skin the cat here), and then registering it with django.core.serializers.register_serializer, which is

Re: Django Apps

2008-06-28 Thread Eric Abrahamsen
You can try google code projects: http://code.google.com/hosting/search?q=django&btn=Search+Projects many of the most often-used public apps are hosted there. There's also http://djangosearch.com, though I haven't used that much... Happy hunting, E On Jun 28, 2008, at 5:58 PM, keegan3d wrote:

Re: python strings containing backslashes

2008-06-28 Thread Jarred Bishop
Haha. so obvious. Thanks Malcolm On Jun 28, 9:25 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2008-06-28 at 01:17 -0700, Jarred Bishop wrote: > > hello, I'm trying to get the index of the last backslash from a string > > in python. > > > The problem I have is that the backslash bef

Django Apps

2008-06-28 Thread keegan3d
Hey guys, I am new to Django and was wondering if there are any good places to get Django apps like wikis, blogs, etc? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

[Fwd: Custom field in JSON serializer]

2008-06-28 Thread M.Ganesh
people who asked after me got their answers, sometimes within 15 minutes. I've not got any answers Should I reword my query? Regards Ganesh Original Message Hi All, I picked up this sample code from django documentation: from django.core import serializers data = se

Re: views.py: Always a simple return?

2008-06-28 Thread Ross Dakin
By the way, don't be afraid of a couple XMLHttpRequests. If you had two or three per second, you could very well emulate a "real flow" of data. According to YSlow, the Google Groups page on which I'm reading this thread requires 28 HTTP requests (with empty cache), and it loaded in 2.18 seconds.

Re: views.py: Always a simple return?

2008-06-28 Thread Ross
> I want a flow of information, so artificially constructing > the flow as a series of requests sounds do-able but more sensible > would be a single "give me a flow of info" request and a server > construct that can keep open a tcp socket that provides messages until > I'm ready to terminate. Hen

Re: python strings containing backslashes

2008-06-28 Thread Malcolm Tredinnick
On Sat, 2008-06-28 at 01:17 -0700, Jarred Bishop wrote: > hello, I'm trying to get the index of the last backslash from a string > in python. > > The problem I have is that the backslash before the last quotation > mark, cancels out the quote. > > eg: string.rfind("\") will error, because techn

Re: Using Google App engine helper with Django and getting a templat not found error

2008-06-28 Thread Russell Keith-Magee
On Sat, Jun 28, 2008 at 1:31 AM, Chuck <[EMAIL PROTECTED]> wrote: > > I have created the polls application verbatum from the tutorial with > the exception that I am using the helper code to run the app on > Google. The app works just fine on the SDK but whenever I upoade the > app to Google I get

Re: customizing django-admin.py

2008-06-28 Thread Russell Keith-Magee
On Sat, Jun 28, 2008 at 5:08 AM, Michael P. Soulier <[EMAIL PROTECTED]> wrote: > I am supporting an environment where users will be adding "plugin" pages > to an existing Web interface. As such they will be running > "startproject" and "startapp" on a regular basis. I would like to > customize the

Re: createsuperuser error

2008-06-28 Thread Russell Keith-Magee
On Fri, Jun 27, 2008 at 7:15 PM, Graham Carlyle <[EMAIL PROTECTED]> wrote: > > Just wanted to check that the devs are aware that this bug is quite > significant. Aware of the problem, aware of the patches for the fix. The problem is testing - django-admin is one of the pieces of Django that doesn

Re: At what point is the WSGI request or server object available?

2008-06-28 Thread Graham Dumpleton
On Jun 28, 12:52 am, "Leeland (The Code Janitor)" <[EMAIL PROTECTED]> wrote: > Specifically what I am trying to do is figure out if the server has > been run as a mod_python, FCGI process, AJP process or by the built in > test server. Then take the appropriate actions to so that print goes > to

python strings containing backslashes

2008-06-28 Thread Jarred Bishop
hello, I'm trying to get the index of the last backslash from a string in python. The problem I have is that the backslash before the last quotation mark, cancels out the quote. eg: string.rfind("\") will error, because technically the string isn't closed (as a backslash before a quote escapes i

Re: sessions in template (outside of views)

2008-06-28 Thread Daniel Roseman
On Jun 27, 9:33 pm, Bobby Roberts <[EMAIL PROTECTED]> wrote: > i'm trying to view session variables on the screen in a template. I > know the session variable has a value because i've tested it in my > view. I'm trying this in my template but not getting any results: > > Account #: {{ request.se

Re: Displaying in template ManyToMany

2008-06-28 Thread Daniel Roseman
On Jun 28, 5:35 am, dxLogan <[EMAIL PROTECTED]> wrote: > Hi all, > > I am a new user to Django. It's great =) I have to first commend that. > > Anyway, I have a question about ManyToMany. Suppose I got object like > Email, and with a ManyToMany relationship with Recipients. > > I couldn't do this

Re: CMD output

2008-06-28 Thread Joseph
create a batch file (.bat) with that command: some.exe > null and the users can start the application by clicking on the batch file. There is a issue here as well - the users will see a blank window and that may confuse them (while starting and also as it continue to execute) BTW: you can also d