Re: Chained Views - as in Catalyst (perl)

2009-07-26 Thread Alexandru Nedelcu
On Mon, Jul 27, 2009 at 4:38 AM, Russell Keith-Magee wrote: > Perhaps I'm missing some of the "neat tricks" that are only possible > using this approach, but my immediate reaction is that you appear to > be going to great lengths to avoid the obvious solution - a method >

Re: ImageFile bug? (Re: ImageField questions)

2009-07-26 Thread Jacob Kaplan-Moss
2009/7/24 Rusty Greer : > that bug actually doesn't fix my case.  if i alter the patch to just > do a file.close() in all cases, it works.  is there another patch to > close the file opened outside of this class? I'm not sure I follow; let me make sure I understand you: *

Re: problem: TemplateDoesNotExist at /admin/ (linux)

2009-07-26 Thread Some Guy
If you're not using the development server (python manage.py runserver), make sure that you have set a template_dir in settings.py and make sure the webserver can read it... On Jul 26, 3:15 pm, LuXo Jarufe wrote: > Hi, I want to use the admin but I have this problem, I

Re: how to use form_class with generic views?

2009-07-26 Thread Vasil Vangelovski
First you create a ModelForm: from django.forms import ModelForm from myproject.myapp.models import MyModelClass class MyFormClass(ModelForm): class Meta: model = MyModelClass there you have your form_class that you need to pass to the view you want:

how to use form_class with generic views?

2009-07-26 Thread djangonoob
Hi all, I am wondering how can i use form_class with generic views? FOr example, according to the online doc, http://docs.djangoproject.com/en/dev/ref/generic-views/ we can use form_class as a required argument for create_object , update_object, delete_object But the online doc stopped short

Re: Database connection closed after each request?

2009-07-26 Thread James Bennett
On Sun, Jul 26, 2009 at 9:17 PM, Amitay Dobo wrote: > So to sum up: I vote up connection pooling. Where do I sign up? On some other project's mailing list? Connection pooling doesn't belong in Django. I've outlined one reason for that above. Google a bit for things like

Re: Database connection closed after each request?

2009-07-26 Thread Amitay Dobo
I was quite surprised to find out there isn't any connection pooling built in to Django or (at least some of) its DB beack-ends when I've first researched about it. Other people have correctly pointed out that this is a latency issue that affects both low and high traffic sites. Since there is

Re: Caught an exception while rendering: Error binding parameter 0 - probably unsupported type.

2009-07-26 Thread nixon66
problem solved. Type On Jul 26, 10:05 pm, nixon66 wrote: > ran into this error. Anyone familiar with it. > > TemplateSyntaxError at /lobby/lobbytype/public-relations/ > > Caught an exception while rendering: Error binding parameter 0 - > probably unsupported type. > >

Caught an exception while rendering: Error binding parameter 0 - probably unsupported type.

2009-07-26 Thread nixon66
ran into this error. Anyone familiar with it. TemplateSyntaxError at /lobby/lobbytype/public-relations/ Caught an exception while rendering: Error binding parameter 0 - probably unsupported type. Original Traceback (most recent call last): File

Re: Chained Views - as in Catalyst (perl)

2009-07-26 Thread Russell Keith-Magee
On Mon, Jul 27, 2009 at 7:55 AM, Alexandru Nedelcu wrote: > > Hi, > > I'm a newbie when it comes to Django ... I picked it up for a personal > project because it seemed like a good fit. > > I do miss a feature from Catalyst ... chained actions. > I added this functionality to

Re: Auth test with custom auth backend

2009-07-26 Thread Russell Keith-Magee
On Mon, Jul 27, 2009 at 6:17 AM, Vitaly Babiy wrote: > Hey, > I have replaced the default auth backend with my own that requires a field > to be set on my own custom user objects. So when I run my test suite ( which > includes the auth app ) most of the auth test fail. Due to

Images in blog posts

2009-07-26 Thread Daniel Brown
Good afternoon list, I'm putting together my first django application: a simple blog engine to replace my current WordPress installation. I am rolling my own application as an learning exercise. I am currently thinking of using Markdown with Pygments (via the CodeHilite extension) for managing

problem: TemplateDoesNotExist at /admin/ (linux)

2009-07-26 Thread LuXo Jarufe
Hi, I want to use the admin but I have this problem, I was following the tutorial in djangoproject but when I execute the admin this appears: TemplateDoesNotExist at /admin/ admin/login.html Request Method: GET Request URL:http://127.0.0.1:8000/admin/ Exception Type:

Chained Views - as in Catalyst (perl)

