Re: template inheritance

2009-01-11 Thread James Matthews
Not always sometimes you want to show some template code (You have a blog about web dev) and sometimes you want to nest some code. On Sun, Jan 11, 2009 at 10:04 PM, Diez B. Roggisch wrote: > Alex K schrieb: > >> While building a website using template inheritance one usually

Re: Get Request Url

2009-01-11 Thread James Matthews
Thank You (I had the same question today) 2009/1/12 burcu hamamcıoğlu > Thanks Bruno request.get_full_path() is enough for me . > > Best regards > > 09 Ocak 2009 Cuma 18:31 tarihinde bruno desthuilliers < > bruno.desthuilli...@gmail.com> yazdı: > > >> >> >> On 9 jan, 17:06,

Re: Get Request Url

2009-01-11 Thread burcu hamamcıoğlu
Thanks Bruno request.get_full_path() is enough for me . Best regards 09 Ocak 2009 Cuma 18:31 tarihinde bruno desthuilliers < bruno.desthuilli...@gmail.com> yazdı: > > > > On 9 jan, 17:06, "burcu hamamcıoğlu" wrote: > > Hi everybody, > > > > do you know how can i get request

Re: Django Development Process

2009-01-11 Thread steve
You'll find the perfect way for you to approach each stage of it I'm sure. I'm always into figuring out Use Cases the very first thing. I like to establish at least 4 or 5 different major tasks that a user would need/want to do, and then get these out of my head into a concrete form (currently

Re: Django Development Process

2009-01-11 Thread Alex Kowalczyk
2009/1/12 Jeremy Dunck > My general approach is: > > URLs first, which helps me think through the various pages users will > interact with. > Roughly sketch those pages, think about features and models needed for > reasonable normalization. > Code models > Implement views. >

Re: why 'No module named safestring'?

2009-01-11 Thread frank Shi
thanks David On Jan 12, 11:53 am, "David Zhou" wrote: > On Sun, Jan 11, 2009 at 10:25 PM, frank Shi wrote: > > > i use django 0.96 ,template render html string. > > > from django.utils.safestring import mark_safe > > context=Context({ > >        

Putting pieces back together again

2009-01-11 Thread Mark Jones
I have some fields on my page that have more than one attribute for simplification, lets say two attributes answer = {'txt':'something', 'allowblank':0} laid out on the page as: {% for answer in quiz_question.answers %} {% endfor %} the first is pulled from an input field, and if

The First Page

2009-01-11 Thread pyramid...@gmail.com
Hello django users I am slightly confused with starting out I just want to start with the initial index page Do i need to create an app for that and then have views.py send me to the index.html template OR is this a bad way to do it how do u handle the url where they just type in the

Re: Django Development Process

2009-01-11 Thread Jeremy Dunck
On Sun, Jan 11, 2009 at 9:03 PM, AlexiPoliski wrote: ... > What I would like to ask is, from more experienced Django developers, > what way do you prefer to create your applications? Models then views > then templates? Models then templates then views? Or models then

Re: Markdown filter piped into custom filter

2009-01-11 Thread Brian Neal
On Jan 11, 11:27 am, Brian Neal wrote: > I wrote a filter that searches for patterns in text and replaces them > with tags: > > {{ comment.text|smilify }} > > It does various silly things like replace :-) with an actual smiley > face image. Seems to work great. > > When I

Re: why 'No module named safestring'?

2009-01-11 Thread David Zhou
On Sun, Jan 11, 2009 at 10:25 PM, frank Shi wrote: > > i use django 0.96 ,template render html string. > > from django.utils.safestring import mark_safe > context=Context({ >'div1':mark_safe(obj), >}) >return HttpResponse(template.render(context)) > > it's

Django Development Process

2009-01-11 Thread AlexiPoliski
This is a call for opinion based on experience :) I'm in the process of creating the models for my very first Django application in my very first project. I have read the book up to and including chapter 7 (everything i need to know to get started). Naturally I have the design of the system I

why 'No module named safestring'?

2009-01-11 Thread frank Shi
i use django 0.96 ,template render html string. from django.utils.safestring import mark_safe context=Context({ 'div1':mark_safe(obj), }) return HttpResponse(template.render(context)) it's error: No module named safestring?why already install python 2.5

