Re: moving url's of my site

2007-02-08 Thread skink
On Feb 8, 11:44 am, "plungerman" <[EMAIL PROTECTED]> wrote: > i have a ROOT_URL value set in my settings.py file. i use this > throughout all applications and at the template level, where i have > created a template tag to make it available as {%root_url%} > > def root_url(): > if

Re: Automated testing using Client - how to test/assert the value of session objects

2007-02-08 Thread Manoj Govindan
Here you go. import unittest from django.test.client import Client class BeatTheDrumTests( unittest.TestCase ): def setUp( self ): self.client = Client() def test_POST_btd_select_army( self ): response = self.client.post("/btd/select_army/",

Re: Automated testing using Client - how to test/assert the value of session objects

2007-02-08 Thread Margaret
would you like paste your code of "test"? On 2/9/07, Manoj Govindan <[EMAIL PROTECTED]> wrote: > > Hi, > I have written a small test making use of test.Client to simulate a > 'POST' request to a view. The target view is expected to set a certain > variable in the session on successful handling

Automated testing using Client - how to test/assert the value of session objects

2007-02-08 Thread Manoj Govindan
Hi, I have written a small test making use of test.Client to simulate a 'POST' request to a view. The target view is expected to set a certain variable in the session on successful handling of the request. Can anyone suggest a suitable mechanism to check in the test if the session variable has

Video Django tutorial available

2007-02-08 Thread Malcolm Tredinnick
I gave a 90 minute Introduction To Django tutorial at linux.conf.au last month. It was recorded and the video is now available online. Nothing special or really new, but some people prefer visual presentations to reading about things, so I thought I'd throw it out there. The video is available

Django Admin not updating to reflect changes in database

2007-02-08 Thread Roboto
Hi all, I've been away from Django for a bit, and for some reason I can't get the admin interface to reflect the changes in the models.py for my apps. I've syncdb, i've sqlreset. I've done everything (but the right thing) to try to get the admin interface to pick up the new charField that I've

Re: Per object permissions

2007-02-08 Thread Jay Parlar
On 2/8/07, Ramdas S <[EMAIL PROTECTED]> wrote: > I think Adrian is keeping the trunk upto date. I am using thie updates trunk > right nowand everything seems to be OK Except that the per-object permissions branch hasn't had a trunk merge for over a month. I'd *guess* Adrian is too busy with the

Re: Per object permissions

2007-02-08 Thread Ramdas S
I think Adrian is keeping the trunk upto date. I am using thie updates trunk right nowand everything seems to be OK Ramdas S On 2/9/07, Scanner <[EMAIL PROTECTED]> wrote: > > > > > On Feb 7, 8:36 pm, "Jay Parlar" <[EMAIL PROTECTED]> wrote: > > Chris Long was the original maintainer, and he kept

Re: Best Practices for faster template rendering

2007-02-08 Thread Jeremy Dunck
On 2/8/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote: ... > If not, just how many rows are we talking? How big is the final, > rendered template? One more idea: It looks like you're doing foreign-key lookups in the rendering. {% for workoutWeek in workoutWeeks %} ... {% for workoutDay in

Re: Best Practices for faster template rendering

2007-02-08 Thread Jeremy Dunck
On 2/8/07, Derek Lee-Wo <[EMAIL PROTECTED]> wrote: ... > I added a timing statement at the entrance and exit of render() and > just inside the foreach loop. I got over 3,000 lines output!! That depends largely on how many rows you have in the forloop, I imagine. Anyway, none of them stood out

Re: tying custom queries back into the queryset / object model / paginator... ?

2007-02-08 Thread Russell Keith-Magee
On 2/8/07, Michael Radziej <[EMAIL PROTECTED]> wrote: > > Sergey Kirillov: > > I'm using this function to load Django objects using custom sql > > > > obj_list = klass._default_manager.in_bulk(oid_list) > > But that's two queries. I think that there should be a way to do it > with one query.

Re: Best Practices for faster template rendering

2007-02-08 Thread Derek Lee-Wo
> I did as you suggested and the call template.render() is where the > 16-18 seconds are being spent. My next step is to add some timings to > django.template.NodeList.render as you suggested. I added a timing statement at the entrance and exit of render() and just inside the foreach loop. I

Re: Per object permissions

2007-02-08 Thread Scanner
On Feb 7, 8:36 pm, "Jay Parlar" <[EMAIL PROTECTED]> wrote: > Chris Long was the original maintainer, and he kept doing merges for > awhile. At this point though, I haven't seen him around these parts in > months. > > Adrian was doing it for awhile after that, but seems to have stopped. > > I've

Re: Newbie going nuts: Serving admin media files

2007-02-08 Thread [EMAIL PROTECTED]
Sorry, should have posted that urls.py is set right -- it worked before, and if I go to a bad url, the Django error says it searched the url pattern I have set for my admin (in this case /data/admin). Sure enough, I checked my error logs like Rob suggested and am getting a segmentation fault, as

Re: Newbie going nuts: Serving admin media files

2007-02-08 Thread voltron
Hi Matt! Have you checked your urls.py settings? You should map "yoursite/data/ admin" to the admin view On Feb 8, 10:11 pm, "oggie rob" <[EMAIL PROTECTED]> wrote: > > and have forgotten what I did. Now, when I try to call up my admin > > pages, I get nothing. A blank. So my hunch is that

Re: Best Practices for faster template rendering

2007-02-08 Thread Derek Lee-Wo
> You'll want to do something like this, timing each line: > > from django.template import loader > > source, origin = find_template_source('your_template_name') > template = get_template_from_string(source, origin, 'your_template_name') > template.render(your_context) > > -- > > It

Re: making session var available to all templates?

2007-02-08 Thread hotani
Thanks for the comments - I think I get it now... I have a file context_processors.py where I added the function, then the line in settings.py for TEMPLATE_CONTEXT_PROCESSORS, and all seems to be working now. I was trying to make this fit into my previously ingrained idea of using cookies to

Re: Newbie going nuts: Serving admin media files

2007-02-08 Thread oggie rob
> and have forgotten what I did. Now, when I try to call up my admin > pages, I get nothing. A blank. So my hunch is that apache isn't > serving up my admin media files, but I can't figure out why. Any help > is greatly appreciated. I don't think it is not your media files. If you had no media

Re: making session var available to all templates?

2007-02-08 Thread James Bennett
On 2/8/07, hotani <[EMAIL PROTECTED]> wrote: > This has been asked several times, but I am not clear on how people > are solving it. From what I understand so far, a setting called > "TEMPLATE_CONTEXT_PROCESSORS" can be tweaked to make this possible. > However, I'm not seeing a clear way to do

Re: making session var available to all templates?

2007-02-08 Thread Joseph Heck
If you use RequestContext in your views (as opposed to just Context), then the request object becomes available in all templates - and through it the session {{request.session}}. i.e. from django.template import RequestContext ... return render_to_response('mypage.html', {

Re: making session var available to all templates?

2007-02-08 Thread Guillermo Fernandez Castellanos
Hi, > This has been asked several times, but I am not clear on how people > are solving it. From what I understand so far, a setting called > "TEMPLATE_CONTEXT_PROCESSORS" can be tweaked to make this possible. > However, I'm not seeing a clear way to do that. A context processor is nothing more

making session var available to all templates?

2007-02-08 Thread hotani
This has been asked several times, but I am not clear on how people are solving it. From what I understand so far, a setting called "TEMPLATE_CONTEXT_PROCESSORS" can be tweaked to make this possible. However, I'm not seeing a clear way to do that. I have a user setting which needs to be

Newbie going nuts: Serving admin media files

2007-02-08 Thread [EMAIL PROTECTED]
I had this working once, but tinkered with something, took a week off and have forgotten what I did. Now, when I try to call up my admin pages, I get nothing. A blank. So my hunch is that apache isn't serving up my admin media files, but I can't figure out why. Any help is greatly appreciated.

Re: Using re.VERBOSE with urls.py?

2007-02-08 Thread Jeremy Dunck
On 2/8/07, Tim Chase <[EMAIL PROTECTED]> wrote: > > Any hints? Thanks, > > -tkc No, but I need something like that and just broke it down in to vars, concatenating them later: cat_re = r"(in/(?P([^/]+/)*))?" ... (r'^(?P\d{4})/(?P\w{3})/%s$' % cat_re, ...),

Order of in_line classes

2007-02-08 Thread Reef
I have a class that displays several other in_line classes in the admin. The order that the in_line classes display appears to be in the same order as the database tables for each class are created during manage.py psyncdb process (I know this by looking at the output from manage.py sqlall). Is

Using re.VERBOSE with urls.py?

2007-02-08 Thread Tim Chase
This may have a simple answer that I've overlooked. Is there a way to specify that the regexps used for mapping URLs in urls.py are in re.VERBOSE format rather than all in one line? I have several pieces that are easily recognizable when specified as VERBOSE, but when given in one line, it

Re: Parsing uploaded files at creation time

2007-02-08 Thread [EMAIL PROTECTED]
On Feb 6, 8:29 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm developing a small app that has a model that will include a need > for the user to upload a list of things from a flat file upload (user > list one user per line). > > What I want to do is to parse this file when the instance

Windows install

2007-02-08 Thread Dale Wilson
Hi, As a newbie to Django I failed to read the install doc correctly and tried to run setup.py rather than simply checking django out of svn directly into site-packages. Reading the doc more carefully solved my problem, but in the meantime I found a "buglet" in setup.py that should probably be

Re: Having trouble with my M2M relationship.

2007-02-08 Thread [EMAIL PROTECTED]
So it is. Thank you. On Feb 8, 9:04 am, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > sponsor = models.ManyToManyField(Sponsor, > > filter_interface=models.HORIZONTAL, related_name="section") > > > What I'm trying to do in a template is show all the sections

Re: Best Practices for faster template rendering

2007-02-08 Thread Jeremy Dunck
On 2/8/07, Derek Lee-Wo <[EMAIL PROTECTED]> wrote: > I wasn't aware of that, but in my case, I am processing the data > before I render the template. I actually loop though all the records > and do some processing so I know the SQL queries are occurring within > the 0.5 seconds I mentioned

Re: tiny mce - Error: uncaught exception: Permission denied to get property Window.tinyMCE

2007-02-08 Thread temnoregg
SOLUTION add this line document.domain = "domain.com"; into tiny_mce_popup.js after init: function() like that init : function() { document.domain = "domain.com"; var win = window.opener ? window.opener : window.dialogArguments, c; var inst;

Re: Upgrade from build 4454 to 4463 induced problem in template

2007-02-08 Thread gordyt
Thanks Michael! I just diff'ed all the changes between the two revisions in question and they are truly minor. I know think that the new revision is just reporting an error that was being glossed over silently before. And I never knew about it because, in spite of the error, everything

Re: Having trouble with my M2M relationship.

2007-02-08 Thread Ivan Sagalaev
[EMAIL PROTECTED] wrote: > sponsor = models.ManyToManyField(Sponsor, > filter_interface=models.HORIZONTAL, related_name="section") > > > What I'm trying to do in a template is show all the sections that > sponsor is in. It seems to me I should be able to do something like > > {% for

Re: Upgrade from build 4454 to 4463 induced problem in template

2007-02-08 Thread Michael Radziej
gordyt: > Howdy Folks! > > I have been running with trunk revision 4454. I just updated to > revision 4463 and a bit of code that has never shown any problems is > now broken.. :-( That was a bug, but it has been fixed in the meantime. Just make another update ;-) Michael -- noris network

Having trouble with my M2M relationship.

2007-02-08 Thread [EMAIL PROTECTED]
In my model I have (abbreviated version): class Sponsor(models.Model): name = models.CharField(maxlength=100) class Admin: pass class Section(models.Model): section = models.CharField(maxlength=200, core=True, blank=True, null=True) sponsor =

Upgrade from build 4454 to 4463 induced problem in template

2007-02-08 Thread gordyt
Howdy Folks! I have been running with trunk revision 4454. I just updated to revision 4463 and a bit of code that has never shown any problems is now broken.. :-( The error being reported is: ProgrammingError at /kindledb/customers/5320/ (1064, "You have an error in your SQL syntax; check the

Re: Best Practices for faster template rendering

2007-02-08 Thread Derek Lee-Wo
> > My app does a bunch of database queries and processing and when I > > timed that part, it all completes within 0.5 seconds, but the call to > > render_to_response() takes 18 seconds. Needless to say, the end-user > > experience isn't acceptable. > > I don't know if you are aware about the

Re: Best Practices for faster template rendering

2007-02-08 Thread Istvan Albert
On Feb 7, 10:58 pm, "Derek Lee-Wo" <[EMAIL PROTECTED]> wrote: > My app does a bunch of database queries and processing and when I > timed that part, it all completes within 0.5 seconds, but the call to > render_to_response() takes 18 seconds. Needless to say, the end-user > experience isn't

Re: tying custom queries back into the queryset / object model / paginator... ?

2007-02-08 Thread Michael Radziej
Sergey Kirillov: > I'm using this function to load Django objects using custom sql > > obj_list = klass._default_manager.in_bulk(oid_list) But that's two queries. I think that there should be a way to do it with one query. Michael -- noris network AG - Deutschherrnstraße 15-19 - D-90429

Re: tying custom queries back into the queryset / object model / paginator... ?

2007-02-08 Thread Sergey Kirillov
I'm using this function to load Django objects using custom sql --- def get_objects_by_sql(klass, query, query_data=[]): """Return objects using model class and query which returns object id set. First column returned by query will be used as object id for lookup""" cur =

Re: moving url's of my site

2007-02-08 Thread plungerman
i have a ROOT_URL value set in my settings.py file. i use this throughout all applications and at the template level, where i have created a template tag to make it available as {%root_url%} def root_url(): if settings.ROOT_URL[1:] == "": ru = settings.ROOT_URL else: ru

Re: moving url's of my site

2007-02-08 Thread plungerman
i have a ROOT_URL value set in my settings.py file. i use this throughout all applications and at the template level, where i have created a template tag to make it available as {%root_url%} def root_url(): if settings.ROOT_URL[1:] == "": ru = settings.ROOT_URL else: ru

Re: moving url's of my site

2007-02-08 Thread skink
On Feb 7, 4:32 pm, "Reinmar" <[EMAIL PROTECTED]> wrote: > If you need to be flexible that way, I suppose you could set up a > constant like URL_PREFIX in a module, e.g. yourproject/constants.py, > and then > > from yourproject.constants import URL_PREFIX > > in your various urls.py, models.py

Re: save many to many data

2007-02-08 Thread Antonio
* giovedì 08 febbraio 2007, alle 07:17, Russell Keith-Magee wrote : > Ok - this is saving a form created from a model. Since your model > contains a m2m field, the form representing that model will have an > m2m widget, and when you save() the form, the m2m relation on the > object will be

Re: General help and help with an ordered ManyToMany

2007-02-08 Thread Gacha
I think you should pass only experments. The procedures whitch belongs to experment you can get simply {{ experment.procedures.all }} {% for exp in experiment_list %} {{ exp.id}} {{ exp.name }} {{ exp.description }} {{