Re: Problem with contrib.comments and signals: instance is not defined

2008-10-24 Thread Eric Abrahamsen
On Oct 24, 2008, at 12:23 PM, Brandon Taylor wrote: > > Hi everyone, > > I'm using Django 1.0, and attempting to do some comment moderation > with Akismet. When I try to wire up a pre_save signal, I'm getting an > error saying 'instance' is not defined. Here is my code: You might also consider

Re: comment_was_posted

2008-10-29 Thread Eric Abrahamsen
On Oct 29, 2008, at 6:01 PM, sam wrote: > > hello, > > I try to redirect a user who comments a post on my blog to the same > page, > to do that, i need to use the signal : 'comment_was_posted' > > i have put the code below in my blog 'models.py' to be sure it has > been loaded, > but when i post

Re: Syndication Feed-Problem

2008-10-30 Thread Eric Abrahamsen
On Oct 30, 2008, at 7:04 PM, [EMAIL PROTECTED] wrote: > > Hi, > i hope any one can help me. > I want to generate a rss-feed. > The url ist http://localhost:8000/isf/info/. > All works fine but the title of an Item and the Description are still > the same! > How can i change the title of an feed

Re: Forms Question

2008-11-03 Thread Eric Abrahamsen
On Nov 4, 2008, at 8:14 AM, Robocop wrote: > > I'm working with some rather long forms, and i've processed them in a > pretty basic way. I read in the post data for every field, then just > create a new table entry using the form data. > > Something like: > if request.method == 'POST': > if fo

Re: How to log the cause of a 500 error

2008-11-05 Thread Eric Abrahamsen
On Nov 6, 2008, at 6:11 AM, Delta20 wrote: > > I just realized that I accidentally named the template 400.html not > 404.html... d'oh. I definitely need a better way of diagnosing 500 > errors. > > Thanks to the pointer to the email settings. I will set that up, but > I'm wondering if there's a

Re: Modify uploaded image

2008-11-30 Thread Eric Abrahamsen
On Nov 30, 2008, at 10:36 PM, Alex Jonsson wrote: > > Hey guys, > > I have an application where I want my users to be able to upload a > picture. The model contains a name field and a ImageField. > > My question is how the easiest way would be to modify this image > before saving it? That is, cr

Re: XML templates

2008-12-01 Thread Eric Abrahamsen
On Dec 1, 2008, at 7:51 PM, Vicky wrote: > > Can we use XML files as templates instead of HTML? Anything that comes as a plain text file can be produced by a template: HTML, XML, plain text, email, iCAL, source code... Yours, Eric > > > --~--~-~--~~~---~--~---

Re: XML templates

