Request for 'transaction' disambiguation

2006-09-12 Thread Hawkeye
Hi all, I'm poking-around with transactions... and I must admit I'm confused as to how to properly implement transactions in Django. I'm trying to make use of "Tying transactions to HTTP requests", but I'm not having much luck. I've placed TransactionMiddleware in the MIDDLEWARE_CLASSES. I

Invalid filter: 'smartypants'

2006-09-12 Thread Benjamin Ward
Hey People, I'm a Django newbie playing around with Jeff Crofts Lost-theories code. I get this page displayed error: Exception Type: TemplateSyntaxError Exception Value:Invalid filter: 'smartypants' Exception Location: /home/bward/django/django_src/django/template/

Re: Strategies for modifying models with existing data

2006-09-12 Thread Kenneth Gonsalves
On 13-Sep-06, at 6:42 AM, DavidA wrote: > There is a "schema evolution" project underway to address this problem > in a more automated way, here is background on the project: > > http://code.djangoproject.com/wiki/SchemaEvolution > > but I don't know anything about the status of it. you can

Re: User Environment Variables

2006-09-12 Thread nymbyl
Once you have reference to a user object you should have access to all the fields and methods listed here: http://www.djangoproject.com/documentation/authentication/#api-reference --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: How to do Service.objects.filter(max_user__gt=cur_user) where both are fields of the model

2006-09-12 Thread SmileyChris
Hi Mathias, I think you're looking for the .extra() queryset method. http://www.djangoproject.com/documentation/db_api/#extra-select-none-where-none-params -none-tables-none --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: stripping html of tags

2006-09-12 Thread SmileyChris
Why don't you strip before you slice. --~--~-~--~~~---~--~~ 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

Re: stripping html of tags

2006-09-12 Thread a
http://youtube.com/profile?us leaves these behind do you know to fix these Guillermo Fernandez Castellanos wrote: > Cheers, > > > i want to display a snippet of data from a html source, and i want to > > strip it of html because an unclose tag will make the rest of the page > > look like > You

Re: User Environment Variables

2006-09-12 Thread mediumgrade
In, n my views, I could do something like app.user = request.user? Can I get all information for the currently logged in user? nymbyl wrote: > To say "Hello, Person's name!" you can do "Hello, {{ user.username > }}!": >

Re: User Environment Variables

2006-09-12 Thread nymbyl
To say "Hello, Person's name!" you can do "Hello, {{ user.username }}!": http://www.djangoproject.com/documentation/authentication/#authentication-data-in-templates Also, the request object has a 'user' attribute that you can access within views:

Re: non-cascading delete?

2006-09-12 Thread Gary Doades
On Tuesday 12 September 2006 23:02, James Bennett wrote: > On 9/12/06, Gary Doades <[EMAIL PROTECTED]> wrote: > > You mean every TYPE of object surely. I'd like to see it list 10 million > > records :) > > Nope. It lists the objects. Ok, I'll be sure to avoid this. > > Even so, if the user

User Environment Variables

2006-09-12 Thread mediumgrade
In my application, I have an object which has a foreign key to the django users table. Is there an environment variable that I can use to get information on the currently logged-in user? For example, if I want the main page to display "Hello, Person's Name!" or if I want my objects to have the

Re: Re: How about search-api?

2006-09-12 Thread Rafael SDM Sierra
On 9/12/06, James Bennett <[EMAIL PROTECTED]> wrote: File a ticket against the search-api branch, and attach your diff :) Done: http://code.djangoproject.com/ticket/2707 Thanks for your help James :D -- SDM UnderlinuxGarimpar.com--PEP-8"Mais vale um ponteiro na mao do que duas classes voando"CPFL

prespawn lighttpd

2006-09-12 Thread a
prespawn lighttpd, any ideas on how to do this or specify in config thanks --~--~-~--~~~---~--~~ 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

Re: stripping html of tags

2006-09-12 Thread a
url a gem wat about unclosed tags such a href="google.com because i need a slice of data... Guillermo Fernandez Castellanos wrote: > Cheers, > > > i want to display a snippet of data from a html source, and i want to > > strip it of html because an unclose tag will make the rest of the page > >

Re: Re: non-cascading delete?

2006-09-12 Thread James Bennett
On 9/12/06, Gary Doades <[EMAIL PROTECTED]> wrote: > You mean every TYPE of object surely. I'd like to see it list 10 million > records :) Nope. It lists the objects. The utility of this will vary widely with your use case -- when you have, say, one object which is related to ten million other

Re: non-cascading delete?

2006-09-12 Thread Gary Doades
On Tuesday 12 September 2006 21:30, James Bennett wrote: > There are some checks in place for this; the admin app, for example, > will display a confirmation page before allowing a delete, and that > page lists every related object that will be deleted. You mean every TYPE of object surely. I'd

Re: Re: non-cascading delete?

