Make New Autocomplete form field

2007-12-18 Thread [EMAIL PROTECTED]
Hello, i'm trying to do a AutoCompleteField. I'm creating a new widget (AutoCompleteWidget) to generate the code and AutoCompleteField with is a form field. The value of my field should be a tuple with (key, value). Can someone please help me. Bellow if the code i've already done. I don't

Re: Choices from table vs. Foreign Key relationship.

2007-12-18 Thread John M
Seems like you'd want a many-to-many relationship, no? Each student gets multiple teachers, and each teacher has multiple students, unless all my years in school were for nothing :). Or am I missing something? Does delete remove FK's with M2M? J On Dec 17, 4:05 pm, radioflyer <[EMAIL

Re: Template text are not being escaped when used with textile

2007-12-18 Thread Malcolm Tredinnick
On Tue, 2007-12-18 at 09:39 -0800, shabda wrote: > So should not {{text|escape|textile}} remove html tags first, and then > apply the textile-markup to generate html? The "escape" filter does not remove HTML tags, that's done by the "striptags" filter. "Escape" converts five special characters

Re: get to named url pattern from request.path

2007-12-18 Thread Malcolm Tredinnick
On Tue, 2007-12-18 at 02:40 -0800, frank h. wrote: > hello, > in a contextprocessor i am writing, i would like to use the "named > url" of the current view instead of request.path. > > I toyd with django.core.urlresolvers.resolve() but that just returns > the function configured in urls.py and

Re: Returning a Queryset

2007-12-18 Thread Malcolm Tredinnick
On Tue, 2007-12-18 at 00:16 -0800, Rufman wrote: > Hey guys > > Is there a way to return a QuerySet object, when I make my own custom > sql? No. Part of the reason is that it's not particularly useful in the general case and very easy to get into trouble. A QuerySet has a lot of methods that

Re: determining newforms field type in a template

2007-12-18 Thread Malcolm Tredinnick
On Mon, 2007-12-17 at 22:10 -0800, MrJogo wrote: > If I pass a form into my template as a variable, is there a way to > tell what input type a field is in the template? My template creates > pretty boxes for the form fields, but I don't want them around hidden > inputs. I was hoping for

Re: Changing sort order of admin select object

2007-12-18 Thread Malcolm Tredinnick
On Mon, 2007-12-17 at 15:23 -0800, borntonetwork wrote: > Thank you Malcom. > > Could you tell me: when the functionality is available, do you know > what the steps to create the sort order will be? Yes. :-) Or were you actually asking if I could tell you what they were? In that case, see

Re: templating javascript code

2007-12-18 Thread Malcolm Tredinnick
On Mon, 2007-12-17 at 09:47 -0800, msoulier wrote: > On Dec 2, 8:27 pm, Darryl Ross <[EMAIL PROTECTED]> wrote: > > I've done this is CSS files before, so it should work just fine. Just > > make sure you set the correct Content-Type header in your JS view. > > FTR, this works fine. I couldn't

Re: django requires db access to dump sql that it would use in syncdb

2007-12-18 Thread Malcolm Tredinnick
On Mon, 2007-12-17 at 09:45 -0800, msoulier wrote: > I'm trying to write db initialization code for an existing db > framework on a product that I work on. To do this I'm "asking" django > to show SQL that it would use to create its db, so I can copy it into > the initialization code. > > I

Re: Allowing downloads for only certain users

2007-12-18 Thread Ryan K
It would be great if the apache_auth module had a user passes test function instead of using permissions. Here is a good article on using lighttpd w/ mod_secdownload: http://isdevelopment.weblog.glam.ac.uk/news/en/2006/nov/30/secure-downloads-django/ On Dec 18, 7:12 pm, Jonathan Buchanan

Re: Allowing downloads for only certain users

2007-12-18 Thread Jonathan Buchanan
Ryan K wrote: > What is the best way to serve static media and only letting certain > users (using django.contrib.auth) download that data? > > Thanks, > Ryan Kaskel http://blog.lighttpd.net/articles/2006/07/02/x-sendfile http://tn123.ath.cx/mod_xsendfile/ Jonathan.

Re: completely escaping an included template

2007-12-18 Thread Jan Rademaker
On Dec 18, 8:12 pm, Bram - Smartelectronix <[EMAIL PROTECTED]> wrote: > Hello everyone, > > trying to upgrade to the latest trunk, I'm wrestling a bit with the > autoescape function. Talking about embed-code for an enduser, I used to > write: > > {% include embedded_player.html %} > Copy-paste

syncdb problem: ValueError: list.remove(x): x not in list