POST still occurs after HttpResponseRedirect

2009-01-11 Thread stryderjzw
Hi, Here's part of my code: class NewAssignmentFormPreview(FormPreview): def done(self, request, form): assignment = form.save(commit=False) assignment.save() ... return HttpResponseRedirect(assignment.get_absolute_url()) I do an HttpResponseRedirect to go to the

Re: can't get a model in the admin

2009-01-11 Thread Bobby Roberts
> What version of Django are you using? The use of max_length instead of > maxlength implies something later than 0.96 but the use of 'class Admin' > implies something before 1.0. If you are using 1.0 or later 'class Admin' > is not how admin defs are specified any more, see the admin doc for

Re: editing multiple records using admin list view

2009-01-11 Thread sateeshk...@gmail.com
Thanks. This is exactly what I wanted. On Jan 11, 5:36 pm, "Alex Koshelev" wrote: > There is an application:http://code.google.com/p/django-batchadmin/ > > On Sun, Jan 11, 2009 at 1:53 PM, sateeshk...@gmail.com > > wrote: > > > Hi, > >  I want to edit

Re: can't get a model in the admin

2009-01-11 Thread Karen Tracey
On Sun, Jan 11, 2009 at 7:19 PM, Bobby Roberts wrote: > > here's my model: > > from django.db import models > > class Testimonial(models.Model): >active=models.IntegerField(max_length=11, blank=False) >testimony=models.CharField(max_length=500) >

Re: Decoupling between projects and app in 4-part tutorial.

2009-01-11 Thread Greg Aumann
On Jan 12, 5:41 am, dahpgjgamgan wrote: > In the 4-part tutorial on Django's main site, there's a lot of advice > on how to decouple apps and projects, but when I look at the import > statements in most of the tutorial's files, it's always "from > projectname.appname

can't get a model in the admin

2009-01-11 Thread Bobby Roberts
here's my model: from django.db import models class Testimonial(models.Model): active=models.IntegerField(max_length=11, blank=False) testimony=models.CharField(max_length=500) name=models.CharField(max_length=75) postdate = models.DateTimeField

Decoupling between projects and app in 4-part tutorial.

2009-01-11 Thread dahpgjgamgan
Hi, In the 4-part tutorial on Django's main site, there's a lot of advice on how to decouple apps and projects, but when I look at the import statements in most of the tutorial's files, it's always "from projectname.appname import ." - not very decoupled for me. Am I missing something,

Re: Path problem with jsi18n - internationalization

2009-01-11 Thread Ramiro Morales
On Sun, Jan 11, 2009 at 6:43 PM, Tipan wrote: > > Hi Ramiro, > > I'm using the latest development version of Django. Apache web server. > MySqL/Mod_python, all served from same apache on my laptop. > > I get a 404 error when I put http:///jsi18n/ into the browser > URL. >

Re: def clean_file works with django server but not with apache

2009-01-11 Thread Alan
Thanks a lot dear Graham. Alan On Sun, Jan 11, 2009 at 20:56, Graham Dumpleton wrote: > > Answered at: > > http://groups.google.com/group/modwsgi/browse_frm/thread/6af0cf98b726e5fe > > Graham > > On Jan 11, 11:59 pm, Alan wrote: > > Oops, I

Re: def clean_file works with django server but not with apache

2009-01-11 Thread Graham Dumpleton
Answered at: http://groups.google.com/group/modwsgi/browse_frm/thread/6af0cf98b726e5fe Graham On Jan 11, 11:59 pm, Alan wrote: > Oops, I found something. I am using apache2 + mod_wsgi and I notice that > instead of using my Fink python ('/sw/bin/python') it's using my

Re: Path problem with jsi18n - internationalization

2009-01-11 Thread Tipan
Hi Ramiro, I'm using the latest development version of Django. Apache web server. MySqL/Mod_python, all served from same apache on my laptop. I get a 404 error when I put http:///jsi18n/ into the browser URL. Rgds, Tim --~--~-~--~~~---~--~~ You received this

template inheritance

2009-01-11 Thread Jo
While building a website using template inheritance one usually does the following: fetch from database fetch from some more data from database ... << more required computations then at the end render the template with the fetched data Without template inheritance one usually does the

Markdown filter piped into custom filter