2008-12-02 Thread Eric Abrahamsen
On Dec 2, 2008, at 5:50 PM, Vicky wrote: > > I did as you said. Still its giving the same error :( Are you using forward slashes instead of backslashes? The docs indicate that's necessary... > > > > > > On Dec 2, 11:38 am, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: >> On Mon, 2008-12-0

Re: XML templates

2008-12-02 Thread Eric Abrahamsen
On Dec 2, 2008, at 5:50 PM, Vicky wrote: > > I did as you said. Still its giving the same error :( Do you have the correct permissions on the TEMPLATE_DIRS directories? Have you written the paths with forward slashes? That's all I can think of. E > > > > On Dec 2, 11:38 am, Malcolm Tredin

Re: template tag

2008-12-05 Thread Eric Abrahamsen
On Dec 6, 2008, at 8:31 AM, Alfredo Alessandrini wrote: > > Hi, > > I've this variable in my template: {{ challenger.rating }} > > It'a a number... > > Can I calculate a sum like this: > > {{ challenger.rating }} + 200 ?? > > I must write a custom tag? There's already a filter for that: http

misreporting verify_exists

2008-12-06 Thread Eric Abrahamsen
I've got a model with a URLField, with verify_exists set to True, which has suddenly started barfing "broken link" on a certain URL. I'm quite sure the URL exists, and can't figure out why it can't get past validation. This is the link: http://www.rochester.edu/College/translation/threeperc

Re: misreporting verify_exists

2008-12-06 Thread Eric Abrahamsen
On Dec 7, 2008, at 11:44 AM, Malcolm Tredinnick wrote: > > > On Sun, 2008-12-07 at 14:42 +1100, Malcolm Tredinnick wrote: > [...] > >> So have a look at the result of something like "curl -I http://... >> " (or >> equivalent tool if you don't have curl around). Basically, force a >> HEAD >> re

Re: Too Many Connections

2008-12-09 Thread Eric Abrahamsen
On Dec 10, 2008, at 1:30 AM, DULMANDAKH Sukhbaatar wrote: > >> File >> "/usr/local/python2.5/lib/python2.5/site-packages/ >> MySQL_python-1.2.2-py2.5-linux-i686.egg/MySQLdb/__init__.py", >> line 74, in Connect >> >> File >> "/usr/local/python2.5/lib/python2.5/site-packages/ >> MySQL_python-1

Re: The view didn't return an HttpResponse object.

2008-12-16 Thread Eric Abrahamsen
On Dec 17, 2008, at 3:23 PM, oops wrote: > > def OrderPlacedView(request): >form = OrderPlaceForm() >try: >print "try" >print request.POST >#brand = BrandName.objects.get(pk=request.POST['brand']) >except: >print"nothing" >return render_to_resp

Re: Django form HTML is rendered as TEXT

2008-12-25 Thread Eric Abrahamsen
On Dec 26, 2008, at 10:56 AM, s4shre...@gmail.com wrote: > > Hi Guys, > I am new to Django . My Django form HTML is rendered as TEXT . It > does not display the HTML as such. Are you maybe getting autoescaped? http://docs.djangoproject.com/en/dev/topics/templates/#id2 Eric > > > Please assi

setting cookies following comment post

2009-01-03 Thread Eric Abrahamsen
Hi there, I'm adding a "remember me" checkbox to comment forms, so that regular commenters can avoid having to enter their personal information, if they want. I was originally thinking of making this a function attached to the comment_was_posted signal, but it will have to be implemented

Re: AttributeError when trying to access the Admin application

2009-01-04 Thread Eric Abrahamsen
DDLEWARE_CLASSES = ("django.contrib.sessions.middleware.SessionMiddleware", "django.contrib.auth.middleware.AuthenticationMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.doc.XViewMiddleware") Give that a shot. Eric >

Re: AttributeError when trying to access the Admin application

2009-01-04 Thread Eric Abrahamsen
r.is_staff > > Exception Type: AttributeError at /admin/ > Exception Value: 'WSGIRequest' object has no attribute 'user' > +++ > > I'm new to Django and I'm reading "The Definitive Guide to Django" > which seems to me too out dated...

Re: AttributeError when trying to access the Admin application

2009-01-04 Thread Eric Abrahamsen
On Jan 4, 2009, at 4:58 PM, HB wrote: > > Hey, > I'm trying to create Admin application for my Django project, here are > some snippets: > +++ > from django.contrib import admin > admin.autodiscover() > > urlpatterns = patterns('', > (r'^admin/(.*)', admin.site.root), > ) > > INSTALLED_APPS = (

Re: AttributeError when trying to access the Admin application

2009-01-04 Thread Eric Abrahamsen
ry posting the full traceback, and if that doesn't jog my memory we'll just see if someone else can jump in... E > On Jan 4, 1:06 pm, Eric Abrahamsen wrote: >> On Jan 4, 2009, at 4:58 PM, HB wrote: >> >> >> >> >> >>> Hey, >&g

Re: FileSystemStorage content vs PIL Image

2009-01-04 Thread Eric Abrahamsen
On Jan 5, 2009, at 6:51 AM, Donn wrote: > > Hi, > I am stuck on the interface between a PIL Image and a > FilesystemStorage 'content' object. > > I can: img = Image.open(content) > But how do I pass 'img' back to Django for saving? > > My short class is pasted at end. The problem reported stems

Re: FileSystemStorage content vs PIL Image

2009-01-04 Thread Eric Abrahamsen
On Jan 5, 2009, at 6:51 AM, Donn wrote: > > Hi, > I am stuck on the interface between a PIL Image and a > FilesystemStorage 'content' object. > > I can: img = Image.open(content) > But how do I pass 'img' back to Django for saving? > > My short class is pasted at end. The problem reported stems

Re: FileSystemStorage content vs PIL Image - **Initial solution**

2009-01-05 Thread Eric Abrahamsen
On Jan 5, 2009, at 7:47 PM, Donn wrote: > > On Monday, 05 January 2009 00:51:03 Donn wrote: >> I am stuck on the interface between a PIL Image and a >> FilesystemStorage 'content' object. >> >> I can: img = Image.open(content) >> But how do I pass 'img' back to Django for saving? > > I have some

Re: Redirect User on First Log In

2009-01-05 Thread Eric Abrahamsen
On Jan 6, 2009, at 6:41 AM, Aruna wrote: > > I'm trying to redirect a user on their first log in, to a special > welcome page. Subsequent logins will go to a regular page. Is there a > way to do that in the templates? Does Django have a way to check if > it's a users first login? User instances

Re: Process file after upload

2009-01-07 Thread Eric Abrahamsen
On Jan 7, 2009, at 9:32 PM, dmishe wrote: > > Hey. > > I have FielField in my model for user to upload ZIP-archives. I want > to unpack that zip, place some files in some dirs and delete it just > after user uploaded it in admin. > > How can i do this? Model's save won't work because it gets cal

Re: HttpResponse HTML links missing URL prefix when emailing

2009-01-08 Thread Eric Abrahamsen
On Jan 8, 2009, at 8:37 PM, Eki wrote: > > Hi guys, > > I'm implementing a view which sends a (nightly) status report email. > The code works mostly fine. I can both receive the email and see the > result rendered as I query the view. The HTML shown and emailed is > gotten from the same response

Re: first newbie question

2009-01-09 Thread Eric Abrahamsen
On Jan 9, 2009, at 10:19 PM, _Sebastian_ wrote: > > Hi all, > > I've been following the tutorial > http://docs.djangoproject.com/en/dev/intro/tutorial01/#playing-with-the-api > and working on a own test-project as well. > > so I tried to adapt from > > class Poll(models.Model): >question =

small contenttypes mystery

2009-01-10 Thread Eric Abrahamsen
I've got a Topic model, which is a bit like a category. Then there are TopicItem objects, which have a foreign key to a Topic, and a generic foreign key to anything else in the website, so that I can attach anything to a particular Topic. In my admin site, a few models have a generic inlin

Re: setting cookies following comment post

2009-01-11 Thread Eric Abrahamsen
#x27;,remember_wrapper(comments.post_comment)), (r'^comments/', include('django.contrib.comments.urls')), ...and more... ) The views that display comment forms check for this cookie, and use the information to populate the form. I suppose that could be done as a context process

Re: Adding a view inside a view?

2009-01-14 Thread Eric Abrahamsen
On Jan 15, 2009, at 2:42 AM, Bradley wrote: > > I'm new to Django and I'm trying to modify an existing django website > for a local newspaper. They would like to have a polls on the their > website. I just used the tutorial from the djangoproject website to > create the polls module. It works

Re: cant access non-django web page after deploy django on localhost

2008-07-15 Thread Eric Abrahamsen
On Jul 15, 2008, at 3:15 PM, Evert wrote: > >> I deployed my Django Application onto the localhost using Apache. >> Below are the changes i did in the httpd.conf >> >> >>ServerName localhost >>SetHandler python-program >>PythonHandler django.core.handlers.modpython >>PythonDebug

Re: Request object in template HTML

2008-07-15 Thread Eric Abrahamsen
On Jul 15, 2008, at 9:55 PM, Nazmi ZORLU wrote: > Hi, > > I wonder if I can access request object in html template or absolute > page url that currently rendering. If you're not using generic views, you can pass "context_instance=RequestContext(request)" as a third argument to render_to_re

Re: capture http code 413 (file size too large)

2008-07-15 Thread Eric Abrahamsen
If you wanted to do this purely within django, you could write a custom middleware that reads a 'request body max size' setting from settings.py, then checks the content-length header on incoming request against that setting and returns a custom 413 if it's too large. I believe that doing

multiple one-to-one relationships

2008-07-15 Thread Eric Abrahamsen
I've got an issue with multiple one-to-one relationships, which probably arises from poor design decisions on my part. Given a model like the following: class Translator(models.Model): user = models.OneToOneField(User, unique=True, blank=True, null=True, help_text="If this translator i

Re: multiple one-to-one relationships

2008-07-16 Thread Eric Abrahamsen
> Saving how, exactly? If admin, newforms-admin or old admin? If old > admin, have you tried it on newforms-admin -- bugs in old admin are > unlikely to get any attention at this point. If saving in your own > code, more details of that code would help. > This is saving through the old a

Re: multiple one-to-one relationships

2008-07-16 Thread Eric Abrahamsen
> As documented in the backwards-incompatibility notes from the > queryset-refactor merge, OneToOneFields in (existing) admin are not > supported. They didn't work before the qsrf merge reliably, either, so > no functionality was lost in the process. Sweet, I'm switching to nf-ad. Thanks a lot.

Re: newforms-admin branch has been merged into trunk

2008-07-18 Thread Eric Abrahamsen
Beers all around! On Jul 19, 2008, at 8:01 AM, Brian Rosner wrote: > > I have just recently merged the newforms-admin branch into trunk as of > r7967 [1]. This is an extremely backward incompatible change. The > entire admin application in contrib has been refactored. The newforms > module has a

Re: superuser has no rights with newforms admin

2008-07-19 Thread Eric Abrahamsen
> I've tried alternating between using admin.autodiscover() in my > urls.py, and manually registering my models using > admin.site.register(Person), but I still get the permission error in > the admin site. I've also tried flushing the database, but that > doesn't seem to solve anything. FWIW, my

Re: Django Page - Db Connections count

2008-07-22 Thread Eric Abrahamsen
You could try the debug middleware: http://www.djangosnippets.org/snippets/766/ or the page stats middleware: http://code.djangoproject.com/wiki/PageStatsMiddleware and this article by Simon Willison is a good general resource: http://simonwillison.net/2008/May/22/debugging/ Yours, Eric On J

Re: Combining feeds

2008-08-22 Thread Eric Abrahamsen
Hey Eric, I've done this with two different models, the main trick was in the Feed class's items() method. What I'm doing is a little ugly: calling list() on the two querysets, appending one list to the other, then sorting the result using a function that determines which date attribute t

Re: Custom manager for many-to-many traversal

2008-08-25 Thread Eric Abrahamsen
On Aug 25, 2008, at 3:11 PM, MrJogo wrote: > > How do I create a custom manager for many-to-many traversal? An > example will illustrate what I want to do better. Suppose I have the > following models.py: > > class Book(models.Model): > title = models.CharField(max_length=100) > > class Author(

Re: Custom manager for many-to-many traversal

2008-08-26 Thread Eric Abrahamsen
ll solve these kinds of problems) so will say no more... E > > > On Aug 26, 2:10 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: >> On Aug 25, 2008, at 3:11 PM,MrJogowrote: >> >> >> >> >> >>> How do I create a custom manager for many-to

Re: Custom manager for many-to-many traversal

2008-09-01 Thread Eric Abrahamsen
you posted is really the one you want to use, and I might be able to help with the next step... Yours, Eric > I tried to figure these things out on my own, but I just couldn't wrap > my head around it. > > On Aug 26, 2:32 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: &g

Re: Open URL from Django

2008-09-07 Thread Eric Abrahamsen
On Sep 7, 2008, at 6:40 PM, Bojan Mihelac wrote: > > I have try similiar code under both Django dev server and Apache/ > mod_python. Apache did load the result, while Django server did not. > > Is this maybe threading issue? Nope, that's the way the Django development server works – it's single

comparing Model instances

2008-09-11 Thread Eric Abrahamsen
I'm fooling around with comparing instances of different models, trying to make a unified stream of instances that can be sorted by date according to a certain datetime attribute on each model. I thought I'd define a __cmp__ method on each model in question, that would provide the appropri

Re: comparing Model instances

2008-09-11 Thread Eric Abrahamsen
On Sep 12, 2008, at 6:05 AM, Malcolm Tredinnick wrote: > > > On Thu, 2008-09-11 at 17:27 -0400, Steve Holden wrote: > [...] >> I've got some timings lying around somewhere that clearly show the >> decorate/sort/undecorate implementation is way faster under normal >> circumstances. > > True. That

akismet and the new comments app

2008-09-12 Thread Eric Abrahamsen
Has anyone tried using akismet with the new comments contrib app? I've set up a signal handler to run on 'comment_will_be_posted' and check the comment with akismet, and the service is insisting my test comments are spam no matter what. I'm using the voidspace python akismet API, and large

Re: Using slug in comments urls

2008-09-12 Thread Eric Abrahamsen
On Sep 13, 2008, at 8:32 AM, Shantp wrote: > > Hi, > > I did a lot of searching on this and can't figure out what I'm doing > wrong. Here's what's in my urls.py: > > share_detail = { > 'queryset': Share.objects.all(), > } > > (r'^comments/', include('django.contrib.comments.urls')), > (r'^

Re: akismet and the new comments app

2008-09-13 Thread Eric Abrahamsen
On Sep 13, 2008, at 12:46 PM, Thejaswi Puthraya wrote: > > On Sep 12, 7:09 pm, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: >> Has anyone tried using akismet with the new comments contrib app? >> I've >> set up a signal handler to run on 'comment_will_

Re: Error: No module named X (django standalone script)

2008-09-17 Thread Eric Abrahamsen
On Sep 17, 2008, at 11:45 PM, Mathieu Leplatre wrote: > > Hi all, > > I am starting a new thread, the first one became off-topic (http:// > groups.google.com/group/django-users/browse_thread/thread/ > 34b501d2d1f88496/f8a5d5ef5aeab62a) > > I want to do a simple external script that just relies o

'next' value in comment post/preview

2008-09-22 Thread Eric Abrahamsen
Somewhat pursuant to this thread: http://groups.google.com/group/django-users/browse_thread/thread/a0c468f0c81bb197# a hidden 'next' field in the comment post form doesn't get carried over to the comment preview view. It seems like if you're going to have a manual 'next' value possible in the

Re: 'next' value in comment post/preview

2008-10-03 Thread Eric Abrahamsen
On Sep 23, 11:07 am, Eric Abrahamsen <[EMAIL PROTECTED]> wrote: > Somewhat pursuant to this > thread:http://groups.google.com/group/django-users/browse_thread/thread/a0c4... > > a hidden 'next' field in the comment post form doesn't get carried   > over t

Re: Extend contrib.comments?

2008-10-07 Thread Eric Abrahamsen
On Oct 7, 2008, at 11:38 PM, fitzage wrote: > > I want to add one additional piece of data to the comment form. > Basically a checkbox that says whether or not the commenter wants to > be notified of followup comments. I just did exactly this, and found that what works best is not just to add

Re: Extend contrib.comments?

2008-10-08 Thread Eric Abrahamsen
mization yet. Once ticket 8630 [1] is resolved, > the proper way to do this will be to create your own app with a > get_form() function in __init__.py, and then set COMMENTS_APP to point > to your app. Thanks for the head's up, Carl, I'll keep an eye on the ticket. E > &g

Re: Why cannot get a hidden input value by POST method?

2008-10-10 Thread Eric Abrahamsen
On Oct 10, 2008, at 5:14 PM, GAEFans wrote: > > OS: windows XP > SDK: Google App Engine 1.1.3 (Django / 0.96.1) > > template snippets: > ... > > > > You've got "value" misspelled for these two fields, correct that and try again... E > > > > E-mail: > > readonly=

Re: Getting lists/dictionaries out of the database

2008-10-17 Thread Eric Abrahamsen
On Oct 18, 2008, at 4:38 AM, timc3 wrote: > > Thanks for the help. Yeah, my terminology is quite often wrong, to > much context switching with other things. > > Unfortunately I am never sure what will go in to that field, just data > that's sourced from various types of media, and populated from

Re: ViewDoesNotExist No module. where is it being called, I don't want it to.

2008-10-17 Thread Eric Abrahamsen
On Oct 18, 2008, at 3:42 AM, KillaBee wrote: > > I keep getting this error that says ViewDoesNotExist: Could not > import intranet.timesheets.views. Error was: No module named User. No > i do not have a User module, I don't want nor need one. How do I find > out Where it is being call at? I

Re: Getting lists/dictionaries out of the database

2008-10-18 Thread Eric Abrahamsen
a pickle, so some searching should be possible, shouldn't it? E > > > OTOH, pickling will be more compact, and safer, depending on how you > reconstitute it... > > --Ned. > http://nedbatchelder.com > > Eric Abrahamsen wrote: >> >> On Oct 18, 2008, at 4:38 A

Re: Returning Queryset that excludes certain results from another queryset.

2008-10-20 Thread Eric Abrahamsen
On Oct 21, 2008, at 5:38 AM, timc3 wrote: > > So I have a model that looks like this: > > class GroupsOfUser(models.Model): >name = models.CharField(_("Name"), max_length=50) >description = models.TextField(_("Description"), blank=True, > help_text=_("Optional")) >slug = models.SlugF

Re: How do i combine a list and a form in the same page using django?

2009-01-16 Thread Eric Abrahamsen
On Jan 16, 2009, at 5:10 PM, Gath wrote: > > Am building a Q&A page, sort of stackoverflow.com kinda page! Am > having a bit of a problem trying to render the form. Am pasing 3 > objects to the template that renders the page i.e. Question object, > Answers related to the question and Answer form

Re: Definitive Captcha?

2009-01-17 Thread Eric Abrahamsen
There's not really much needed to get captcha or recaptcha working with django, mostly just a class or two. When I was using recaptcha I found that this module: http://code.google.com/p/recaptcha-django/ did most of what I needed. If you're shopping, however, I'd recommend Akismet (http://ww

Re: I am doing the tutorial part 1 and i got this error

2009-01-19 Thread Eric Abrahamsen
On Jan 19, 2009, at 4:17 PM, jazz wrote: > > c:\projects\mysite>python manage.py sql polls > Traceback (most recent call last): > File "manage.py", line 11, in >execute_manager(settings) > File "C:\Python25\Lib\site-packages\django\core\management > \__init__.py", line 340, in execute_man

Re: Anyway to see full UrlConf list of available imported urls?

2009-01-22 Thread Eric Abrahamsen
Here's one way. There's likely a cleaner option somewhere else: from django.core.urlresolvers import get_resolver r = get_resolver('mysite.urls') for pattern in r._get_url_patterns(): print pattern That works, at any rate. Yours, Eric On Jan 23, 2009, at 3:55 AM, NoviceSortOf wrote: > > >

Re: Can't get django comments to pick up alternate form

2009-01-24 Thread Eric Abrahamsen
On Jan 25, 2009, at 1:54 PM, Theme Park Photo, LLC wrote: > > Also from reading the source, I don't see any mechanism by which it > would pick up form.html from any other than the three directories > enumerated there. Am I really supposed to edit and setup.py install > the django framework to ch

Re: how to avoid hardcoding of logfile path in logging.conf file

2009-01-27 Thread Eric Abrahamsen
On Jan 27, 2009, at 9:28 PM, Thomas Guettler wrote: > > Rama schrieb: >> please look at the below logging.conf file. >> ... >> can any one guide me on how to avoid hardcoding of log file path ? >> >> > Hi, > > I am not a logging expert, maybe there is a solution, but if you > do your setup with

Re: how to avoid hardcoding of logfile path in logging.conf file

2009-01-27 Thread Eric Abrahamsen
per into my urls.py and wrap the appropriate function there. The syntax for the logging handler is a bit of a PITA, but that's just how Python logging works... Hope that helps, Eric > On Jan 27, 6:37 pm, Eric Abrahamsen wrote: >> On Jan 27, 2009, at 9:28 PM, Thomas

Re: Custom Template Tag - Passing variable for use in tag processing

2009-01-27 Thread Eric Abrahamsen
On Jan 28, 2009, at 1:52 AM, phoebebright wrote: > > I have duplicated as best I can the processing for handling variables > in custom template tags mentioned in an earlier post but it's not > working for me as I need the value of the variable before I parse it. > Is there another way of making

getting database definition in line

2009-02-03 Thread Eric Abrahamsen
Hi there, I'm unable to do any testing -- my fixtures fail with a "Duplicate Entry" error when loading. From what I've googled, this might have something to do with a mismatch between my model definitions and the sql table definition. This fails on a model that I've done a lot of manual sql editi

Re: getting database definition in line

2009-02-03 Thread Eric Abrahamsen
On Feb 4, 11:25 am, Malcolm Tredinnick wrote: > On Tue, 2009-02-03 at 19:10 -0800, Eric Abrahamsen wrote: > > Hi there, > > > I'm unable to do any testing -- my fixtures fail with a "Duplicate > > Entry" error when loading. From what I've googled

Re: getting database definition in line

2009-02-03 Thread Eric Abrahamsen
On 2月4日, 下午12时03分, Malcolm Tredinnick wrote: > On Tue, 2009-02-03 at 19:47 -0800, Eric Abrahamsen wrote: > > > On Feb 4, 11:25 am, Malcolm Tredinnick > > wrote: > > > On Tue, 2009-02-03 at 19:10 -0800, Eric Abrahamsen wrote: > > > > Hi there, >

Re: Subclassing CommentForm

2009-02-07 Thread Eric Abrahamsen
On Feb 8, 2009, at 12:15 PM, Shantp wrote: > > Hi, > > I've got a custom comment form in my template using "get_comment_form" > and I'd like email to not be required. From some searching I see that > I need to subclass the CommentForm, but I don't know exactly how to go > about this. Here's what

Re: Changing an ImageField file without re-upload

2009-02-16 Thread Eric Abrahamsen
On Feb 17, 2009, at 5:17 AM, Carmelly wrote: > > My situation is this: I want to allow my users to upload multiple > userpics and then choose between them. So I have a Profile model with > an ImageField for the userpic. When users upload a file it is > displayed around the site as usual. When th

Re: Django

2009-02-19 Thread Eric Abrahamsen
On Feb 19, 2009, at 10:05 PM, Nalini wrote: > > While inputting an invalid username and password it should throw an > alert message saying "invalid user". How to get this in django? Do i > need to add something in views.py? It's hard to know exactly what you're doing here, but I'm going to gu

Re: Passing HTML Table to a Template

2009-02-26 Thread Eric Abrahamsen
On Feb 26, 2009, at 4:30 PM, tykun...@gmail.com wrote: > > Hi I am trying to pass an HTML table to a template and have it display > > Currently I have{{table1}} inside my template to mark the position > I wish to display the table > > In my views.py I havereturn render_to_response('resul

Re: How to select a single field from database with django QuerySet API?

2009-02-26 Thread Eric Abrahamsen
On Feb 26, 2009, at 6:23 PM, marco sedda wrote: > > Hi, > I want to select a "single" field from a table, i've read the > QuerySet API reference but i can't find anything to solve my query. > > Just to explain: > > If i've a table like: > > User > first_name = models.CharField(max_length=30)

Re: Sending a list of items by email

2009-03-03 Thread Eric Abrahamsen
On Mar 3, 2009, at 7:52 PM, Alfonso wrote: > > Thinking this should be easy but not sure of the correct path to > success! > > Got a simple filter queryset that pulls order products from a db: > > order_list = CustomerBasket.objects.all() > customer = UserProfile.objects.get(user=user).customer

Re: Overriding the HTML id in ModelForm

2009-03-04 Thread Eric Abrahamsen
On Mar 5, 2009, at 8:05 AM, Romain wrote: > > Hello, > > On the same page I have 2 ModelForm that happen to have an attribute > with the same name. Is it possible to choose the name of the HTML id > generated by the form without having to change the real name of the > model attribute? A simple

Re: Overriding the HTML id in ModelForm

2009-03-05 Thread Eric Abrahamsen
On Mar 5, 2009, at 11:14 AM, Alex Gaynor wrote: > > On 3/4/09, Eric Abrahamsen wrote: >> >> >> On Mar 5, 2009, at 8:05 AM, Romain wrote: >> >>> >>> Hello, >>> >>> On the same page I have 2 ModelForm that happen to have an attr

Re: Need help with combined feed

2009-03-09 Thread Eric Abrahamsen
On Mar 10, 2009, at 12:43 AM, bax...@gretschpages.com wrote: > > I'm trying to build a combined feed, and not having much luck. Here's > what I have: > > class CombinedFeed(Feed): >title = site.name +" combined feed" >link = "/" >description = "Latest updates from all "+site.name +"

Re: Design patterns for create/update view

2009-03-23 Thread Eric Abrahamsen
On Mar 23, 2009, at 6:06 PM, Lyubomir Petrov wrote: > > Just wondering are there any docs/examples of design pattern with > django for creating a "create/update" view. These views are written for you! See the CRUD section of the Generic Views page: http://docs.djangoproject.com/en/dev/ref/ge

Re: Design patterns for create/update view

2009-03-23 Thread Eric Abrahamsen
atically create url config lines for each model. The code lives in contrib/ admin/sites.py Is that what you meant? > > On Mar 23, 12:13 pm, Eric Abrahamsen wrote: >> On Mar 23, 2009, at 6:06 PM, Lyubomir Petrov wrote: >> >> >> >>> Just wondering are

using modelformsets

2009-07-05 Thread Eric Abrahamsen
I'm somehow failing to use modelformsets, this is the relevant view and error traceback: http://dpaste.org/evHq/ I'm validating a whole bunch of forms at the same time, but I don't see how that could cause the formset failure. Sample is a model with a ForeignKey to Author (though the Forei

Re: using modelformsets

2009-07-06 Thread Eric Abrahamsen
On Jul 5, 2009, at 11:32 PM, Matthias Kestenholz wrote: > > Hi, > > On Sun, Jul 5, 2009 at 11:42 PM, Eric Abrahamsen > wrote: >> >> I'm somehow failing to use modelformsets, this is the relevant view >> and error traceback: >> >> http://dpas

Re: [solved]Re: test if GET is "empty"

2009-07-29 Thread Eric Abrahamsen
On Jul 29, 2009, at 6:06 PM, Salvatore Leone wrote: > > I answer my self: > > all I need is to test the length of the dictionary. > > if request.method == "GET" and len(request.GET) != 0: Given the way boolean tests go in Python, you should just be able to test for the dictionary itself: if

Re: [solved]Re: test if GET is "empty"

2009-07-29 Thread Eric Abrahamsen
On Jul 29, 2009, at 9:57 PM, Salvatore Leone wrote: > > >> Given the way boolean tests go in Python, you should just be able to >> test for the dictionary itself: >> >> if request.GET: >> >> else: >> >> >> E >> > > mmm I don't think so, I think request.GET is true even if the > d

Re: how to deploy Django on the web server?

2009-08-08 Thread Eric Abrahamsen
On Aug 8, 2009, at 5:14 PM, justin jools wrote: > Yes Ive read these docs and I understand certain script changes are > needed before running on the server but I want to know about: > > installing Django on the server, do i need to use telnet to do > this? or can i upload already executed dj

Re: how to deploy Django on the web server?

2009-08-08 Thread Eric Abrahamsen
On Aug 8, 2009, at 8:24 PM, justin jools wrote: > ok well thanks for your reply: > > first I have free access and they have told me python is installed > but it's not working as I ran a hello world test script which doesbt > execute. That is the first of my problems. > > My second problem is

Re: slug regular expression: which should I use

2009-08-10 Thread Eric Abrahamsen
On Aug 10, 2009, at 1:56 PM, J0hnsmith wrote: > > Which should I use to match a slug made using slugify? > > (?P[a-zA-Z0-9-]+) > > or > > (?P[\w-]+) They're not exactly the same. Most of the time \w is alphanumeric (ie equivalent to your first regex) but Django compiles the RegexURLPattern

Re: misunderstanding

2009-08-16 Thread Eric Abrahamsen
On Aug 17, 2009, at 9:33 AM, Mike Dewhirst wrote: > > There's something here I'm not seeing. If anyone can point out the > docco > which refers I would be most grateful ... I'm using py2.6 and Django > from svn head. > > The template below displays the title correctly but claims "No meta > dic

Leaking python app structure

2009-09-09 Thread Eric Abrahamsen
I have a site with SEND_BROKEN_LINK_EMAILS = True in the settings, which means I get both legitimate 404s and also probes where the bot is being clever by putting the fake URL in the referer heading. Today I got a series of 404 messages that were alarming because they were probing legitimat

Re: redirect back after save

2009-03-28 Thread Eric Abrahamsen
On Mar 28, 2009, at 8:04 PM, Paddy Joy wrote: > > I have a form that can be called from multiple places. What's the best > way to redirect back to the original page after the form has been > saved. I think the standard way to do this is to include a hidden form element (usually called "next")

custom comment app migration

2009-04-09 Thread Eric Abrahamsen
I'm planning on migrating an existing (django.contrib) comments setup into a custom comment app, and I'm wondering if anyone's got any experience to impart in this regard. I have done cross-app data migration before, and cocked it up horribly. These are the steps I'm considering; if anyone

Re: Question regarding django.contrib.comments

2009-04-22 Thread Eric Abrahamsen
On Apr 18, 2009, at 6:03 PM, SoCow wrote: > > Hi there, > > I've implemented django.contrib.comments and activated the custom > redirect option by including the following line in the comments form: > > value="{{ object.get_absolute_url }}" /> > > This works great for redirecting back to the ori

Re: 'base' template

2009-05-08 Thread Eric Abrahamsen
On May 8, 2009, at 4:35 PM, lisa holper wrote: > Hi, > > I created a website with django. > My problem: When I insert all .html pages in my directory, I can see > the website but without using the 'base' template. Do you have {% extends 'base.html' %} at the top of all your templates? You h

Re: 'base' template

2009-05-08 Thread Eric Abrahamsen
-index But you should probably back up and start with the tutorial: http://docs.djangoproject.com/en/dev/intro/tutorial01/#intro-tutorial01 Eric > > Thanks, Lisa > > On Fri, May 8, 2009 at 5:57 AM, Eric Abrahamsen > wrote: > > > On May 8, 2009, at 4:35 PM, lisa h

Re: 'base' template

2009-05-09 Thread Eric Abrahamsen
, what system/django version are you running, and how exactly are you running the development server. Yours, Eric > Lisa > > On Fri, May 8, 2009 at 11:10 PM, Eric Abrahamsen > wrote: > > On May 9, 2009, at 2:37 AM, lisa holper wrote: > >> Hi, >> >> Yes, I

Re: please help me

2009-05-16 Thread Eric Abrahamsen
On May 17, 2009, at 1:26 AM, Apple wrote: > > I write some code like following: > > #coding=utf8 > from django.shortcuts import render_to_response > from django.http import *

Re: Rendering models using their own templates

2009-05-19 Thread Eric Abrahamsen
On May 20, 2009, at 10:53 AM, Roberto Cea wrote: > > I have a large amount of optional components (with a model for each > one) that will be freely inserted by my users, and it would be > impractical to render each one in a single large template. > I want to give each component a ".render()" met

Re: Is there a version of @login_required that requires the user to log in as a specific user?

2009-05-25 Thread Eric Abrahamsen
On May 25, 2009, at 4:41 PM, Andy wrote: > > > > On May 24, 9:54 pm, Brian Neal wrote: >> On May 24, 6:50 pm, Continuation wrote: >> >>> For example, I have a view edit_profile that edits a user's profile. >>> Obviously I want to make sure that each user can edit his own >>> profile >>> only

Re: How to use next with comments?

2009-05-27 Thread Eric Abrahamsen
On May 28, 2009, at 4:02 AM, Kevin Fullerton wrote: > > I'm working with django.contrib.comments at the moment, and so far > most > things are working as expected. > > I'm building the submission form using {% get_comment_form for > object as > form %} and have added the following as part of

  1   2   3   >