2009-07-26 Thread Alexandru Nedelcu
Hi, I'm a newbie when it comes to Django ... I picked it up for a personal project because it seemed like a good fit. I do miss a feature from Catalyst ... chained actions. I added this functionality to Django by myself (just a few hours hack), see here (example + code):

Re: Non ASCII URL characters in Django

2009-07-26 Thread Russell Keith-Magee
On Sun, Jul 26, 2009 at 9:42 PM, Shivaraj wrote: > > Django doesn't allow urlecode or urlopen when there is a non-ASCII/ > international characters in the url. Django does no such thing. Firstly, urlencode and urlopen aren't part of Django's API, so this isn't an issue of

Re: looking for a clean, easy way to force user to change password on first login

2009-07-26 Thread pjv
i thought of something along those lines. that's exactly the kind of thing that i was originally searching for -- a way to do it without cluttering things up and without building a bunch of unnecessary infrastructure or hacking core django code. unfortunately, when you do those nice reset

Editing model based forms.

2009-07-26 Thread AKK
Hi, I have a form based on a model which allows users to add comment. A comment is made up of the comment is about, the body, the date and time and also who made the comment. I am mainly interested in the datetime and user fields. What i would like to know is how i can automatically have these

Re: Url Namespaces

2009-07-26 Thread Joshua Russo
On Sun, Jul 26, 2009 at 9:13 PM, Vitaly Babiy wrote: > How does one go about registering a namespace? Not quite sure what you mean by that, but my guess is that you are assuming you need to register your namespace (modules?) before being able to import them. If this is what

Re: Url Namespaces

2009-07-26 Thread Vasil Vangelovski
See this: http://docs.djangoproject.com/en/dev/topics/http/urls/#defining-url-namespaces On Mon, Jul 27, 2009 at 12:13 AM, Vitaly Babiy wrote: > How does one go about registering a namespace? > I can't seem to find it in the docs. > Thanks, > Vitaly Babiy > > > >

Re: Best way to build a search form

2009-07-26 Thread Erik Vorhes
On Sun, Jul 26, 2009 at 3:55 PM, Rams3377 wrote: > > > In Django 1.0.2, what is the best way to perform a user submitted > search? For instance if someone wanted to search through a profile > which has several parameters that the user may or may not fill out. > What is the

Auth test with custom auth backend

2009-07-26 Thread Vitaly Babiy
Hey, I have replaced the default auth backend with my own that requires a field to be set on my own custom user objects. So when I run my test suite ( which includes the auth app ) most of the auth test fail. Due to the fact that djangos fixtures don't create user object of my custom type. What is

Url Namespaces

2009-07-26 Thread Vitaly Babiy
How does one go about registering a namespace? I can't seem to find it in the docs. Thanks, Vitaly Babiy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Best way to build a search form

2009-07-26 Thread Rams3377
Hello and thanks for any assistance in advance. I've been learning Django and Python this summer and i've pretty much am addicted. I've used PHP and some experience with C in the past but haven't ever had this much fun coding EVER. So props to the people who create to these wonderful

Re: does anyone have document for django-email-confirmation/

2009-07-26 Thread Andy Mikhailenko
There's a sample project[1] in the github repo. [1] http://github.com/jtauber/django-email-confirmation/tree/master/devproject On Jul 25, 6:35 pm, kk wrote: > Hi, > > Is there any tutorial document about how to use this module?

Complex customization using generic views involving ImageField and ForeignKey(User)

