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
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/",
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
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
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
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
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
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
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
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
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.
> 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
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
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
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
> 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
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
> 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
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
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',
{
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
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
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.
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, ...),
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
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
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
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
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
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
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;
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
[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
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
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 =
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
> > 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
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
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
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 =
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
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
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
* 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
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 }}
{{
45 matches
Mail list logo