Re: html and TextField

2008-06-29 Thread Ross Dakin
Could you just un-escape the string before you pass it to your template? I haven't tried this, just guessing. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Bug with unique_together on mod_wsgi?

2008-06-29 Thread Alex Koshelev
`unique_together` is a database level feature so it cannot depend on web-server and its modules. When you don't give any code to see where you add new entry and retrieve. On Jun 29, 10:32 am, Julien <[EMAIL PROTECTED]> wrote: > Hi, > > Since I switched my site from mod_python to mod_wsgi, the met

Multi-table inheritance with parent that can be null?

2008-06-29 Thread zenx
Can you make a model that inherits from another model with multi-table inheritance and that can have a null parent? Or should do that always with OneToOneFIeld(null=True) ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

Re: Bug with unique_together on mod_wsgi?

2008-06-29 Thread Julien
Ok, thanks. I too found strange that it could be related. But the problem only appeared on the production server just after we switched to mod_wsgi. I'll investigate a bit further and post here if I can fix it. On Jun 29, 6:23 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote: > `unique_together` is a

Re: html and TextField

2008-06-29 Thread Daniel Roseman
On Jun 29, 12:05 am, "Greg Lindstrom" <[EMAIL PROTECTED]> 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

dynamic choices for views/newforms

2008-06-29 Thread John Aherne
I've been looking at django for a while. Been through the tutorial a few times and read 2 books several times and am still trying to find out how some things work. Instead of an empty form on first loading, I would like to be able to fill out some selection lists with data pulled from a databa

Re: Multi-table inheritance with parent that can be null?

2008-06-29 Thread Malcolm Tredinnick
On Sun, 2008-06-29 at 02:55 -0700, zenx wrote: > Can you make a model that inherits from another model with multi-table > inheritance and that can have a null parent? Or should do that always > with OneToOneFIeld(null=True) ? No. The assumption is that the parent link will always be non-null. Af

Re: dynamic choices for views/newforms

2008-06-29 Thread Daniel Roseman
On Jun 29, 11:34 am, John Aherne <[EMAIL PROTECTED]> wrote: > I've been looking at django for a while. Been through the tutorial a few > times and read 2 books several times and am still trying to find out how > some things work. > > Instead of an empty form on first loading, I would like to be ab

Re: Multi-table inheritance with parent that can be null?

2008-06-29 Thread zenx
Ok. Everything clear then! Thank you! On 29 jun, 12:36, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-06-29 at 02:55 -0700, zenx wrote: > > Can you make a model that inherits from another model with multi-table > > inheritance and that can have a null parent? Or should do that alwa

Re: dynamic choices for views/newforms

2008-06-29 Thread John Aherne
Daniel Roseman wrote: > On Jun 29, 11:34 am, John Aherne <[EMAIL PROTECTED]> wrote: > >> I've been looking at django for a while. Been through the tutorial a few >> times and read 2 books several times and am still trying to find out how >> some things work. >> >> Instead of an empty form on fi

Re: dynamic choices for views/newforms

2008-06-29 Thread John Aherne
John Aherne wrote: > Daniel Roseman wrote: > >> On Jun 29, 11:34 am, John Aherne <[EMAIL PROTECTED]> wrote: >> >> >>> I've been looking at django for a while. Been through the tutorial a few >>> times and read 2 books several times and am still trying to find out how >>> some things wor

Re: dynamic choices for views/newforms

2008-06-29 Thread Daniel Roseman
On Jun 29, 2:24 pm, John Aherne <[EMAIL PROTECTED]> wrote: > OK. I did some more experimenting with ModelChoiceField and my table. > > Surprise. It worked when I thought it would not. Why did it work. By > luck in my model I had the __unicode__ function return the right value. > So now I could see

Re: sessions in template (outside of views)

2008-06-29 Thread Bobby Roberts
So I have to explicitly pass the session variables to the template to use them? That kind of defeats the purpose of session variables doesn't it? If they are in session we should be able to access them easier than passing them from view to template throughout our application. --~--~-~-

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

2008-06-29 Thread felix
On Jun 29, 1:28 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > Actually it might be nice if the top parent class table had a > > content_type field (or similar to avoid coupling to > > contrib.contenttypes) so we could easily deduce the leaf class. > > ...The reason is that it > breaks inhe

Re: dynamic choices for views/newforms