2009-07-26 Thread djangonoob
I would like to use generic views to allow users to upload images, with the image linked ( via ForeignKey ) to the user id. The following is my code: ( a link to dpaste is here: http://dpaste.com/71693/ ) # models.py class PressRelease(models.Model): title = models.CharField(max_length=100)

Re: customization using form_class with generic views

2009-07-26 Thread djangonoob
Hi Hebert, ok thanks i got what u mean. But what happens if my model is now like this: # models.py class Images(models.Model): title = models.CharField(max_length=200) images = models.ImageField(upload_to='userimages') user = models.ForeignKey(User) public =

Re: Enforcing requirements for user passwords on admin site

2009-07-26 Thread Roland van Laar
Scot Hacker wrote: > On Jul 22, 8:13 am, Topa wrote: > >> I'd like to require that userpasswordsbe of a certain level of >> complexity when they're added to or changed on the admin site. I see a >> way to do this fairly easily with the password reset view since I can >>

Re: looking for a clean, easy way to force user to change password on first login

2009-07-26 Thread Roland van Laar
Ronghui Yu wrote: > How about writing a decorator? That's possible, although there is an easier way: The best way imho is to generate a random password when you create the user, and to send them a password reset email. Which can be implemented using django.contrib.auth. That way they don't have

Non ASCII URL characters in Django

2009-07-26 Thread Shivaraj
Django doesn't allow urlecode or urlopen when there is a non-ASCII/ international characters in the url. http://www.djangosnippets.org/snippets/1048/ which uses text.encode ('utf-8') helped. Reported this in http://code.djangoproject.com/ticket/2078 . Just wanted to know if this can be included

Re: fastcgi memory usage

2009-07-26 Thread Joshua Russo
On Sat, Jul 25, 2009 at 9:23 PM, Adi wrote: > > I'm running a couple of django sites on a VPS with nginx and fastcgi > and I'm a little concerned because of the memory usage. > According to the "free" command, each site uses about 50MB of RAM > (I've ran free before and

Re: User.objects.create_user

2009-07-26 Thread Daniel Roseman
On Jul 26, 12:46 pm, ramanathan wrote: > I stored the username, password, email id  fields in auth_user table > using > > User.objects.create_user(username,email,password) > > But i was not able to store the first_name field.. > > I tried User.objects.create_user >

User.objects.create_user

2009-07-26 Thread ramanathan
I stored the username, password, email id fields in auth_user table using User.objects.create_user(username,email,password) But i was not able to store the first_name field.. I tried User.objects.create_user (username,first_name=firstname,email,password) But it didnt work out.. How to store

Re: How to make email field unique in model User from contrib.auth in Django

2009-07-26 Thread ramusus
It's amazing for me, But I found a best solution! django-registration have form with checking unique email: RegistrationFormUniqueEmail http://bitbucket.org/ubernostrum/django-registration/issue/13/password-reset-issues-emails-should-be#comment-15422 On 26 июл, 15:09, ramusus

Re: How to make email field unique in model User from contrib.auth in Django

2009-07-26 Thread ramusus
Thanks, Andy and Parag! Validate email field via AJAX - very good idea. Could you describe case with pre-save signal in more detail, please! If I understand correctly, you are offering to use pre-save signal and raise ValidationError if email of new User exists in DB or smthing else? Could

Re: issue with simple image ordering view

2009-07-26 Thread Daniel Roseman
On Jul 26, 9:56 am, django user wrote: > How would I make a formset for exactly the # of images I have in a > queryset? Just pass the queryset into the formset instantiation, as described on the page I referenced: >>> from django.forms.models import modelformset_factory

Re: issue with simple image ordering view

2009-07-26 Thread django user
How would I make a formset for exactly the # of images I have in a queryset? On Jul 26, 1:37 am, Daniel Roseman wrote: > On Jul 26, 6:13 am, django user wrote: > > > > > I have a basic form with that shows user's uploaded images: > > > > > > >    

Re: customization using form_class with generic views

2009-07-26 Thread Frédéric Hébert
Hi, AFAICS, it's nearly impossible to do this in the way you want to. set_pub_date is an another view which does a CRUD operation like generic view create_object and you pass it to extra_context which is relevant to a template operation. extra_context declares new objects in the template and

Re: issue with simple image ordering view

2009-07-26 Thread Daniel Roseman
On Jul 26, 6:13 am, django user wrote: > I have a basic form with that shows user's uploaded images: > > > >     {% for photo in photos %} >     class="handle2" width="150" height="90" alt="test"> >         Order: label> value="{{ photo.position }}" name="image" /> > >  

Re: customization using form_class with generic views

2009-07-26 Thread djangonoob
oh, i missed out my def set_pub_date() in views.py. Here is the revised version of my code: ( link to dpaste is here: http://dpaste.com/71532/ ) #urls.py press_detail_dict = { 'queryset': PressRelease.objects.all(), 'template_name':'press/detail.html',

Re: tagging problems

2009-07-26 Thread todd12
Hi T, I found this in the tagging issues from 2008 but it worked: if your like me then you get this message from within the python interpreter. Well I figured out that I need to be running the"python manage.py shell" command from within the site DIR to get all the environment variables correct.

Re: customization using form_class with generic views

2009-07-26 Thread djangonoob
hi Dan, than may i know what is the code like in my views.py for the function set_pub_date? Also, from the urls.py, how do i call the set_pub_date() ? ( in urls/py i am using generic view ) Best Regards. On Jul 26, 12:33 pm, Dan Harris wrote: > Assuming that you

Re: Also-Online Feature

2009-07-26 Thread Rob B
A few links that might help... http://groups.google.com/group/django-users/browse_thread/thread/4ba5652bcbd1f958 http://www.djangosnippets.org/snippets/947/ 2009/7/26 Jonas Obrist > > Is there a builtin way in django to get a list of other users who are > currently