2009-01-11 Thread Brian Neal
I wrote a filter that searches for patterns in text and replaces them with tags: {{ comment.text|smilify }} It does various silly things like replace :-) with an actual smiley face image. Seems to work great. When I combine it with the markdown filter, like this: {{

Re: Path problem with jsi18n - internationalization

2009-01-11 Thread Ramiro Morales
On Sun, Jan 11, 2009 at 2:48 PM, Tipan wrote: > > I'm having a problem accessing Javascript Translation catalog whilst > converting my site to multi-language. As suggested in the docs, I have > added the following to my applications top level urls file. > > > js_info_dict = {

Path problem with jsi18n - internationalization

2009-01-11 Thread Tipan
I'm having a problem accessing Javascript Translation catalog whilst converting my site to multi-language. As suggested in the docs, I have added the following to my applications top level urls file. js_info_dict = { 'packages': ( 'myapp.myproject',), } (r'^jsi18n/$',

Re: Where are all the Django jobs?

2009-01-11 Thread Jon Loyens
Django is starting to gain more traction and I do believe we'll start to see a bit more of a hockey stick effect on it's adoption over the coming months. 1.0 being released last year and (at least part-wise) adoption by the Google AppEngine have both been great PR events for Django but I'd also

Re: setting cookies following comment post

2009-01-11 Thread Eric Abrahamsen
Solving my own problem... This wasn't nearly as hard as I thought, here's the solution that worked for me: urls.py # from datetime import datetime, timedelta from django.conf.urls.defaults import * from django.contrib.comments.views import comments ...others... def remember_wrapper(fn):

Re: forms/widgets media: position of 'class' directive

2009-01-11 Thread Ramiro Morales
On Sun, Jan 11, 2009 at 10:33 AM, Artem Skvira wrote: > > Hi all, > > I've stumbled upon strange behaviour in django: when declaring form/ > widget with class Media, ie.: > > class AddressForm(ModelForm): >streetNo = forms.CharField() >... > >class Meta: >

forms/widgets media: position of 'class' directive

2009-01-11 Thread Artem Skvira
Hi all, I've stumbled upon strange behaviour in django: when declaring form/ widget with class Media, ie.: class AddressForm(ModelForm): streetNo = forms.CharField() ... class Meta: ... class Media: js = ('prototype.js', ) I get tons of javascript inclusions

Re: debug template tag gives me: "'ascii' codec can't encode character"

2009-01-11 Thread Malcolm Tredinnick
On Sun, 2009-01-11 at 03:41 -0800, Flo Ledermann wrote: > Hi all, > > I just bumped into a problem I can't resolve: after adding the {% > debug %} template tag to one of my templates (no other changes), I get > the following error message: > > TemplateSyntaxError at /art/ > > Caught an

Re: def clean_file works with django server but not with apache

2009-01-11 Thread Alan
Oops, I found something. I am using apache2 + mod_wsgi and I notice that instead of using my Fink python ('/sw/bin/python') it's using my mac python ('/usr/bin/python'). I compiled mod_wsgi with fink python, even though I had to put something like: WSGIDaemonProcess webapps user=alan group=staff

Re: deploying in server and templates folder is wrong:

2009-01-11 Thread Alan
Many thanks Steve. I thought I had designed my apps bulletproof for local setups but I clearly failed. Thanks a lot again. Cheers, Alan On Sat, Jan 10, 2009 at 21:47, Steve Potter wrote: > > > > On Jan 10, 3:44 pm, Alan wrote: > > Hello List, > >

def clean_file works with django server but not with apache

2009-01-11 Thread Alan
Hi List, I have this problem now. It's about a form in my models.py that works as expected when testing with django server but when testing with apache sever (all in the same machine, mac osx leopard) it does not work as desired. class GridJobForm(forms.Form): file =

Re: editing multiple records using admin list view

2009-01-11 Thread Alex Koshelev
There is an application: http://code.google.com/p/django-batchadmin/ On Sun, Jan 11, 2009 at 1:53 PM, sateeshk...@gmail.com wrote: > > Hi, > I want to edit multiple records of users ( say selecting the user > records which I want to edit ) and then say if I press >

Re: debug template tag gives me: "'ascii' codec can't encode character"

2009-01-11 Thread Flo Ledermann
Oh, I should probably add that I am using # coding=utf-8 on some of my source files, because they contain unicode default values etc. Flo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: reusable apps and dependencies

2009-01-11 Thread uber.ubiwanken...@gmail.com
Thank you both, one more thing... I think it's a very common situation, isn't it? I mean, if you don't use apps inside your project, you have to manage the case of different versions of the same app. But I found only few posts about that, I wonder why? Do I have to put django-cms in every

debug template tag gives me: "'ascii' codec can't encode character"

2009-01-11 Thread Flo Ledermann
Hi all, I just bumped into a problem I can't resolve: after adding the {% debug %} template tag to one of my templates (no other changes), I get the following error message: TemplateSyntaxError at /art/ Caught an exception while rendering: 'ascii' codec can't encode character u'\u2019' in

Re: which class does ####__iexact belong to, where #### is the attribute of a model?

2009-01-11 Thread bruno desthuilliers
On 10 jan, 18:56, rabbi wrote: > Hi, > I'm trying to write a generic filter function do something like > following: >MyModel.objects.filter( getattr(???,my_dict['search_field'] > +'__iexact')=my_dict['search_value'] ) > > But I don't know what to put in place of

editing multiple records using admin list view

2009-01-11 Thread sateeshk...@gmail.com
Hi, I want to edit multiple records of users ( say selecting the user records which I want to edit ) and then say if I press activate button, all the records status should change to 'ACTIVE'. To do this kind of thing, is there any simple tweak in admin model or admin templates ? If some one

Re: dynamic mod wsgi

2009-01-11 Thread Graham Dumpleton
On Jan 11, 7:59 pm, Ben Eliott wrote: > Hi Graham, > Just following up on this thread. I replied with some details, but   > maybe you missed those, or maybe i missed your reply. Or maybe this   > isn't worth it and i should stop being lazy and just write out the   >

Re: Model Updates. use save() or signals

2009-01-11 Thread Malcolm Tredinnick
On Sun, 2009-01-11 at 01:53 -0800, Matt Welch wrote: > I appreciate it. Thank you. > > I tried the examples you said and ran into one problem on the first > ( happened in the second, but fixed ). > > On Jan 11, 3:12 am, Malcolm Tredinnick > wrote: > > On Sun,

Re: django-admin.py not working on Vista

2009-01-11 Thread Cody
Hi Rex, I came across this same problem and fixed it by editing the registry like this: Go to HKEY_CLASSES_ROOT and find .py Change its (Default) setting to Python.File Mine was set to py_auto_file when I associated the extension through Windows. Anyway, that got django-admin.py running right.

Re: Model Updates. use save() or signals

2009-01-11 Thread Matt Welch
I appreciate it. Thank you. I tried the examples you said and ran into one problem on the first ( happened in the second, but fixed ). On Jan 11, 3:12 am, Malcolm Tredinnick wrote: > On Sun, 2009-01-11 at 00:11 -0800, juice wrote: > > > > I then figured it may run

Live Contacts Python API Problem

2009-01-11 Thread afrobeard
Hi, I was wondering if anyone has taken a look at Live Contacts API at http://msdn.microsoft.com/en-us/library/bb463989.aspx I can get through step 1 i.e. Delegated Authentication. An exception is being raised when urllib2 calls the open function. The nature of the Error is 403 forbidden

Re: Model Updates. use save() or signals

2009-01-11 Thread Malcolm Tredinnick
On Sun, 2009-01-11 at 00:11 -0800, juice wrote: > > > I then figured it may run into a loop of saving the same model, so i > > > was going to use signals but ran into the same issue that it would > > > still need to be in the save function. > > > > Are you talking about the infinite loop problem

Re: dynamic mod wsgi

2009-01-11 Thread Ben Eliott
Hi Graham, Just following up on this thread. I replied with some details, but maybe you missed those, or maybe i missed your reply. Or maybe this isn't worth it and i should stop being lazy and just write out the VirtualHost files :) Ben On 23 Dec 2008, at 01:13, Graham Dumpleton wrote: >

Re: Model Updates. use save() or signals

2009-01-11 Thread juice
> > I then figured it may run into a loop of saving the same model, so i > > was going to use signals but ran into the same issue that it would > > still need to be in the save function. > > Are you talking about the infinite loop problem here? I don't understand > this paragraph. Yes sir, after