2007-12-18 Thread crybaby
I have django dev version 6941. There seems to be a problem with manage.py line when I do python manage.py syncdb: execute_manager(settings) It creates the tables and but fails to populate initial data. #!/usr/bin/env python from django.core.management import execute_manager try: # This is

Re: Allowing downloads for only certain users

2007-12-18 Thread James Bennett
On Dec 18, 2007 3:50 PM, Ryan K <[EMAIL PROTECTED]> wrote: > What is the best way to serve static media and only letting certain > users (using django.contrib.auth) download that data? http://www.djangoproject.com/documentation/apache_auth/ -- "Bureaucrat Conrad, you are technically correct

Allowing downloads for only certain users

2007-12-18 Thread Ryan K
What is the best way to serve static media and only letting certain users (using django.contrib.auth) download that data? Thanks, Ryan Kaskel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

sending >500 emails using send_email in a for loop

2007-12-18 Thread Peter Baumgartner
I've built a newsletter app that currently cycles through 500+ emails and I'd like to have it scale to handle more. Currently I just have code like this in my view: for recipient in email_list: msg = EmailMultiAlternatives(email.subject, email.message_text, email.sender, [recipient])

Re: url.py

2007-12-18 Thread mike
Marty...you de man!! On Dec 18, 1:20 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > It looks like you've configured the built-in admin at "/admin/", and > you're defining your custom URLs *later* in the list of URL patterns. > This means that the admin's URL configuration will see >

Re: url.py

2007-12-18 Thread Marty Alchin
It looks like you've configured the built-in admin at "/admin/", and you're defining your custom URLs *later* in the list of URL patterns. This means that the admin's URL configuration will see "/admin/display/12/" and assume it's supposed to route to its view for an app named "display" and a

completely escaping an included template

2007-12-18 Thread Bram - Smartelectronix
Hello everyone, trying to upgrade to the latest trunk, I'm wrestling a bit with the autoescape function. Talking about embed-code for an enduser, I used to write: {% include embedded_player.html %} Copy-paste this: The first part shows to the end-user how the embeddable player will look

Re: FileField and form.save()

2007-12-18 Thread Ryan K
Thanks a lot. Missed save_FOO_file in the docs. On Dec 18, 12:52 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > On Dec 18, 2007 12:08 PM, Ryan K <[EMAIL PROTECTED]> wrote: > > > def save(self, user): > > if user != self.scheduled_product.teacher: > > return False > >

url.py

2007-12-18 Thread mike
I am trying to get the url.py to display my template based on the 'id' of my model, but I cannot get this to work, any help would be appreciated. I have tried the url below and also my view is below, I would like to be able to visit /admin/display//id-number and see the ticket corresponding to

Re: Weird problem with request.POST, correct data not coming out from request.POST

2007-12-18 Thread Jan Rademaker
On Dec 18, 7:14 pm, shabda <[EMAIL PROTECTED]> wrote: > I am trying to get a value from request.POST. After form submit, > request.POST contains the values of the ids from the checkbox > selected. I want the list of those ids. SO I am doing something like, > entry_ids = request.POST['delete'] ,

Weird problem with request.POST, correct data not coming out from request.POST

2007-12-18 Thread shabda
I am trying to get a value from request.POST. After form submit, request.POST contains the values of the ids from the checkbox selected. I want the list of those ids. SO I am doing something like, entry_ids = request.POST['delete'] , but this doesnot pick the list, but instead gets me the last

Re: Problem trying to configure Django with FastCGI and Lighttpd

2007-12-18 Thread Rajesh Dhawan
Also, make sure you are using a recent release of flup (either the latest 0.5 update or the 1.0 release): http://cheeseshop.python.org/pypi/flup/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Problem trying to configure Django with FastCGI and Lighttpd

2007-12-18 Thread Rajesh Dhawan
Hi, > Interesting, I've changed my fcgi script to prefork, and updated the > lighttpd conf to have the edternal IP address of the machine and now > I'm getting a 403 - Forbidden error when I go to the site URL. > I think one area of confusion (for me) is how and when to start > Django's fcgi

Re: FileField and form.save()