2006-09-12 Thread James Bennett
On 9/12/06, Gary Doades <[EMAIL PROTECTED]> wrote: > As an example, I have a table (product) that is referenced by 11 other tables > (booking, history, rates, invoice, payroll, timesheets etc.). Those tables > contain upwards of 10 million rows in the existing application. I certainly > don't

Re: non-cascading delete?

2006-09-12 Thread Gary Doades
On Tuesday 12 September 2006 10:01, Gábor Farkas wrote: > hi, > > as far as i understand, > > when you delete an object in django, it also deletes all the objects > that reference it. > > is there a way to only delete the object, and get an exception if other > objects reference it? > Oh dear, I

Re: Forms with error reporting

2006-09-12 Thread rp
You can use the manipulators described on this page: http://www.djangoproject.com/documentation/forms/ Do a find on "if form.has_errors" to see a template example containing general form errors as well as field specific form errors. Let me know if you need more info. thanks, raman

Re: How about a Django apps public repository?

2006-09-12 Thread Jeff Forcier
Marc Fargas wrote: > I agree on those, maybe the greatest thing to get on would be to > provide that svn+trac that some people was interested in, and to put > the snippets inside. And setup something like a "django portal" with > not only information about what is inside the repositories but also

Re: How about search-api?

2006-09-12 Thread James Bennett
On 9/12/06, Rafael SDM Sierra <[EMAIL PROTECTED]> wrote: > I'm trying the search-api backend [1] but this seems to be "stop", it is > true? becouse it is a nice idea and I want to contribuite with the project, > I'm using Xapian as backend, and I'll follow "alone" with the project > sending any

Re: Core dump- how to diagnose?

2006-09-12 Thread Michael Radziej
Hi, richard wrote: > Hello, > I'm trying to move a functioning development django project developed > on an Os x box (django svn up to date, python 2.4.3) to an 'exposed' > AIX 5.3 server and am falling at an early unanticipated hurdle with > core dumps from django! > On the AIX box I have

Django 95 and Squid

2006-09-12 Thread mikeb
Has anyone gotten Squid and Django to play nice? When I hit Squid on 3128 I get the dreaded: The following error was encountered: * Invalid Request Some aspect of the HTTP Request is invalid. Possible problems: * Missing or unknown request method * Missing URL * Missing HTTP

Strategies for modifying models with existing data

2006-09-12 Thread Joe Murphy
Hi y'all, I've built one and a half (pretty basic) Django sites, and I'm working on a couple more. I was thinking about the type of development Django encourages, and how web applications work in the real world, and I got wondering what strategies folk out there had for modifying models with

How to do Service.objects.filter(max_user__gt=cur_user) where both are fields of the model

2006-09-12 Thread mathiasp
db-api question: if I have a model 'Service" with 'max_users' and 'cur_users' as integer fields, how can I do Service.objects.filter(max_users__gt=cur_users) or how can the right-hand-side of the search be a model field of the current queryset. I found no example for this, yet. Thanks,

Re: Uploading.

2006-09-12 Thread Gabriel Puliatti
On Tue, 2006-09-12 at 12:49 +, zenx wrote: > thanks for the tutorial!!! I wil take a look at it :) > I've now fixed all the indenting issues and checked the code for errors, then fixed them. So it should work. If there are any issues, you know my email. :P -- No violence, gentlemen -- no

Core dump- how to diagnose?

2006-09-12 Thread richard
Hello, I'm trying to move a functioning development django project developed on an Os x box (django svn up to date, python 2.4.3) to an 'exposed' AIX 5.3 server and am falling at an early unanticipated hurdle with core dumps from django! On the AIX box I have ActivePython 2.4 and have tried the

Re: Upload to custom directory

2006-09-12 Thread nymbyl
Yeah - sorry. My constant biggest headache with Django is the lack of access to properties during field definition. It would be cool (and it seems natural) to just do this: image = models.ImageField(upload_to=(%s/%s) % (self.artist, self.book)) or this: latest_mix = models.ForeignKey(Mix,

Re: How about a Django apps public repository?

2006-09-12 Thread Marc Fargas
On 9/12/06, Joeboy <[EMAIL PROTECTED]> wrote: I think you might be missing the bit that says:"Finally, we change our view code to use RequestContext instead of thebase Context class."You're right! I  missed it, then there's no easy solution for your problem  ;o) JoeMarc

Re: Advanced copy/duplicate

2006-09-12 Thread Tim
Thanks Russ. It's not news I wanted to hear but I appreciate your help. *rolling up sleeves* Time to get to work, I guess. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Rails/Django comparison synopsis (a BIG summary)

2006-09-12 Thread Jay
I also agree with documentation in Django. I'm amazed when I began browsing for help files in the site. I did not expect that the docs there are massive. It covers a lot of WHY did this happen and HOW to make it happen. The help for Django has more ham compared to ruby on rails. I think if you

Re: Upload to custom directory

