Retaining POST DATA

2009-07-20 Thread Raashid Malik
hi all, I am sending POST data to a view But this view has login_required decorator enabled, So if i m user is not logged in, he goes to /accounts/login page and when user login, al the POST data is lost. Is there any way to maintain the actual POST data sent for view. Regards, Raashid Malik

sqlite for semi-production

2009-07-20 Thread eric.frederich
I recently bought a plug computer (http://www.plugcomputer.org/) I plan on using it to replace my fileserver and webserver. I'm not too sure that I want to run MySQL on this thing. I want to know if it is okay to run sqlite in a non-devlopment environment (meaning more than one user might be on

Re: Model save() weird behaviour

2009-07-20 Thread Brian May
On Thu, Jul 16, 2009 at 04:09:36AM -0700, Phil wrote: > def save(): ># title is received from a form, say i've entered 'QWERTY' > title1 = str(self.title) > self.fulltitle = title1 > #fulltitle = title = 'QWERTY' > self.title = 'sampletext' > su

Can the URL dispatcher know about escaped punctuation in the path?

2009-07-20 Thread James Pearce
Simple one, I'm sure. In short, can the Django URL dispatcher tell between http://site.com/first%2esecond.json and http://site.com/first.second.json ? The reason is that I have a RESTful API, where the object name can be used to address it, and I'd like the name to be able to contain periods.

Re: pre-fetch one-to-many and many-to-many relationships

2009-07-20 Thread Jason Beaudoin
Miriam, If you do take this to django-developers, please post a link here, at least.. this would be greatly appreciated. Thanks :) ~Jason On Mon, Jul 20, 2009 at 7:39 PM, Russell Keith-Magee wrote: > > On Mon, Jul 20, 2009 at 11:21 PM, Miriam wrote: > > > > Hi Russ -- > > > > Thanks for your r

Re: Django charset problem

2009-07-20 Thread Andrew Fong
Well, you already set the character set correctly on the database, so thing should just work now. If it's not, you probably just need to restart MySQL. Lemme know if you're still having trouble. -- Andrew On Jul 20, 6:58 pm, Larry wrote: > Hi Andrew, > > Thank you very much. I have changed the

Django admin doesn’t show translated enumerations in list view under Python 2.3

2009-07-20 Thread Tomas Andrle
When using localized list of "choices" for a model field, the admin doesn't show the translated values in the list view. Short example: from django.utils.translation import ugettext_lazy as _ class OrderStates: STATES = ( (STATE_NEW, _("New")), (STATE_CANCELLED, _("Cancelled

Re: Multitable inheritance and select_related() not working

