render_to_response failed to render media files in base.html

2008-10-19 Thread Chuck Bai2
Here is my view code: def contact(request): form = ContactForm() # An unbound form return render_to_response('contact.html', { 'form': form, }) My contact form page rendered but without all the media files(CSS files, Javascripts files, images). The text part of the page is

Re: Custom Template Tag with {% end... %} tag

2008-10-19 Thread James Bennett
On Sun, Oct 19, 2008 at 4:20 PM, Erik Allik <[EMAIL PROTECTED]> wrote: > In the compilation function of your template tag, you can force the > parser to parse until tag named "endyourcustomtag" by calling nodelist > = parser.parse(("endyourcustomtag", ). This will return the contents > of your

Re: separate users from django admin'able users

2008-10-19 Thread tvaughan
On Oct 19, 12:32 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Wiadomość napisana w dniu 2008-10-19, o godz. 00:02, przez tvaughan: > > > I'm definitely ok with admins having to create another account to use > > the site. The two pools of users seems to me to be totally unique, and > > shouldn't

Re: Custom Template Tag with {% end... %} tag

2008-10-19 Thread Siah
Thank you! Sia On Oct 19, 5:20 pm, Erik Allik <[EMAIL PROTECTED]> wrote: > In the compilation function of your template tag, you can force the   > parser to parse until tag named "endyourcustomtag" by calling nodelist   > = parser.parse(("endyourcustomtag", ). This will return the contents   >

Re: Django crashes Python without traceback on Mac OS X (Release 1.0)

2008-10-19 Thread Graham Dumpleton
On Oct 20, 11:34 am, "jd.strickler" <[EMAIL PROTECTED]> wrote: > Just as a heads up: if you have a 64-bit Intel chip running OS X > > The cross-compiling/Universal Binary issue may come up to bite you (it > did me).  Apache runs in 64-bit mode while most of the system runs in > 32-bit mode,

Re: Django crashes Python without traceback on Mac OS X (Release 1.0)

2008-10-19 Thread jd.strickler
Just as a heads up: if you have a 64-bit Intel chip running OS X The cross-compiling/Universal Binary issue may come up to bite you (it did me). Apache runs in 64-bit mode while most of the system runs in 32-bit mode, meaning that every part of your Django stack has to be compiled for both

Re: login_required for imported apps

2008-10-19 Thread James Bennett
On Sun, Oct 19, 2008 at 2:10 PM, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > Indeed. But , OTHO, having to copy/paste a whole urls.py just to a add > a simple decorator on the view functions is not really DRY. Personally, I don't agree; writing code to do what you want, even if it starts

Re: is it possible to run 0.96 and 1.0 in parallel?

2008-10-19 Thread James Bennett
On Sun, Oct 19, 2008 at 4:55 PM, Rachel Willmer <[EMAIL PROTECTED]> wrote: > It doesn't seem possible to run Django 1.0 and 0.96 concurrently on the same > machine AFAICS - am I going to have to set up another machine to work on the > 1.0 upgrade while I maintain the 0.96 release? It's actually

Re: missing template for admin

2008-10-19 Thread Steve Holden
DanJ wrote: > Hi, > > I'm new to Django so please pardon my ignorance. > I've just installed Django 1.0 from SVN. I'm trying to follow the > tutorial, while at the same time use Apache and mod_python. > > When I point my browser to the admin site I get a simple text version, > as if it missing

missing template for admin

2008-10-19 Thread DanJ
Hi, I'm new to Django so please pardon my ignorance. I've just installed Django 1.0 from SVN. I'm trying to follow the tutorial, while at the same time use Apache and mod_python. When I point my browser to the admin site I get a simple text version, as if it missing the template. - Are there

Re: filter OR for results...

2008-10-19 Thread Erik Allik
CollegeTeam.objects.filter(team=game.team1) | CollegeTeam.objects.filter(team=game.team2) But I would instead recommend: CollegeTeam.objects.filter(team__in=[game.team1, game.team2]) Erik On 20.10.2008, at 1:22, [EMAIL PROTECTED] wrote: > > I have a model that is tracking all of the college

filter OR for results...

2008-10-19 Thread mccomas . chris
I have a model that is tracking all of the college football games, there's an entry for each game, with the two teams represented in the fields 'team1' and 'team2'. These are foreign keys to the model 'CollegeTeams'. I'm trying to run a query so that it'll get the results from the Game for each

Re: Console output

2008-10-19 Thread Ned Batchelder
There's no global switch to turn off the console output. Your Django code is simply Python code running in a process, and if you use the print statement, it will print to the stdout of the process. You will have to conditionalize the print statements if you don't want to see them. Your

is it possible to run 0.96 and 1.0 in parallel?

2008-10-19 Thread Rachel Willmer
This might be a FAQ but I've googled and can't find the answer... I'm considering upgrading some websites from 0.96 to 1.0 but I need to be able to upgrade the current site while I work through the migration process. It doesn't seem possible to run Django 1.0 and 0.96 concurrently on the same

Re: save_model and how to ignore any changes to an object

2008-10-19 Thread TiNo
In django admin, there is a save_as option. see http://docs.djangoproject.com/en/dev/ref/contrib/admin/#save-as You could also save revisions of objects. Check: http://code.djangoproject.com/wiki/FullHistory http://code.google.com/p/django-reversion/ http://code.google.com/p/django-history/

Re: Custom Template Tag with {% end... %} tag

2008-10-19 Thread Erik Allik
In the compilation function of your template tag, you can force the parser to parse until tag named "endyourcustomtag" by calling nodelist = parser.parse(("endyourcustomtag", ). This will return the contents of your block tag as a list of nodes. Finally you can "drop off" the end tag by

Re: Console output

2008-10-19 Thread Bob Cowdery
I didn't say I was using it in production. This is development and I would prefer not to have streams of stuff coming out on the console. So how do I turn it off. Bob On Sun, 2008-10-19 at 11:08 -0700, Daniel Roseman wrote: > On Oct 19, 7:05 pm, Bob Cowdery <[EMAIL PROTECTED]> wrote: > > This

Cache and upload handlers .. fun times!

2008-10-19 Thread truebosko
Hi there, So I spent the last few hours trying to get a ProgressBar Upload handler working What it does: User uploads a file, when they hit the submit button, javascript is called and begins polling the server (a django view) for progress. Progress is stored in a cache_key, very simple idea.

Custom Template Tag with {% end... %} tag

2008-10-19 Thread Siah
Hi, I can't understand how template tags such as if, for and ifequal manage to have an accompanying endif, endfor and endifequal, and I can't have it. Or I can't manage to find out how to do it. So, I basically want to do something like: {% customTag %} hello {% endcustomTag %} and within my

Re: dynamic upcast

2008-10-19 Thread Carl Meyer
On Sep 12, 2:57 pm, dadapapa <[EMAIL PROTECTED]> wrote: >     class BaseClass(models.Model) : >         final_type = models.ForeignKey(ContentType) > >         def save(self,*args) : >             self.final_type = > ContentType.objects.get_for_model(type(self)) >            

Admin uses sessions/auth middleware but don't need those in the main part of the site

2008-10-19 Thread danlester
I've added the admin app, along with necessary middleware. The sessions and authentication middleware required for admin are not needed for the main part of my site, so the vast majority of traffic will be given session identifiers etc that are never used. I haven't benchmarked in detail, but it

Inherited classes and generic views - curiosity.

2008-10-19 Thread Scott SA
When passing a QuerySet of objects which inherit part of their model from another class, generic views only seems to respond to the parent class: Here's a simplified example: class ParentClass(models.Model): name_last = models.CharField(max_length=64) name_first =

Re: Migration problems (old svn version to 1.0 and new server)

2008-10-19 Thread AdamC
2008/10/19 Jarek Zgoda <[EMAIL PROTECTED]>: > > Wiadomość napisana w dniu 2008-10-19, o godz. 20:25, przez AdamC: > >> Template error >> >> In template /home/adam/apps/films/templates/includes/nav.html, error >> at line 1 >> Caught an exception while rendering: Reverse for >>

Re: login_required for imported apps

2008-10-19 Thread bruno desthuilliers
On 18 oct, 18:12, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Sat, Oct 18, 2008 at 10:22 AM, Heather <[EMAIL PROTECTED]> wrote: > > Well, after trying to work this out a bit more, it looks like a nice > > solution is to make a middleware class and use the process_views() but > > I'm not quite

Re: Migration problems (old svn version to 1.0 and new server)

2008-10-19 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-10-19, o godz. 20:25, przez AdamC: > Template error > > In template /home/adam/apps/films/templates/includes/nav.html, error > at line 1 > Caught an exception while rendering: Reverse for > 'films.films.views.edit_film_list' with arguments '()' and keyword >

Re: Migration problems (old svn version to 1.0 and new server)

2008-10-19 Thread Karen Tracey
On Sun, Oct 19, 2008 at 2:25 PM, AdamC <[EMAIL PROTECTED]> wrote: > > I'm migrating my application (a simple film database) to another server. > > I installed version 1.0 of django on the new server and set up apache > with mod_python (which was the same setup on my old server). > > However, I

variables in forms.py?

2008-10-19 Thread Jorge Romo
Hell guys, I have this little doubt: I want to validate a form, but it has several different options. It has to take a value_a and the see if it is bigger, smaller or equal to another value_b. The issue (or maybe not :p) is that the value_b is entered by the user, so it is always different, it

Re: Django crashes Python without traceback on Mac OS X (Release 1.0)

2008-10-19 Thread vivek
alternatively you can also try to reduce recursion limit by using sys.setrecursionlimit() to lower setting which might help you to debug the offending secton of code. vp --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Migration problems (old svn version to 1.0 and new server)

2008-10-19 Thread AdamC
I'm migrating my application (a simple film database) to another server. I installed version 1.0 of django on the new server and set up apache with mod_python (which was the same setup on my old server). However, I seem to be having some problems. When I try and login to my application (which

Console output

2008-10-19 Thread Bob Cowdery
This is probably staring me in the face but I can't figure out how to turn off the HTTP console output on the built-in server. I have an Ajax poll running and this output is slowing things down. Thanks Bob --~--~-~--~~~---~--~~ You received this message because

Re: Console output

2008-10-19 Thread Daniel Roseman
On Oct 19, 7:05 pm, Bob Cowdery <[EMAIL PROTECTED]> wrote: > This is probably staring me in the face but I can't figure out how to > turn off the HTTP console output on the built-in server. I have an Ajax > poll running and this output is slowing things down. > > Thanks > Bob Quite simply, you

Re: alternative for foreignkey fieldset

2008-10-19 Thread Low Kian Seong
Just curious but has anyone done this is a production environment? On Sun, Oct 19, 2008 at 1:05 PM, Russell Keith-Magee <[EMAIL PROTECTED] > wrote: > > On Sun, Oct 19, 2008 at 2:40 AM, Low Kian Seong <[EMAIL PROTECTED]> > wrote: > > Dear all, > > > > Is there another form the foreignkey field

save_model and how to ignore any changes to an object

2008-10-19 Thread Markos Gogoulos
hi all. When I edit an object on django admin and press save, I want the object NOT to be saved, but instead create another object that contains any changes (I want to be able to review it later). So the original object has to be unchanged. I tried with this: def save_model(self, request, obj,

Re: Simplest unit testing of models fail ...

2008-10-19 Thread Karen Tracey
On Sun, Oct 19, 2008 at 8:38 AM, zobbo <[EMAIL PROTECTED]> wrote: > > After some conversation on irc, it appears that you can only validate > Django objects by using Django forms. > > I do find that odd but I won't get into that conversation at the > moment. > > Instead let me describe my problem

Re: Simplest unit testing of models fail ...

2008-10-19 Thread zobbo
After some conversation on irc, it appears that you can only validate Django objects by using Django forms. I do find that odd but I won't get into that conversation at the moment. Instead let me describe my problem to the world and see if anybody has any suggestions. I have a number of

Re: How to send emails when after an event happened?

2008-10-19 Thread reyjexter
I think you need to be more specific with what you want to do. On Oct 19, 2:04 pm, Net_Boy <[EMAIL PROTECTED]> wrote: > Hi, > >    I am doing a new project and  (doing a function that checks  for a > specific event, if it happened then the system should send email to > the user? so how can I do

Template variables in forms

2008-10-19 Thread Martin
Hello, i'm trying to use formwizard for my project, but i can't seem to solve the problem. I have two step formwizard, and i need a variable from first step to show up in the next. Second step is a queryset of "available texts" - and there is a "name" ( lets say {{ name }}) variable in it, that

Re: middleware or view ?

2008-10-19 Thread PonasNiekas
Thanks Russ for the replay. Your idea would certainly work and I agree that doing calculations outside django/web server makes sense. I will probably and up doing the way you described. On the other hand, having the whole thing in django without any external components would kinda be nice..

Re: Simplest unit testing of models fail ...

2008-10-19 Thread zobbo
Russell Many thanks for taking the time to reply. On Oct 19, 6:13 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Sun, Oct 19, 2008 at 4:00 AM, Ian J Cottee <[EMAIL PROTECTED]> wrote: > As far as I can make out, the error you are getting is unrelated to > the problem you are

Python on Windows re-using old .pyc files?

2008-10-19 Thread Ulf Kronman
Hi all, I've been coding database development with Django for about a year in a Mac OS X and Linux environment using a Postgres database. Now I have moved to a new organisation and is trying to use Django for development against a big bibliometric legacy database in MS SQL Server in a Windows

Re: separate users from django admin'able users

2008-10-19 Thread Jarek Zgoda
Wiadomość napisana w dniu 2008-10-19, o godz. 00:02, przez tvaughan: > I'm definitely ok with admins having to create another account to use > the site. The two pools of users seems to me to be totally unique, and > shouldn't overlap in anyway. Just do not set is_staff for "ordinary" users

Re: middleware or view ?

2008-10-19 Thread Russell Keith-Magee
On Sun, Oct 19, 2008 at 5:19 AM, PonasNiekas <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm about to write an app, which is going to do long running (~1 to > ~60 minutes) calculations (meanwhile, the user who triggered the > calculation will get message like "calculation in progress" or smth). > >

Re: Questions on packaging a project and naming conventions

2008-10-19 Thread James Bennett
On Sun, Oct 19, 2008 at 1:55 AM, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > However, it's important to note that this doesn't preclude the use of > deeper namespaces - it just says that namespacing for an application > shouldn't be tied to the project. One obvious way to satisfy this >

Re: Questions on packaging a project and naming conventions

2008-10-19 Thread Russell Keith-Magee
On Sun, Oct 19, 2008 at 5:53 AM, Dana <[EMAIL PROTECTED]> wrote: > > Hello everyone, > > I am working on a CMS that includes a bunch of applications (like > Story, Event, etc...) with some being propriatary and some being third > party. When it comes to our naming conventions, we've had a bit of

Re: Json Serialization / Form Validation error

2008-10-19 Thread Russell Keith-Magee
On Sun, Oct 19, 2008 at 12:58 AM, justind <[EMAIL PROTECTED]> wrote: > > Hello, > > No one has any ideas? Settle down, Tiger. You asked this question on a Friday night. You may need to wait a little more than 18 hours if you want a response. We're all volunteers here, and many of us have

Re: tutorial bug

2008-10-19 Thread Brendan Miller
> The tutorial, though, puts it on the Poll model.  Where is yours? Ah, thanks. It seems that I put it in the PollAdmin for some reason. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: How to send emails when after an event happened?

2008-10-19 Thread Karen Tracey
On Sun, Oct 19, 2008 at 2:04 AM, Net_Boy <[EMAIL PROTECTED]> wrote: > > Hi, > > I am doing a new project and (doing a function that checks for a > specific event, if it happened then the system should send email to > the user? so how can I do that? > You might try searching the docs for

How to send emails when after an event happened?

2008-10-19 Thread Net_Boy
Hi, I am doing a new project and (doing a function that checks for a specific event, if it happened then the system should send email to the user? so how can I do that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google