2006-09-12 Thread nymbyl
The easiest way I've found to do this is to subclass models.ImageField from django.db.models and override the save_file method. I have an application where an artist uploads an image file - it makes a thumbnail, and saves the file to a artist/book/chapter folder. I did something like this (which

Re: Upload to custom directory

2006-09-12 Thread [EMAIL PROTECTED]
Yeah, no offense, but that's a lot of code just to keep my folder slightly tidier. I figured since it already knows it's name in a folder-friendly format, I could just append that to the path somehow. --~--~-~--~~~---~--~~ You received this message because you

Re: How about a Django apps public repository?

2006-09-12 Thread Joeboy
>> As far as I can tell the way to do this is to modify *every* >> *view* *in* *my* *project* to pass either the user or a >> RequestContext. > > The link I gave you is to not do that, but add a processor that will add the > user to the context. I think you might be missing the bit that says:

Upload to custom directory

2006-09-12 Thread [EMAIL PROTECTED]
I just know this is a dumb question, but... What I want is something like file = models.FileField(upload_to="img/memorabilia/+self.slug") But I just no that can't be right? Can this be done? How? --~--~-~--~~~---~--~~ You received this message because you are

Re: How about a Django apps public repository?

2006-09-12 Thread Marc Fargas
Maybe I read badly, bu I understood that you needed to modify EVERY VIEW to add something to the context of the template, the link I gave you show how to use a Processor, that is "some function called before rendering a template" more or less like an "intermediate view" Look at the example

Re: Uploading.

2006-09-12 Thread zenx
thanks for the tutorial!!! I wil take a look at it :) --~--~-~--~~~---~--~~ 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

Re: Add Functionality to Admin Interface

2006-09-12 Thread Jay Parlar
On 9/12/06, chrisdo <[EMAIL PROTECTED]> wrote: > > Hi there > > I wanted to write a nice CMS software with modules and all the stuff, > so I wanted to ask if it's possible to add functionality to the admin > interface, like uploading a zip and then unpacking the files to a > specified folder. Is

Re: Concurrency and data modification

2006-09-12 Thread Michael Radziej
Hawkeye wrote: > I think that this would be great (for my purposes)... > > It doesn't look like this exists in Django right now. Are there plans > to implement this? Maybe a ticket that already exists? > > I'd still be concerned about the cache getting in the way, but as a > first step the

Re: non-cascading delete?

2006-09-12 Thread serbaut
On the same issue: What if you want the database to take care of the cascade? Lets say you have 20,000 references that needs to be deleted, it would be much more efficient with "ON DELETE CASCADE". --~--~-~--~~~---~--~~ You received this message because you are

Re: Django and transactions

2006-09-12 Thread Andreas Eigenmann
Does nobody have an answer to one of my questions?? --~--~-~--~~~---~--~~ 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

Re: stripping html of tags

2006-09-12 Thread Guillermo Fernandez Castellanos
Cheers, > i want to display a snippet of data from a html source, and i want to > strip it of html because an unclose tag will make the rest of the page > look like You have the striptags tag: http://www.djangoproject.com/documentation/templates/#striptags You can also access the function from

stripping html of tags

2006-09-12 Thread a
hi guys i want to display a snippet of data from a html source, and i want to strip it of html because an unclose tag will make the rest of the page look like that please help me out thanks --~--~-~--~~~---~--~~ You received this message because you are

Re: How about a Django apps public repository?

2006-09-12 Thread Joeboy
> On the linked thread have you checked: > http://www.b-list.org/weblog/2006/06/14/django-tips-template-context-processors? > You can use a context processor to make {{ user }} available on all > templates. Unless I'm missing something, that link says the same as what I'm saying, namely that you

Re: Initial SQL data using Django ORM - A HowTo

2006-09-12 Thread aaloy
2006/9/12, limodou <[EMAIL PROTECTED]>: > > On 9/9/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > I've added a small tutorial: > > http://code.djangoproject.com/wiki/InitialSQLDataDiangoORMWay > > > > It describes how to use Django ORM to add initial SQL data to freshly > > installed

template and special character problem

2006-09-12 Thread Phil
Hi all, Warning: I'm a new user in town, new to django (albeit already totaly converted this great framework), so be totally warned about my potentially uber-noob question. I have some troubles in the way special character (accentuated character �, �, � and the like) are presented in the

Re: switching to mod_python

2006-09-12 Thread Filipe
I see, thanks. Filipe --~--~-~--~~~---~--~~ 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 [EMAIL

non-cascading delete?

2006-09-12 Thread Gábor Farkas
hi, as far as i understand, when you delete an object in django, it also deletes all the objects that reference it. is there a way to only delete the object, and get an exception if other objects reference it? thanks, gabor --~--~-~--~~~---~--~~ You

Add Functionality to Admin Interface

2006-09-12 Thread chrisdo
Hi there I wanted to write a nice CMS software with modules and all the stuff, so I wanted to ask if it's possible to add functionality to the admin interface, like uploading a zip and then unpacking the files to a specified folder. Is this possible? Or do I have to write my own Fields?