2007-12-18 Thread Marty Alchin
On Dec 18, 2007 12:08 PM, Ryan K <[EMAIL PROTECTED]> wrote: > def save(self, user): > if user != self.scheduled_product.teacher: > return False > media = Media(name=self.cleaned_data['media'].filename, >

Re: Template text are not being escaped when used with textile

2007-12-18 Thread shabda
And is there some setting which allows markdown to convert linebreaks to for all line breaks? Askin users to add two spaces when they want a line break in comment seems strange to me. On Dec 18, 10:39 pm, shabda <[EMAIL PROTECTED]> wrote: > So should not {{text|escape|textile}} remove html tags

Re: Template text are not being escaped when used with textile

2007-12-18 Thread shabda
So should not {{text|escape|textile}} remove html tags first, and then apply the textile-markup to generate html? On your weblog, b-list, you allow comments in markdown, but strip HTML, are you using something like "safe mode?" How can I enable that? BTW, that site is acting a bit strange from

Re: FileField and form.save()

2007-12-18 Thread Ryan K
Just to make the question a little more clear: What type of object does model.FileType expect to get? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

FileField and form.save()

2007-12-18 Thread Ryan K
I am trying to allow certain users to upload media and then "attach" it via the contenttypes framework. The code posted below just puts the contents of the file in the media field. How do I make this work with the model.FileField? (putting it in the settings.MEDIA_ROOT+upload_to directory?) This

Re: Templates, filesystem, caching?

2007-12-18 Thread Rob Hudson
On 12/18/07, Michael Elsdörfer <[EMAIL PROTECTED]> wrote: > James Bennett schrieb: > > Manually call get_template() or select_template(), and stuff the > > resulting Template object into a module-global variable somewhere. > > Then just re-use it, calling render() with different contexts, each >

How generate thumbail with png transparency

2007-12-18 Thread mamcxyz
Hi, I'm using the thumbail field for autogenerate thumbails. I have my graphics in png with transparency. However, the transparency is not saved, I try: http://snippets.dzone.com/posts/show/1383 and def pngsave(im, file): # these can be automatically added to Image.info dict # they

Re: Using CheckboxSelectMultiple

2007-12-18 Thread Tim
Try this: credentials = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple, choices=Truckshare.CREDENTIALS_CHOICES) On Dec 17, 9:14 pm, "Alex Ezell" <[EMAIL PROTECTED]> wrote: > I have several fields define in my models like this: > CREDENTIALS_CHOICES = ( > ('LM',

Re: Simple Database Import Memory Problems

2007-12-18 Thread [EMAIL PROTECTED]
That indeed did the trick. I new it would be something embarrassingly simple. Thank you very much, James. Much obliged. -Alex. On Dec 18, 11:06 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Dec 18, 2007 9:57 AM, [EMAIL PROTECTED] > > <[EMAIL PROTECTED]> wrote: > > That's really all it

Re: Simple Database Import Memory Problems

2007-12-18 Thread James Bennett
On Dec 18, 2007 9:57 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > That's really all it does. If you watch it in top, however, python's > memory consumption rises steadily as the file is processed (f is very > large, so there are many iterations of the loop). I was wondering if > anyone

Re: Template text are not being escaped when used with textile

2007-12-18 Thread James Bennett
On Dec 18, 2007 8:56 AM, shabda <[EMAIL PROTECTED]> wrote: > I am using textile markup filter. When I am using a variable in the > template without any filter they are being auto escaped, as they > should. However, if I use any markup filter like textile or markdown, > the text is not being auto

Simple Database Import Memory Problems

2007-12-18 Thread [EMAIL PROTECTED]
Hi, I was hoping I could cajole someone into helping me out. I've created a test project that essentially reads records from a large flat file, assigns the contents of each line in said file to a pair of models, and saves the model (that's really all it does). The code reads something like

User behaviour: Rating + Comments or Rating OR comments?

2007-12-18 Thread mamcxyz
I'm debating myself what could be best for the upcoming redesing of www.paradondevamos.com in the area of rating & comments. I know the comments framework have both, but I wonder for a site with blogs & places related to enterteinment for 16-30 years old people what could provide the best return

Re: Choices from table vs. Foreign Key relationship.

2007-12-18 Thread Marty Alchin
On Dec 17, 2007 7:05 PM, radioflyer <[EMAIL PROTECTED]> wrote: > I have a Student model with a Foreign Key relationship to Teacher. > When a teacher is removed, so go the students. Too dangerous for my > particular scenario. There doesn't seem to be a Django feature that > allows for adjusting

Template text are not being escaped when used with textile

2007-12-18 Thread shabda
I am using textile markup filter. When I am using a variable in the template without any filter they are being auto escaped, as they should. However, if I use any markup filter like textile or markdown, the text is not being auto escaped. Even using the escape filter manually does not help. (as

Re: Templates, filesystem, caching?

2007-12-18 Thread Michael Elsdörfer
James Bennett schrieb: > Manually call get_template() or select_template(), and stuff the > resulting Template object into a module-global variable somewhere. > Then just re-use it, calling render() with different contexts, each > time you need it. Is there anything speaking against building

Re: How to get the urls defined in urls.py

2007-12-18 Thread Rajesh Dhawan
On Dec 18, 9:10 am, shabda <[EMAIL PROTECTED]> wrote: > I have my urls.py defined as > urlpatterns = patterns('app.views', > (r'^foo/$', 'foo'), > (r'^bar/$', 'bar'),) > > Now from a template i need to access these urls. So inside the > template we can refer them as /foo/, /bar/.

Re: Are paginators lazy?

2007-12-18 Thread Alex Koshelev
Paginator is lazy. It loads only needed page. It uses slice syntax( [:] ) of query set On 18 дек, 16:26, shabda <[EMAIL PROTECTED]> wrote: > I am using the paginators(django.core.paginator) as describes > athttp://www.djangoproject.com/documentation/models/pagination/. > Are paginators lazy,

Re: How to get the urls defined in urls.py

2007-12-18 Thread James Bennett
On Dec 18, 2007 8:10 AM, shabda <[EMAIL PROTECTED]> wrote: > Now from a template i need to access these urls. So inside the > template we can refer them as /foo/, /bar/. However later when I > change the urls.py, these urls defined in urls.py would break. What > would be a good way around this?

How to get the urls defined in urls.py

2007-12-18 Thread shabda
I have my urls.py defined as urlpatterns = patterns('app.views', (r'^foo/$', 'foo'), (r'^bar/$', 'bar'),) Now from a template i need to access these urls. So inside the template we can refer them as /foo/, /bar/. However later when I change the urls.py, these urls defined in urls.py

Are paginators lazy?

2007-12-18 Thread shabda
I am using the paginators(django.core.paginator) as describes at http://www.djangoproject.com/documentation/models/pagination/ . Are paginators lazy, like .filter and related method are? If I use paginator = ObjectPaginator(Article.objects.all(), 5) and then paginator.get_page(0) would the first

get to named url pattern from request.path

2007-12-18 Thread frank h.
hello, in a contextprocessor i am writing, i would like to use the "named url" of the current view instead of request.path. I toyd with django.core.urlresolvers.resolve() but that just returns the function configured in urls.py and not the name it was configured with to give an example: my

FREE Web Hosting...

2007-12-18 Thread kemoba
Http://host.2freedom.com/ 250 MB of Disk Space 100 GB Bandwidth! Full Domain Hosting cPanel Powered Hosting Host unlimited domains! Over 500 website templates Free POP3 Email Box Enjoy unrestricted POP3 email Full Webmail access FTP and Web based File Manager access PHP, MySQL, Perl, CGI, Ruby.

Re: Choices from table vs. Foreign Key relationship.

2007-12-18 Thread Christian Joergensen
radioflyer wrote: > So the recommendation seems to be when your selection choices are not > static you should go ahead and use a Foreign Key relationship. You get > the automatic loading of the table into a select widget etc. > > But there's this issue of the cascade on delete. > > I have a

Bio Technology seacrat

2007-12-18 Thread d
Bio Technology seacrat http://vigaragirls.blogspot.com/ Bio Technology seacrat http://prasoga.blogspot.com/ Bio Technology seacrat --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Problem trying to configure Django with FastCGI and Lighttpd

2007-12-18 Thread simonjwoolf
Interesting, I've changed my fcgi script to prefork, and updated the lighttpd conf to have the edternal IP address of the machine and now I'm getting a 403 - Forbidden error when I go to the site URL. I think one area of confusion (for me) is how and when to start Django's fcgi process.

Hi to ALL. I just join this group.

2007-12-18 Thread [EMAIL PROTECTED]
Greetings to all http://erleroy.tripod.com/japanese-anime-lesbian-sex.html japanese anime lesbian sex http://erleroy.tripod.com/japanese-anime-art.html japanese anime art http://erleroy.tripod.com/anime-japanese-robot-toys.html anime japanese robot toys

Re: Performance of a django website

2007-12-18 Thread Artiom Diomin
have you tried mod_wsgi ? Nic пишет: > "Karen Tracey" <[EMAIL PROTECTED]> writes: > >> On Dec 11, 2007 1:49 PM, Richard Coleman <[EMAIL PROTECTED]> wrote: >> >>> 1. Static content and dynamic are on the same server (that will change >>> on production). But they are on different apache virtual.

Returning a Queryset

2007-12-18 Thread Rufman
Hey guys Is there a way to return a QuerySet object, when I make my own custom sql? Stephane --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to