2008-06-29 Thread John Aherne
Daniel Roseman wrote: > On Jun 29, 2:24 pm, John Aherne <[EMAIL PROTECTED]> wrote: > >> OK. I did some more experimenting with ModelChoiceField and my table. >> >> Surprise. It worked when I thought it would not. Why did it work. By >> luck in my model I had the __unicode__ function return the

Re: The Lost Fingers

2008-06-29 Thread Marcelo Barbero
2008/6/27 Juanjo Conti <[EMAIL PROTECTED]>: > > Could you recommend me some Django (the artist) hits? > > Juanjo > -- > mi blog: http://www.juanjoconti.com.ar > Check here: http://goear.com/search.php?q=django There's also a pretty song called "Nuages" here: http://www.youtube.com/watch?v=FpDice

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

2008-06-29 Thread felix
in Contact, the root class: def save(self): """ on create, save the content type (leaf class) of this object """ if(not self.content_type): # does this do a db lookup to instantiate ? should try to avoid that self.content_type = Con

Admin problem with user profile model.

2008-06-29 Thread AdamC
I have a couple of models whereby the admin interface is throwing up some errors when I try add details to the user profile. Each user will have a points score and belong to a team, which will aggregate all the scores of those users belonging to that team. My models look thus: class Team(model

Re: Admin problem with user profile model.

2008-06-29 Thread Karen Tracey
On Sun, Jun 29, 2008 at 11:27 AM, AdamC <[EMAIL PROTECTED]> wrote: > > I have a couple of models whereby the admin interface is throwing up > some errors when I try add details to the user profile. > > Each user will have a points score and belong to a team, which will > aggregate all the scores o

Re: sessions in template (outside of views)

2008-06-29 Thread Arien
On Sun, Jun 29, 2008 at 9:08 AM, Bobby Roberts <[EMAIL PROTECTED]> wrote: > > So I have to explicitly pass the session variables to the template to > use them? That kind of defeats the purpose of session variables > doesn't it? If they are in session we should be able to access them > easier tha

override label_tag?

2008-06-29 Thread TiNo
Hi, Is there an easy way to override a form.field's label_tag method? So I can have it add a class 'required' when form.field.required is True, like it's done for the admin forms, but without the need of creating fieldsets and fieldlines? later, TiNo --~--~-~--~~~---

Re: Admin problem with user profile model.

2008-06-29 Thread AdamC
On Sun, Jun 29, 2008 at 4:44 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Sun, Jun 29, 2008 at 11:27 AM, AdamC <[EMAIL PROTECTED]> wrote: >> >> I have a couple of models whereby the admin interface is throwing up >> some errors when I try add details to the user profile. >> >> Each user will h

Re: Admin problem with user profile model.

2008-06-29 Thread Karen Tracey
On Sun, Jun 29, 2008 at 12:05 PM, AdamC <[EMAIL PROTECTED]> wrote: > > Thanks Karen. The user profile part works a treat now, until I > implement the team foreign key on the user profile. > > Then I get the error: > > OperationalError at /admin/tables/userprofile/ > no such column: tables_userprof

Re: Admin problem with user profile model.

2008-06-29 Thread AdamC
On Sun, Jun 29, 2008 at 5:17 PM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Sun, Jun 29, 2008 at 12:05 PM, AdamC <[EMAIL PROTECTED]> wrote: >> >> Thanks Karen. The user profile part works a treat now, until I >> implement the team foreign key on the user profile. >> >> Then I get the error: >> >

Django as front-end for php- and zope2-based apps?

2008-06-29 Thread spacetaxi
Hello djangonauts, maybe someone of you has a good solution for the following scenario: We have several rather complex web applications (partly php-based, partly zope2-based) and I'd like to integrate them into one django- based front-end. New apps will be implemented with django, but we definit

Re: Django as front-end for php- and zope2-based apps?

2008-06-29 Thread Ariel Mauricio Nunez Gomez
I have 'integrated' django and moodle in the past. For authentication I would suggest using a single source (In my case is imap auth using google apps for your domain) and both moodle and django validate credentials against it. It is very easy to write django models to get access to moodle function

Re: Django as front-end for php- and zope2-based apps?

2008-06-29 Thread Alex Ezell
On Sun, Jun 29, 2008 at 11:31 AM, spacetaxi <[EMAIL PROTECTED]> wrote: > Additionally I'd implement a "authentication bridge" between the > different apps to share the login information with django. This is the only part I've had any experience with. We have a legacy PHP app that we are rewritin

Re: python strings containing backslashes

2008-06-29 Thread Leeland (The Code Janitor)
I would use a raw string like this" string.rfind(r'\\') The raw string makes sure there is no additional escaped special characters. But you still need to escape the backslash. Here is a good read on all this: http://www.python.org/doc/current/ref/strings.html + Leeland --~--~-~--~---

Re: python strings containing backslashes

2008-06-29 Thread Ned Batchelder
Actually, this doesn't work. The string you show has two characters, both of them backslashes. The r prefix means that backslashes aren't escapes, they're literal backslash characters. Unfortunately, there's a flaw in the Python lexer which means you can't use a single backslash here either

Re: Django as front-end for php- and zope2-based apps?

2008-06-29 Thread spacetaxi
On 29 Jun., 18:41, "Ariel Mauricio Nunez Gomez" <[EMAIL PROTECTED]> wrote: > I have 'integrated' django and moodle in the past. For authentication I > would suggest using a single source (In my case is imap auth using google > apps for your domain) and both moodle and django validate credentials >

Re: Django as front-end for php- and zope2-based apps?

2008-06-29 Thread spacetaxi
On 29 Jun., 18:44, "Alex Ezell" <[EMAIL PROTECTED]> wrote: > It's pretty simple to get Django and PHP to share the same > session information once a user has been logged in on the > PHP side. I'd like to do it the other way around: Login with django and share the authentication with PHP and Zope2

Re: The Lost Fingers

2008-06-29 Thread Marcelo Barbero
2008/6/27 Juanjo Conti <[EMAIL PROTECTED]>: > > Could you recommend me some Django (the artist) hits? > > Juanjo Nuages is my favourite: http://www.youtube.com/watch?v=FpDiceqJItc (but the guitarist in the video is not Django) See also: http://goear.com/search.php?q=django Marcelo, from Rafaela

streaming upload

2008-06-29 Thread umrzyk
hi there, i would like to give my users ability to upload a huge (i.e. 10-20 MB) files, mostly images. standard uploading using django newforms and FileField is at the moment not an option. it kills my server immediately. recently i read about streaming upload, and.. wow, that's it! so i patched m

Inputting Date/Time in a Django Form

2008-06-29 Thread Tim Sawyer
Hi Folks, What's the simplest approach for me to have a form that makes it easy for the user to enter a Date/Time combination? I have my form class specified (the field in question is a forms.DateTimeField()), but I need to make it easy for users of the site to enter a date/time pair for the

Re: Inputting Date/Time in a Django Form

2008-06-29 Thread TiNo
add: to your template, use SplitDateTimeField and pass the fields: attrs={'class':'vDateField'} That way you have the same date and time input as the admin interface. TiNo On Sun, Jun 29, 2008 at 10:46 PM, Tim Sawyer <[EMAIL PROTECTED]> wrote: > > Hi Folks, > > What's the simplest approac

Re: html and TextField

2008-06-29 Thread greg
On Jun 28, 6:31 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > 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 w

Querying a User profile

2008-06-29 Thread AdamC
I have two models, UserProfile and Team[2]. I want to create a Team page which lists all the users who belong to that team. I'm not sure how to specify this in my view. [1] The problem I run into is that team doesn't exist within User. Any advice on how to query User for a particular team name?

Computed m2m relationships not being saved when in Admin

2008-06-29 Thread Peter Rowell
Short version: during a Save from the Admin interface, m2m associations computed and applied as a side effect of calling save() do not seem to be recorded (permanently?) in the database. The same call from a view or a standalone script works. Longer version: I have the following class:

Re: Querying a User profile

2008-06-29 Thread Peter Rowell
> Any advice on how to query User for a particular team name? Since the relationship is between Team and UserProfile, I believe that's where you need to start. Something like this would work: team = Team.objects.get(team=team_name) ups = UserProfile.objects.filter(team=team) users = [up.user for

Re: streaming upload

2008-06-29 Thread Julien
Hi, There is a patch [1] which is almost ready and that should be merged in Django very soon. You should give it a try and let the developers know on the dev-list [2]. [1] http://code.djangoproject.com/ticket/2070 [2] http://groups.google.com/group/django-developers/browse_thread/thread/573a81af

Re: html and TextField

2008-06-29 Thread Malcolm Tredinnick
On Sun, 2008-06-29 at 14:12 -0700, greg wrote: [...] > > I could use the fields defined above and just allow text in the actual > body, possible with a link to attachments (I have an "Attachments" > table that links to announcements). This would limit what could be > displayed on the screen but

get admin url patch on db/models/base.py

2008-06-29 Thread Milan Andric
I was just curious if anything like this get_admin_url patch was already available in django trunk somewhere and I can eliminate the patch from my patched version of django. Or is there a more appropriate way to do this so it doesn't cause a conflict? Link: http://dpaste.com/59850/ Pasted: svn

Re: get admin url patch on db/models/base.py

2008-06-29 Thread Malcolm Tredinnick
On Sun, 2008-06-29 at 17:27 -0700, Milan Andric wrote: > I was just curious if anything like this get_admin_url patch was > already available in django trunk somewhere and I can eliminate the > patch from my patched version of django. Or is there a more > appropriate way to do this so it doesn't

Re: Django as front-end for php- and zope2-based apps?

2008-06-29 Thread Alex Ezell
On Sun, Jun 29, 2008 at 12:41 PM, spacetaxi <[EMAIL PROTECTED]> wrote: > > On 29 Jun., 18:44, "Alex Ezell" <[EMAIL PROTECTED]> wrote: >> It's pretty simple to get Django and PHP to share the same >> session information once a user has been logged in on the >> PHP side. > > I'd like to do it the ot

Re: streaming upload

2008-06-29 Thread Graham Dumpleton
On Jun 30, 6:15 am, umrzyk <[EMAIL PROTECTED]> wrote: > hi there, > i would like to give my users ability to upload a huge (i.e. 10-20 MB) > files, mostly images. standard uploading using django newforms and > FileField is at the moment not an option. it kills my > server immediately. recently i r

Re: Bug with unique_together on mod_wsgi?

2008-06-29 Thread Graham Dumpleton
Was your mod_python setup using single threaded prefork? Is your mod_wsgi setup also using single threaded prefork, or have you moved to using multithread worker MPM and/or multithreaded daemon processes? Maybe you are seeing a multithreading issue. Graham On Jun 29, 8:13 pm, Julien <[EMAIL PROT

how to? : non-required admin fields

2008-06-29 Thread eddie
Hi. I'm looking to find out how you make form fields in the admin section non-required. I've done a few hours of searching, but haven't found the answer yet. If anyone can let me know where I can find it, it would be much appreciated. Thanks! -e --~--~-~--~~~---~--

Re: how to? : non-required admin fields

2008-06-29 Thread Jeff Anderson
eddie wrote: Hi. I'm looking to find out how you make form fields in the admin section non-required. I've done a few hours of searching, but haven't found the answer yet. If anyone can let me know where I can find it, it would be much appreciated. Put blank=True and null=True in your model

Re: how to? : non-required admin fields

2008-06-29 Thread eddie
Thanks Jeff. On Jun 29, 10:41 pm, Jeff Anderson <[EMAIL PROTECTED]> wrote: > eddie wrote: > > Hi.  I'm looking to find out how you make form fields in the admin > > section non-required.  I've done a few hours of searching, but haven't > > found the answer yet.  If anyone can let me know where I

Using template_utils to get latest modified object.

2008-06-29 Thread chatchai
If I have a 'modified' filed like this, modified = models.DateTimeField(auto_now=True) The question is, How to setup the GENERIC_CONTENT_LOOKUP_KWARGS to get latest object for model using get_latest_ovject template tag. Thanks --~--~-~--~~~---~--~~ You receiv

Re: Django as front-end for php- and zope2-based apps?

2008-06-29 Thread [EMAIL PROTECTED]
Hi On Jun 29, 7:31 pm, spacetaxi <[EMAIL PROTECTED]> wrote: > Currently, I'm thinking about implementing some kind of http-proxy > within my django-app, so django would forward the incoming requests > (get/post) to the particular application. This is good idea, but probably should be implemented

Re: Querying a User profile

2008-06-29 Thread AdamC
On Mon, Jun 30, 2008 at 12:08 AM, Peter Rowell <[EMAIL PROTECTED]> wrote: > >> Any advice on how to query User for a particular team name? > > Since the relationship is between Team and UserProfile, I believe > that's where you need to start. Something like this would work: > > team = Team.objects

Re: Date based URLconf condition not working

2008-06-29 Thread 城市拓荒者
Hello! I encounter same trouble,Please tell me how resolve it,thanks! On 6月15日, 上午8时57分, joshuajonah <[EMAIL PROTECTED]> wrote: > On Jun 14, 8:51 pm, Jeff Anderson <[EMAIL PROTECTED]> wrote: > > > > > joshuajonah wrote: > > > Is this not impossible? > > > > 404 error: > > > Using the URLconf