Re: images do not upload

2009-06-01 Thread Mike Ramirez
On Monday 01 June 2009 08:53:26 pm Bobby Roberts wrote: > Does anyone have an example of how to upload an image. I've followed > the docs and it's just not working (ie no file is uploaded and the > filename is not saved to the db. > I had a similar problem, though it did save the path to the db.

Re: extending django-registration ( MixIn ModelForm and Form)

2009-06-01 Thread Rishabh Manocha
On Tue, Jun 2, 2009 at 9:10 AM, Marco Bazzani wrote: > > On Mon, Jun 1, 2009 at 23:19, V wrote: > > > > On Jun 1, 6:50 pm, Marco Bazzani wrote: > >> I'm trying to extends django-registration app with some more fields

Re: images do not upload

2009-06-01 Thread Bobby Roberts
Does anyone have an example of how to upload an image. I've followed the docs and it's just not working (ie no file is uploaded and the filename is not saved to the db. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: filtering on reverse foreignkey using isnull

2009-06-01 Thread Eric Abrahamsen
On Jun 2, 2009, at 2:07 AM, Karen Tracey wrote: > On Sun, May 31, 2009 at 11:40 PM, Eric Abrahamsen > wrote: > > On May 31, 2009, at 11:45 PM, Karen Tracey wrote: > >> On Sun, May 31, 2009 at 10:13 AM, Eric Abrahamsen >> wrote: >> >> Hi, >> >> I've got

Re: filtering the join table in a many-to-many relationship

2009-06-01 Thread Sam Chuparkoff
On Mon, 2009-06-01 at 16:01 -0700, Ben Adida wrote: > I have a ManyToMany self relationship with a custom join table (I > don't think the self-reference is important to the problem, but it > might be, so I'm mentioning it): > > class Documents > related_docs = models.ManyToManyField("self", >

Re: django paypal donations

2009-06-01 Thread Joshua Partogi
Why did you use launchpad man? Why not just use bitbucket since most django users is using it. It's easier for us to fork it if you are on bitbucket. :-) On Jun 2, 7:13 am, Viktor wrote: > Hi, > > as I couldn't find an already existing application to provide a simple >

Re: Problem with Model Forms and Reverse Many-to-Many Relationships

2009-06-01 Thread Jashugan
Here's my workaround, if anyone else is interested how to overcome this problem: http://www.pastie.org/497309 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Problem with Model Forms and Reverse Many-to-Many Relationships

2009-06-01 Thread Jashugan
How do you create a model form that contains a reverse many-to-many relationship? My attempt: http://pastie.org/497284 failed: AttributeError: 'RelatedObject' object has no attribute 'unique' --~--~-~--~~~---~--~~ You received this message because you are

Re: extending django-registration ( MixIn ModelForm and Form)

2009-06-01 Thread Marco Bazzani
On Mon, Jun 1, 2009 at 23:19, V wrote: > > On Jun 1, 6:50 pm, Marco Bazzani wrote: >> I'm trying to extends django-registration app with some more fields in >> the moment of registration >> those fields are saved in a subclass of User >> >> for

Re: ModelForm problems, Programming Error 1146

2009-06-01 Thread Karen Tracey
On Mon, Jun 1, 2009 at 5:09 PM, Robocop wrote: > > Hello, > I'm trying to deploy another developer's blog code, and have run into > some snags with their ModelForm for adding entries. > > The segment of code that triggers the error in my views.py: >

Re: form adding

2009-06-01 Thread Sam Chuparkoff
On Sun, 2009-05-31 at 23:45 -0700, samira wrote: > I exactly do like when I use Django 0.96. > for example this: > > Class AccountAdd(forms.Form): > accountNo = forms.IntegerField(min_value=1, required=True, > widget=forms.TextInput(attrs={'size':'10'})) > > def __init__(self,

filtering the join table in a many-to-many relationship

2009-06-01 Thread Ben Adida
Hi folks, I've looked through the forum and can't find an answer to this one. I have a ManyToMany self relationship with a custom join table (I don't think the self-reference is important to the problem, but it might be, so I'm mentioning it): class Documents related_docs =

annotate() + order_by() == aborted transaction?

2009-06-01 Thread Don Spaulding
Hi all, I've got a quick use case that I think should work according to the docs, but it's not. In this case, Domain objects have a reverse fkey relation named "reports", and the Report model has an "updated" field. I'd like to annotate and order Domains by the max value of "updated" for all

Re: Markdown Encoding Problem

2009-06-01 Thread Karen Tracey
On Mon, Jun 1, 2009 at 4:02 PM, bfrederi wrote: > > I'm getting this: > > Traceback (most recent call last): > File "/home/django-code/aubrey_explore/tests.py", line 18, in > testSpeaking >self.assert_(markdown(self.bla.collection_description_short)) > File

Re: HOW DO YOU ACCESS SESSION AND COOKIES DATA W/O USING THE REQUEST OBJECT ?

2009-06-01 Thread Alex Gaynor
On Mon, Jun 1, 2009 at 2:38 PM, Rami wrote: > > I'm trying to access Session's (logged in) user id info from a py > function that does not have 'request' object. I can't find an obvious > way to access the session or the cookie data NOT through an > instantiated request

HOW DO YOU ACCESS SESSION AND COOKIES DATA W/O USING THE REQUEST OBJECT ?

2009-06-01 Thread Rami
I'm trying to access Session's (logged in) user id info from a py function that does not have 'request' object. I can't find an obvious way to access the session or the cookie data NOT through an instantiated request (HttpRequest) obj [the same way for example you can access any Session

Re: Newbie Django 1.0 help with create object, uopdate object

2009-06-01 Thread adelaide_mike
Thanks Tim for your detailed reply. I have it now. HTML was incorrect, and yes, now I understand better what is happening I have rewritten the view as you suggest. I split it up only to try to make clearer to me what was happening. Thanks again. Mike On Jun 2, 1:48 am, Tim Sawyer

AttributeError: 'str' object has no attribute '_default_manager'

2009-06-01 Thread Luke Graybill
I am getting this error under either mod_python or mod_wsgi, when the project functions just fine under the development server. I've pasted the more detailed traceback here (edited out some of the sensitive corporate stuff). We are using Django 1.0.2 and Python 2.6 on

Re: request.session in template tag?

2009-06-01 Thread Masklinn
On 1 Jun 2009, at 22:36 , Baxter wrote: > Nevertheless, what I'm after is a template tag that's aware of the > request that I can put in any template, whether the template uses a > generic view or not. And I'm pretty sure you won't find it. Templatetags can't be magically aware of "the

Re: extending django-registration ( MixIn ModelForm and Form)

2009-06-01 Thread V
On Jun 1, 6:50 pm, Marco Bazzani wrote: > I'm trying to extends django-registration app with some more fields in > the moment of registration > those fields are saved in a subclass of User > > for reference here are the form >

django paypal donations

2009-06-01 Thread Viktor
Hi, as I couldn't find an already existing application to provide a simple PayPal donate button, and store and present some donor info, I wrote one. I hope it will be useful for others as well: available at https://launchpad.net/django-donation have a nice day! V

ModelForm problems, Programming Error 1146

2009-06-01 Thread Robocop
Hello, I'm trying to deploy another developer's blog code, and have run into some snags with their ModelForm for adding entries. The segment of code that triggers the error in my views.py: http://dpaste.com/50238/ The model and modelforms for both the blog, and for the entries:

Re: Internationalization and Apache

2009-06-01 Thread Damien MATHIEU
Thank you Karen for being more precise and writing something understandable. On Jun 1, 5:15 pm, Karen Tracey wrote: > On Mon, Jun 1, 2009 at 8:39 AM, Damien MATHIEU <4...@dmathieu.com> wrote: > > > Based on the advices of a friend, I've tried with mod_wsgi instead of > >

Re: images do not upload

2009-06-01 Thread Bobby Roberts
just checking if anyone has an update on this. I've added request.FILES to my view to accept the file from the form but nothing is working and it's not even saving the file name in the db at this time. --~--~-~--~~~---~--~~ You received this message because you

Re: request.session in template tag?

2009-06-01 Thread Baxter
> Django doesn't have "generic templates" (only generic views), and if   > you don't provide the request to the template engine, it'll have a   > pretty hard time getting the session without using magic. > > Magic is bad. > > If you want the session in your template context, either use generic  

Re: Markdown Encoding Problem

2009-06-01 Thread bfrederi
Sorry, didn't mean to post so many replies. A combination of an annoying KVM switch and user error. On Jun 1, 3:19 pm, bfrederi wrote: > I'm getting this: > > Traceback (most recent call last): >   File "/home/django-code/aubrey_explore/tests.py", line 18, in >

Re: Markdown Encoding Problem

2009-06-01 Thread bfrederi
I'm getting this: Traceback (most recent call last): File "/home/django-code/aubrey_explore/tests.py", line 18, in testSpeaking self.assert_(markdown(self.bla.collection_description_short)) File "/usr/lib/python2.5/site-packages/django/contrib/markup/ templatetags/markup.py", line 72, in

Re: Markdown Encoding Problem

2009-06-01 Thread bfrederi
I'm getting this: Traceback (most recent call last): File "/home/django-code/aubrey_explore/tests.py", line 18, in testSpeaking self.assert_(markdown(self.bla.collection_description_short)) File "/usr/lib/python2.5/site-packages/django/contrib/markup/ templatetags/markup.py", line 72, in

Re: Markdown Encoding Problem

2009-06-01 Thread bfrederi
I'm getting this: Traceback (most recent call last): File "/home/django-code/aubrey_explore/tests.py", line 18, in testSpeaking self.assert_(markdown(self.bla.collection_description_short)) File "/usr/lib/python2.5/site-packages/django/contrib/markup/ templatetags/markup.py", line 72, in

Re: Composite keys

2009-06-01 Thread Mike Driscoll
On May 15, 8:12 pm, Russell Keith-Magee wrote: > On Sat, May 16, 2009 at 5:27 AM, Mike Driscoll wrote: > > > Hi, > > > I posted about this over a year ago and Jacob Kaplan-Moss said that > > Django would eventually getcompositekey support, but he

Bulk file upload via admin

2009-06-01 Thread Roberto Cea
Is there a way to allow bulk upload of files (e.g.: images) from the admin? My use case is an ImageGallery model, where the admins would like to be able to select an arbitrary amount of files to upload at one time, and not have to browse-select-accept each file individually. Using trunk. Thanks,

Re: request.session in template tag?

2009-06-01 Thread Masklinn
On 1 Jun 2009, at 20:39 , Baxter wrote: > On Jun 1, 1:25 pm, Gustavo Henrique wrote: >> Using direct_to_template the request var is passed as param. >> So, you can access in template: {{ request.session.myvar }} > > Thanks, but what I'm really after is a template tag I can

Re: Markdown Encoding Problem

2009-06-01 Thread Karen Tracey
On Mon, Jun 1, 2009 at 2:26 PM, bfrederi wrote: > > I am having problems using the > django.contrib.markup.templatetags.markup.markdown function with > special characters (diacritics and such). > > I am using markdown in my model and creating a function that returns >

Re: request.session in template tag?

2009-06-01 Thread Baxter
On Jun 1, 1:25 pm, Gustavo Henrique wrote: > Using direct_to_template the request var is passed as param. > So, you can access in template: {{ request.session.myvar }} Thanks, but what I'm really after is a template tag I can drop in anywhere, whether the main template is

Re: request.session in template tag?

2009-06-01 Thread Gustavo Henrique
Using direct_to_template the request var is passed as param. So, you can access in template: {{ request.session.myvar }} -- Gustavo Henrique Site: http://www.gustavohenrique.net Blog: http://blog.gustavohenrique.net --~--~-~--~~~---~--~~ You received this

Re: request.session in template tag?

2009-06-01 Thread K.Berkhout
Looks like something similar to the problem I had, see http://groups.google.nl/group/django-users/browse_thread/thread/cf3e243d3bc5ca3b?hl=nl Kevin On 1 jun, 19:53, "bax...@gretschpages.com" wrote: > I'm trying to write a template tag that accesses the user's >

Markdown Encoding Problem

2009-06-01 Thread bfrederi
I am having problems using the django.contrib.markup.templatetags.markup.markdown function with special characters (diacritics and such). I am using markdown in my model and creating a function that returns markdown from a model field. I even went as far as to override the save method for my

Re: filtering on reverse foreignkey using isnull

2009-06-01 Thread Karen Tracey
On Sun, May 31, 2009 at 11:40 PM, Eric Abrahamsen wrote: > > On May 31, 2009, at 11:45 PM, Karen Tracey wrote: > > On Sun, May 31, 2009 at 10:13 AM, Eric Abrahamsen wrote: > >> >> Hi, >> >> I've got two models, Author and Entry, with a foreignkey from Entry to

request.session in template tag?

2009-06-01 Thread bax...@gretschpages.com
I'm trying to write a template tag that accesses the user's request.session. My problem is, I don't know how to get the request. Googling around, I saw references to including TEMPLATE_CONTEXT_PROCESSORS in settings, but I'm still not seeing the request. Help?

Re: user.is_authenticated

2009-06-01 Thread K.Berkhout
Thank you very much for your quick replies, I didn't know about the RequestContext! Everything works like a charm now! Kevin On 1 jun, 18:48, Genis Pujol Hamelink wrote: > Hi, > > The variable you want to use should be in every page's default context. > > #views.py >

Re: user.is_authenticated

2009-06-01 Thread Genis Pujol Hamelink
Hi, The variable you want to use should be in every page's default context. #views.py from django.template import RequestContext def myview(request): myvar = foo variables = RequestContext(request, { 'myvar' : myvar }) return render_to_response("template.html", variables) In

extending django-registration ( MixIn ModelForm and Form)

2009-06-01 Thread Marco Bazzani
I'm trying to extends django-registration app with some more fields in the moment of registration those fields are saved in a subclass of User for reference here are the form classes: http://bitbucket.org/ubernostrum/django-registration/src/tip/registration/forms.py#cl-21 ok here is my code

Re: user.is_authenticated

2009-06-01 Thread Tim Sawyer
You need a RequestContext for the user object to be available in templates http://lincolnloop.com/blog/2008/may/10/getting-requestcontext-your-templates/ I use a render_auth method instead of render_to_response, which automatically adds the RequestContext to all of my templates. Tim. On

Re: user.is_authenticated

2009-06-01 Thread Masklinn
On 1 juin 09, at 18:40, "K.Berkhout" wrote: > Hi, > > Is there a way I can access the "user.is_authenticated" method in > every view, without having to manually pass the User model to every > template? Basicly I want to show a login or logout link on every page, > depending on

Re: Newbie Django 1.0 help with create object, uopdate object

2009-06-01 Thread Tim Sawyer
Hi, I think the recommended approach in django is for forms to submit to the current URL and for the view to decide whether the request is to display the form (a HTTP GET) or submit the form (HTTP POST). I'd suggest that you attempt to re-write this way. Your error could be caused by

user.is_authenticated

2009-06-01 Thread K.Berkhout
Hi, Is there a way I can access the "user.is_authenticated" method in every view, without having to manually pass the User model to every template? Basicly I want to show a login or logout link on every page, depending on wether the visitor is logged in or not. I've included the following if

Re: Need help with URL rewrites

2009-06-01 Thread Kevin Audleman
Partial solution: I added the following settings variable: PythonOption django.root "/directory" The /directory part is now successfully added to all front-end pages. However saving models within the admin is broken. When I click save, the URL it tries to go to (which would be the list view

Re: Internationalization and Apache

2009-06-01 Thread Karen Tracey
On Mon, Jun 1, 2009 at 8:39 AM, Damien MATHIEU <4...@dmathieu.com> wrote: > > Based on the advices of a friend, I've tried with mod_wsgi instead of > mod_python. > However, it still doesn't work. > > And the sys.path is similar to the one I have when I do a manage.py > runserver (where I

Re: How do I eliminate django.openid.consumer when trying to use a Pinax complete_project?

2009-06-01 Thread Karen Tracey
On Mon, Jun 1, 2009 at 8:03 AM, bconnors wrote: > > We won’t be using django.openid.consumer. we use USDA eAuthentication. > this is the system used by USDA agencies to enable users to obtain > accounts that will allow them to access USDA Web applications and > services

Re: Newbie Django 1.0 help with create object, uopdate object

2009-06-01 Thread adelaide_mike
Thanks for your response Tim. However, you lost me a bit there, I am a real newbie. I have narrowed my question down to this: # in views.py: class PropertyForm(ModelForm): class Meta: model = Property def property_update(request, property_id='0', street_id='0'):

Practical Django Projects 2nd Edition

2009-06-01 Thread Keyton Weissinger
Supposed to ship today, no? Has anyone heard of a delay? Keyton --~--~-~--~~~---~--~~ 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

Re: Internationalization and Apache

2009-06-01 Thread Damien MATHIEU
Based on the advices of a friend, I've tried with mod_wsgi instead of mod_python. However, it still doesn't work. And the sys.path is similar to the one I have when I do a manage.py runserver (where I correctly have my language strings). So it's not a path problem. On May 29, 1:51 am, Graham

How do I eliminate django.openid.consumer when trying to use a Pinax complete_project?

2009-06-01 Thread bconnors
We won’t be using django.openid.consumer. we use USDA eAuthentication. this is the system used by USDA agencies to enable users to obtain accounts that will allow them to access USDA Web applications and services via the Internet. How do I eliminate django.openid.consumer when trying to use a

Re: Migrating (importing) SQL dump for one model

2009-06-01 Thread Bastien
Thanks Kevin, it looks like it's not going to be easy. I think I will create the model by hand since it's not a lot of work and then I will load the data I have in the dump directly with the PostgreSQL tools and not doing it with Django. Bastien On Jun 1, 10:26 am, "K.Berkhout"

Re: Newbie Django 1.0 help with create object, uopdate object

2009-06-01 Thread Tim Sawyer
On Monday 01 June 2009 01:38:30 adelaide_mike wrote: > I found a really clear explanation of creating and updating database > objects in SAMS TeachYourself Django, but it appears to be for v > 0.96. > > I have looked at "Creating forms from models" in the documentation, > and about one-third the

contrib.comments: blank email

2009-06-01 Thread Florian Lindner
Hello, so far I understand the contrib.comments.models: user_email = models.EmailField(_("user's email address"), blank=True) The email field of a comment is not needed. Though my preview.html template (hat I've copied from the vanilla template and made only design modifications)

Re: Migrating (importing) SQL dump for one model

2009-06-01 Thread K.Berkhout
I think a database migration tool is what you're looking for. I've no experience with such tools, but you could look on http://code.djangoproject.com/wiki/SchemaEvolution for database migration tools currently available. Kevin On 1 jun, 10:09, Bastien wrote: > Hi, >

Migrating (importing) SQL dump for one model

2009-06-01 Thread Bastien
Hi, I have a running Django project with users, and a profile app for the users to fill in info on their profile. This model is quite simple with only a few fields, I want to replace it. I have a preexisting database dump that contains data about existing users of a different proforject with

Re: form adding

2009-06-01 Thread samira
I exactly mean when user go to page for the first time, it seems that is_valid function call and error message display, but as you can see in code, it is not happen. I want that user only see empty field when coming to page, and after clicking save button, is valid function call. what can I do?

Re: form adding

2009-06-01 Thread samira
I exactly mean when user go to page for the first time, it seems that is_valid function call and error message display, but as you can see in code, it is not happen. I want that user only see empty field when coming to page, and after clicking save button, is valid function call. what can I do?

Re: Question about ForeignKeys and subclasses

2009-06-01 Thread Daniel Roseman
On Jun 1, 5:39 am, Rex wrote: > Hello, > > I have a question that is best illustrated by the following fictional > example. (I put my question at the end.) > > #= > # In models.py > class Room(models.Model): >     animal = models.ForeignKey(Animal) > > class

Re: form adding

2009-06-01 Thread samira
I exactly do like when I use Django 0.96. for example this: Class AccountAdd(forms.Form): accountNo = forms.IntegerField(min_value=1, required=True, widget=forms.TextInput(attrs={'size':'10'})) def __init__(self, data=None, auto_id='id_%s', prefix=None, initial=None, instance=None):