2009-07-20 Thread Russell Keith-Magee
On Mon, Jul 20, 2009 at 4:30 PM, Jim wrote: > > My Django version is 1.0.2-final (http://media.djangoproject.com/ > releases/1.0.2/Django-1.0.2-final.tar.gz) > > I have an issue with select_related() not working. I can reproduce it > with the following steps: > I have followed the django tutorial

Re: Filter aggregation results

2009-07-20 Thread Russell Keith-Magee
On Tue, Jul 21, 2009 at 3:11 AM, Michel Thadeu Sabchuk wrote: > > Hi guys, > > Is there a way to filter an aggregation? Suppose the following code: > > Book.objects.annotate(num_authors=Count('authors')).order_by > ('num_authors') > > How can I count only masculine authors or authors by age? I thi

Re: customizing admin template - how to refer to specific field

2009-07-20 Thread sico
Yeah, that will do it, but it will get cumbersome quite quickly... I'm thinking if I override the change_view and add_view functions on the admin model I can set the fieldsets variable however I like! My system is down at the moment so I can't test it... does that sound like it will work? I'll r

Re: colMS and how to put stuff in sidebar??

2009-07-20 Thread sico
I'm thinking overriding the change_view on the admin model - add the extra data to extra_context and then reference it as Rajeesh suggested below... On Jul 21, 9:08 am, sico wrote: > heh... right you are! > > But how do I make extra data from other models available?   Hmmm... is > it in the Form

Re: pre-fetch one-to-many and many-to-many relationships

2009-07-20 Thread Russell Keith-Magee
On Mon, Jul 20, 2009 at 11:21 PM, Miriam wrote: > > Hi Russ -- > > Thanks for your response. I figured there must have been discussion on > this at some point, given that this is a pretty common use case, and > one that other ORMs already tackle with varying degrees of success. Is > there a ticket

Re: customizing admin template - how to refer to specific field

2009-07-20 Thread Joshua Russo
On Mon, Jul 20, 2009 at 10:26 PM, sico wrote: > > thats cool to know, but not quite what I'm after I don't think. If > there was a simple way to display the label, field and any errors all > at once would be nice otherwise it gets quite cumbersome to be > repeating that all each time. > > Basica

Re: customizing admin template - how to refer to specific field

2009-07-20 Thread sico
thats cool to know, but not quite what I'm after I don't think. If there was a simple way to display the label, field and any errors all at once would be nice otherwise it gets quite cumbersome to be repeating that all each time. Basically what I want to be able to do is to show different fields

Re: Making Django ldapauth more sophisticated

2009-07-20 Thread Joshua Russo
On Mon, Jul 20, 2009 at 9:35 PM, Daniele Procida wrote: > > I finally have ldapauth working now, and a user who is in our LDAP > database can connect as a Django User. > > But it's not entirely satisfactory. Before the LDAP user becomes a > Django User they have to try logging (which fails of cour

Re: Exception Value: coercing to Unicode: need string or buffer, ContentType found

2009-07-20 Thread Joshua Russo
On Mon, Jul 20, 2009 at 8:30 PM, sjtirtha wrote: > > class ContentAssoc(models.Model): > object_a = models.PositiveIntegerField() > type_a = models.ForeignKey(ContentType, related_name='type_a') > object_b = models.PositiveIntegerField() > type_b = models.ForeignKey(ContentType, r

Windows development server problem

2009-07-20 Thread cwurld
Hi, I have a snippet of code that runs fine as a standalone program. But when I incorporate it into a view and access that view w the development server, the snippet no longer works. What is the difference between the python interpreter and the development server? Thanks, Chuck --~--~-

Re: Django charset problem

2009-07-20 Thread Larry
Hi Andrew, Thank you very much. I have changed the settings as you said. Just one more question: for the tables and databases that I already have, is there any way in which I can make changes in place so that things will look right? I want to do this because the tables I have are quite large and

Problem with Client()'s cookies in testing framework.

2009-07-20 Thread John Bean
I'm having a problem with the cookies from a Client() disappearing. Here is the example I'm working with (also on dpaste: http://dpaste.com/hold/69285/) # This method works as expected. It does not lose any # cookie information. def followRedirect_working(response, expected_url): """

django profiles :: choices form?

2009-07-20 Thread Saketh
Hi everyone, I am making a user settings page for my application based on django- registration and django-profiles, but I'm running into a small problem in how I'd like the page to be laid out. My data model has a field that can take on only three values, 'A', 'B', and 'C'. I have modeled this a

MEDIA_ROOT and file uploads

2009-07-20 Thread Léon Dignòn
Hello everybody, I created an upload form with the help of the docs. http://docs.djangoproject.com/en/dev/topics/http/file-uploads/#topics-http-file-uploads But the handle_uploaded_file() bugs me a little bit. I set MEDIA_ROOT (MR) in the settings.py to an existing directory. I thought that file

Making Django ldapauth more sophisticated

2009-07-20 Thread Daniele Procida
I finally have ldapauth working now, and a user who is in our LDAP database can connect as a Django User. But it's not entirely satisfactory. Before the LDAP user becomes a Django User they have to try logging (which fails of course). Then they become a Django User, and then they can have their p

Re: When uploaded on server, tinymce is not recognized

2009-07-20 Thread Sonal Breed
Sorry guys, it was just some settings in settings.py and urls.py.. Works for now.. Smiles, Sonal. On Jul 20, 1:40 pm, Sonal Breed wrote: > Hi all, > > I successfully installed Django-tinymce on my local machine using > instructions given athttp://code.google.com/p/django-tinymce/ > > But when I

Exception Value: coercing to Unicode: need string or buffer, ContentType found

2009-07-20 Thread sjtirtha
Hi, I got this error below. Can anybody help me? I don't know what causes the error. It happens when I add new FilmPerson entry in Admin Interface class ContentAssoc(models.Model): object_a = models.PositiveIntegerField() type_a = models.ForeignKey(ContentType, related_name='type_a')

Foreign Keys

2009-07-20 Thread AKK
Hello, i currently have two classes in my model: class Post(models.Model): prepopulated_fields = {"post_slug": ("post_title",)} post_title = models.CharField(max_length=750) post_slug = models.SlugField() def __unicode__(self): return self.post_

Re: colMS and how to put stuff in sidebar??

2009-07-20 Thread sico
heh... right you are! But how do I make extra data from other models available? Hmmm... is it in the Form object I do this? Are formsets perhaps what I need? I haven't yet figured out how they work Does the admin site work okay with formsets ?? thanks! On Jul 21, 12:02 am, rajeesh wro

Watercrest - Technology Contractor Solutions

2009-07-20 Thread Ed
Good Afternoon DJango Users, Hope everyone is well. Came across your group while networking for a contract position that we currently have open. We need a strong python developer with experience in Django, MySQL, and ideally JSP and HTML/CSS as well. It will probably be a 2 month contract to st

Re: differences in seek method for TemporaryUploadedFile & InMemoryUploadedFile

2009-07-20 Thread ryan
answering my own question, i think this has something to do with an exhausted iterator -ryan On Jul 20, 12:39 pm, ryan wrote: > In the following code, the second loop of "for row in csv_reader:" is > empty when dealing with an InMemoryUploadedFile object.  Setting > FILE_UPLOAD_MAX_MEMORY_SIZE

When uploaded on server, tinymce is not recognized

2009-07-20 Thread Sonal Breed
Hi all, I successfully installed Django-tinymce on my local machine using instructions given at http://code.google.com/p/django-tinymce/ But when I uploaded the project dir to server, I am getting the error as "no module named tinymce" I had installed tinymce using python setup.py install optio

Re: coercing to Unicode: need string or buffer, Post found

2009-07-20 Thread AKK
Thanks, this is what i wanted. On 20 July, 20:02, Alex Gaynor wrote: > On Mon, Jul 20, 2009 at 2:00 PM, AKK wrote: > > > I kinda know what the problem is here but don't know how to fix it. > > > I have this model class Comment(models.Model): > > >    comment_post = models.ForeignKey('Post') > >

Filter aggregation results

2009-07-20 Thread Michel Thadeu Sabchuk
Hi guys, Is there a way to filter an aggregation? Suppose the following code: Book.objects.annotate(num_authors=Count('authors')).order_by ('num_authors') How can I count only masculine authors or authors by age? I think a cool way could be: Book.objects.annotate( num_authors=Count('authors

Re: coercing to Unicode: need string or buffer, Post found

2009-07-20 Thread Alex Gaynor
On Mon, Jul 20, 2009 at 2:00 PM, AKK wrote: > > I kinda know what the problem is here but don't know how to fix it. > > I have this model class Comment(models.Model): > >    comment_post = models.ForeignKey('Post') >    comment_date = models.DateTimeField('Date comment made') >    comment_body = m

coercing to Unicode: need string or buffer, Post found

2009-07-20 Thread AKK
I kinda know what the problem is here but don't know how to fix it. I have this model class Comment(models.Model): comment_post = models.ForeignKey('Post') comment_date = models.DateTimeField('Date comment made') comment_body = models.TextField() comment_spam = models.BooleanFiel

Re: Using Django's Cache

2009-07-20 Thread Daniel Roseman
On Jul 20, 5:49 pm, WilsonOfCanada wrote: > Well then I will have to try a different approach.  When using > render_to_response('webpage.html', d), I have d as a dictionary.  I > was wondering if you send a whole text file as a part of the > dictionary. > > For example: > > fileView = open('C://p

Re: Using Django's Cache

2009-07-20 Thread Luke Seelenbinder
That is entirely possible; however, it might slow down the rendering of the template, because you simply have more to handle. Luke On Jul 20, 12:49 pm, WilsonOfCanada wrote: > Well then I will have to try a different approach.  When using > render_to_response('webpage.html', d), I have d as a d

Template tags as parameter to template tag

2009-07-20 Thread phoebebright
Is there a way to get this to work: {% for tag in tags %} {% tag_link "{{tag.name}}" %} {% endfor %} The outer loop is using the standard tagging application and the tag_link is my custom template tag which has a different url depending on the type of tag

Re: where does this slug come from?

2009-07-20 Thread Alex Koshelev
On Mon, Jul 20, 2009 at 9:12 PM, tdelam wrote: > > Here is the code (question to follow): > > {% block sidebar %} > >Group >Mission dd> >Values > > {% endblock %} > > I am confused with this because, > > 1) First href renders as http://localhost:8000/group/ > 2) Second h

where does this slug come from?

2009-07-20 Thread tdelam
Here is the code (question to follow): {% block sidebar %} Group Mission Values {% endblock %} I am confused with this because, 1) First href renders as http://localhost:8000/group/ 2) Second href renders as http://localhost:8000/current-slug/mission/ 3) Finally, the t

problem getting django to run in fcgi

2009-07-20 Thread Ojii
Hi everyone I try to get django to run in fcgi on a shared hosting as described in http://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/#running-django-on-a-shared-hosting-provider-with-apache. However I get a 500 Error when loading the file in my browser and in the errorlog i get: Trac

Re: Using Django's Cache

2009-07-20 Thread WilsonOfCanada
Well then I will have to try a different approach. When using render_to_response('webpage.html', d), I have d as a dictionary. I was wondering if you send a whole text file as a part of the dictionary. For example: fileView = open('C://path//main_cities.txt', 'r+') d['main_cities'] = fileView

differences in seek method for TemporaryUploadedFile & InMemoryUploadedFile

2009-07-20 Thread ryan
In the following code, the second loop of "for row in csv_reader:" is empty when dealing with an InMemoryUploadedFile object. Setting FILE_UPLOAD_MAX_MEMORY_SIZE equal to zero forces the use of a TemporaryUploadedFile object and solves the problem. It seems that seek(0) doesn't work with an InMe

Re: Get Top 10 Books by Rating and User

2009-07-20 Thread The Danny Bos
Andrew, I got lazy and installed 1.1, worked out I was able to quite easily. Your code worked perfectly. One more twist, is it possible to also match it against a Tag in a Books tags? For instance, 'Book Name' has the tags "Vampire, Blood, Beachball". I want to display the Top 10 Vampire books.

Re: pre-fetch one-to-many and many-to-many relationships

2009-07-20 Thread Miriam
Hi Russ -- Thanks for your response. I figured there must have been discussion on this at some point, given that this is a pretty common use case, and one that other ORMs already tackle with varying degrees of success. Is there a ticket on the subject? If so, I'd love to shift the conversation ov

Model inheritance problem, inherited instances

2009-07-20 Thread Peter Cicman
Hi, i didn't found noting about it in docs, so i'll try to ask, first explanation, i have: class A(models.Model): name = models.CharFiled(, required=True) . class B(A): I have an existing instance of A, say `a` and i "want to make" instance of b out of it. i'm lookin

Re: Current user in model.save() context

2009-07-20 Thread Joshua Russo
On Mon, Jul 20, 2009 at 9:23 AM, Matthias Kestenholz < matthias.kestenh...@gmail.com> wrote: > thread locals have all the problems which are generally associated > with global variables. They might be overwritten by other code, they > make testing extremely difficult because the behavior of method

Re: Django charset problem

2009-07-20 Thread Andrew Fong
Yeah, that output doesn't look correct. You're getting back two characters for ø when there should be just one. One possibility is that while you've set up the database server to store things as utf8, the client hasn't been set to read them. You can do this manually from the client, but if you ha

Re: Get Top 10 Books by Rating and User

2009-07-20 Thread The Danny Bos
That's fine Andrew. I appreciate it ... d On Jul 21, 12:44 am, Andrew Fong wrote: > Unfortunately, it looks the aggregation / sum stuff is in the SVN > version only for now. > > I'm not aware of any other way to do this with the Django 1.0 ORM > though. As a fallback, you could rely on raw

Re: Get Top 10 Books by Rating and User

2009-07-20 Thread Andrew Fong
Unfortunately, it looks the aggregation / sum stuff is in the SVN version only for now. I'm not aware of any other way to do this with the Django 1.0 ORM though. As a fallback, you could rely on raw SQL I suppose. http://docs.djangoproject.com/en/1.0/topics/db/sql/ Sorry I couldn't be more helpf

Re: Get Top 10 Books by Rating and User

2009-07-20 Thread The Danny Bos
I'm not able to use anything over Django 1.0.2. Does SUM work for this version, I'm getting the error: Could not import #.views. Error was: cannot import name Sum Is there another way around this? Thanks for your time and energy guys, d On Jul 21, 12:22 am, Andrew Fong wrote: > The rel

Re: Django charset problem

2009-07-20 Thread Larry
HI Andrew, Thanks for your reply. I tried it via Django's shell, one message which appears "Isbjørn" in the MySQL client is displayed as "Isbj\xc3\xb8rn" in the Django shell. Is this normal or there is already something wrong? The way I configure MySQL is that I use some parameters when creating

Re: combining valueslistqueryset with a simple list

2009-07-20 Thread Alex Gaynor
On Mon, Jul 20, 2009 at 6:48 AM, Viktor wrote: > > Hi, > > I would like to run something like > > ["User",].expand(MyObject.objects.all().values_list('myfield', > flat=True) > > but expand seemingly can't handle this operation. > I was trying MyValuesListQuerySet.insert, but it fails as well (This

Re: Get Top 10 Books by Rating and User

2009-07-20 Thread Andrew Fong
The relevant documentation btw: http://docs.djangoproject.com/en/dev/topics/db/aggregation/ http://docs.djangoproject.com/en/dev/topics/db/queries/#lookups-that-span-relationships On Jul 20, 10:18 am, Andrew Fong wrote: > Assuming your models are like this: > > class Book(models.Model): >     n

Re: django-registration .missing templates?

2009-07-20 Thread James Bennett
On Mon, Jul 20, 2009 at 9:10 AM, zayatzz wrote: > If you are going to test django registration, then remember, that it > sends info by email with activation key. I had to turn that off, > because i could not find free SMTP server and my ISP is blocking ports > used by my own SMTP server. If sendin

Re: Redundant SQL queries regarding DELETE ALL

2009-07-20 Thread Alex Gaynor
On Mon, Jul 20, 2009 at 1:10 AM, aXqd wrote: > > On Mon, Jul 20, 2009 at 12:00 PM, Alex Gaynor wrote: >> >> On Sun, Jul 19, 2009 at 9:51 PM, aXqd wrote: >>> >>> Hi, all: >>> >>> I encountered another redundant SQL query problem while using django. >>> And this time it might even cause a defect of

Re: Get Top 10 Books by Rating and User

2009-07-20 Thread Andrew Fong
Assuming your models are like this: class Book(models.Model): name = models.CharField(max_length=128) class User(models.Model): is_staff = models.BooleanField(default=False) class Rating(models.Model): user = models.ForeignKey(User) score = models.IntegerField(default=3) boo

Re: django-registration .missing templates?

2009-07-20 Thread zayatzz
Hehe i had exactly the same problem. I was intimidated by the fact that i had to create template for something i had not done myself before. Especially because i had only created few templates before. But actually it is really easy and good learning experience that teaches you hot to reuse django

Re: never_cache doesn't work for login page

2009-07-20 Thread Michael
On Sun, Jul 19, 2009 at 9:08 AM, Ronghui Yu wrote: > It proves that it is introduced by > django.middleware.http.ConditionalGetMiddleware. > It returns 304 when requesting the same login page, so at last the browser > uses the former one. > It works fine after removing this middleware. > I beli

Get Top 10 Books by Rating and User

2009-07-20 Thread The Danny Bos
Hey there, I'm looking at getting a Top 10 of all Books on a site, but only where rated by users of a certain Group. Here's what I've got so far: book = Book.objects.all() Somewhat impressive, hey? - So, my tables/models are Book, Rating, User. - I save all ratings in Rating like so

Rename uploaded files

2009-07-20 Thread Aurélien APTEL
Hi, I'm uploading images (represented by a FileField) and I need to rename those files when they are uploaded. I want them to be formated like that "%d-%d-%s.%s" % (width, height, md5hash, original_extension) I've read the documentation and I think a need to write my own FileSystemStorage class b

Get Top 10 Books by Rating and User

2009-07-20 Thread The Danny Bos
Hey there, I'm looking at getting a Top 10 of all Books on a site, but only where rated by users of a certain Group. Here's what I've got so far: book = Book.objects.all() Somewhat impressive, hey? - So, my tables/models are Book, Rating, User. - I save all ratings in Rating like so

Re: A simple use for multidb... is this possible yet?

2009-07-20 Thread JL
thanks for the response Alex... you've most definitely saved me some time in digging around. I'm going to work on this today and I'll let you know how it goes. For the record, I think your work on multidb is great. This work is going to be what ultimately lets me begin to build apps that are mo

Re: Admin: adding user with profile

2009-07-20 Thread alecs
OK, if I delete 'default' values max_folder_size = models.IntegerField(max_length=15) everything works OK. But how to insert default values to the user edit page into admin.TabularInline fields ? --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: never_cache doesn't work for login page

2009-07-20 Thread Eugene Mirotin
May be the order of middleware classes does matter here? On Jul 19, 4:08 pm, Ronghui Yu wrote: > It proves that it is introduced by > django.middleware.http.ConditionalGetMiddleware. It returns 304 when > requesting the same login page, so at last the browser uses the former one. > It works fine

Re: Model save() weird behaviour

2009-07-20 Thread Phil
anyone? any ideas? :) On Jul 17, 11:00 am, Phil wrote: > oh, sorry for that - exampling mistake, should be: > > class Page(models.Model): >     title = models.CharField(_(u"Title"), max_length=50) >     fulltitle = models.CharField(_(u"Full Title"), max_length=50) > ... > >     defsave(): >    

Re: colMS and how to put stuff in sidebar??

2009-07-20 Thread rajeesh
On Jul 20, 4:06 am, sico wrote: > Hi, > > Using django 1.0.2 and I'd like to put some extra read-only info in a > sidebar on the editing forms for specific models. > > coltype= colMS looks perfect for this, but how/where do I tell django > what I want to put in the sidebar?? > > thanks, > Simon

Re: django-registration .missing templates?

2009-07-20 Thread David De La Harpe Golden
Reiner wrote: > The documentation states that you need to write these templates > yourself, no examples are included with the package. > However, IIRC (I may not, ended up not using django-registration in the end due to differing workflow requriements) the templates that are included in the djan

combining valueslistqueryset with a simple list

2009-07-20 Thread Viktor
Hi, I would like to run something like ["User",].expand(MyObject.objects.all().values_list('myfield', flat=True) but expand seemingly can't handle this operation. I was trying MyValuesListQuerySet.insert, but it fails as well (This is I can understand though. :)) could someone help me on the b

Re: customizing admin template - how to refer to specific field

2009-07-20 Thread rajeesh
On Jul 20, 9:38 am, sico wrote: > Its quite simple to customize the admin template for a specific model > by creating a change_form.html in the templates/admin// > / directory. > > But, is it possible to refer to particular fields in the model/form > directly? > > Instead of using the loops: >

Re: How does my Model gets the objects attribute

2009-07-20 Thread Joshua Partogi
Thanks Russel, You've always been very helpful. :-) Now that I get the basic idea of how it works, I will get some resources on Python metaprogramming. It seems to be used heavily in Django ORM. Kind Regards, On Mon, Jul 20, 2009 at 8:45 PM, Russell Keith-Magee wrote: > > On Mon, Jul 20, 2009

Re: Django, MySQL - bug?

2009-07-20 Thread Tomasz Zieliński
I tried this: import MySQLdb db = MySQLdb.connect(...) c = db.cursor() c.execute("create table mtest (pk int not null auto_increment primary key, s varchar(5)) type=InnoDB") print c.execute("insert into mtest values (null,'12345')") print c.messages print c.lastrowid print c.execute("insert int

Re: How does my Model gets the objects attribute

2009-07-20 Thread Russell Keith-Magee
On Mon, Jul 20, 2009 at 4:05 PM, Joshua Partogi wrote: > Dear all, > > This may seems trivial. I've been looking at django source code > model/base.py and been looking around how django gives my model an objects > attribute but can not find it. I can see that the ModelBase will give the > _default

Re: weird ValueError

2009-07-20 Thread V
stupid error, thank you On Jul 20, 12:23 pm, Daniel Roseman wrote: > On Jul 20, 11:13 am, Viktor wrote: > > > my view calls > > > survey = get_object_or_404(models.Survey, {'pk': int(survey_id)}) > > > and gives a ValueError: need more than 1 value to unpack, the full > > traceback is athttp://

Re: weird ValueError

2009-07-20 Thread Daniel Roseman
On Jul 20, 11:13 am, Viktor wrote: > my view calls > > survey = get_object_or_404(models.Survey, {'pk': int(survey_id)}) > > and gives a ValueError: need more than 1 value to unpack, the full > traceback is athttp://python.pastebin.com/m3f715909 > > I have no clue what the problem might be, espec

Re: Current user in model.save() context

2009-07-20 Thread Matthias Kestenholz
On Mon, Jul 20, 2009 at 9:26 AM, Bartłomiej Górny wrote: > [...] >> there is a cookbook recipe for achieving this sort of thing: >> >> http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser > > Yep, that's exactly what I did :) > >> >> That's deep in the category of 'give them rope to hang

weird ValueError

2009-07-20 Thread Viktor
my view calls survey = get_object_or_404(models.Survey, {'pk': int(survey_id)}) and gives a ValueError: need more than 1 value to unpack, the full traceback is at http://python.pastebin.com/m3f715909 I have no clue what the problem might be, especially as I've seen that in the debug views I've

OSX - says view is missing but it isn't

2009-07-20 Thread phoebebright
My development environment has just started behaving strangely. If I cause an error, fix it and call the same URL again (not refresh, just enter link) I get ViewDoesNotExist: Could not import tweetlog.views. Error was: cannot import name parse_tweet The module and view are fine and if I go to

Re: django-registration .missing templates?

2009-07-20 Thread phoebebright
Send me an email and I will post back the forms I used. email username as above plus spamcop.net. On Jul 19, 6:08 pm, Asinox wrote: > Hi guys, im trying to use the django-registration...im new with > django, but i was thinking that maybe some templates are missing, like > registration, login...

Admin: adding user with profile

2009-07-20 Thread alecs
Hi all :) A small problem when trying to add a new user via admin web interface: Fields from UserProfile can be found on the edit user page (at the bottom of it) and they are filled with default values, but if I'm adding a new user and press 'Save' they are not actually added to myapp_userprofile

Re: Current user in model.save() context

2009-07-20 Thread Bartłomiej Górny
Matthias Kestenholz wrote: > On Fri, Jul 17, 2009 at 4:24 PM, Bartłomiej Górny wrote: >> Phil wrote: >>> Hi Josh, >>> >>> unfortunately it seems that there is no way to do so. As you've >>> noticed that correctly you can use request (request.user) in any place >>> but model save. >> Yes, I bumped

Re: 'dict' object has no attribute 'autoescape'

2009-07-20 Thread 前祁
In the tag code change the return self.nodelist.render(ret) to context.update(ret) return self.nodelist.render(context) On Thu, Apr 24, 2008 at 8:48 AM, James Bennett wrote: > > On Wed, Apr 23, 2008 at 6:59 PM, falcon wrote: > > 94. if (context.autoescape and not isinstance(output, >

Re: django-registration .missing templates?

2009-07-20 Thread Reiner
The documentation states that you need to write these templates yourself, no examples are included with the package. http://bitbucket.org/ubernostrum/django-registration/src/tip/docs/overview.txt#cl-161 On Jul 19, 7:26 pm, Asinox wrote: > ok,  ...there no exist's > > :( --~--~-~--~~

Multitable inheritance and select_related() not working

2009-07-20 Thread Jim
My Django version is 1.0.2-final (http://media.djangoproject.com/ releases/1.0.2/Django-1.0.2-final.tar.gz) I have an issue with select_related() not working. I can reproduce it with the following steps: I have followed the django tutorial to set up a simple django project mysite with the polls a

How does my Model gets the objects attribute

2009-07-20 Thread Joshua Partogi
Dear all, This may seems trivial. I've been looking at django source code model/base.py and been looking around how django gives my model an objects attribute but can not find it. I can see that the ModelBase will give the _default_manager attribute, but where and how does this objects attribute g