ces but maybe even
use del self.base_fields['choice1'] etc somehow to remove them from
the form before it validates?
I'm just really confused.
Mike
--
Michael Lake
Caver, Linux enthusiast & interested in most things technical.
--~--~-~--~~~---~--~--
gs
except:
return '- Cannot import settings file -'
return settings.URL_ROOT
and in settings.py I have:
URL_ROOT = '/path_to/my_app' # Don't include any trailing /
--
Michael Lake
Computational Research Support Unit
Science Faculty, UTS
Ph: 9514 2238
;m on Markdown + my template filter on top of it buy maybe
> it's better to use python-born ReST? What are your experiences with
> them?
>
>
> >
>
--
Michael Lake
Computational Research Support Unit
Science Faculty, UTS
Ph: 9514 2238
--~--~-~--~~-
Nis Jørgensen wrote:
> As others have said, you can stuff things into request.session (after
> adding the right middleware incantations).
Using the session middleware looks far better but it will take me a while to
try that
out. I'll try and do that next week.
> What is so bad about leaving th
Ah does this way seem sensible?
> Nis Jørgensen wrote:
>>The argument to HttpResponseRedirect is a url. You seem to be confusing
>>it with a template.
code
# some error occurs
return HttpResponseRedirect('error/2/')
def error(request, message):
{
error_messages = {
'1': 'Yo
Hi all
Nis Jørgensen wrote:
> The argument to HttpResponseRedirect is a url. You seem to be confusing
> it with a template.
OK I can do this:
code
# some error occurs
message = 'You have ... tell admin that '
return HttpResponseRedirect('error/')
and h
Hi all
A really simple question:
I'm mostly using code like this:
data = {'message': 'Some message to user...'}
return render_to_response('main.html', data)
But for error messages to users if one wishes to use a redirect like this:
return HttpResponseRedirect('/error_pag
.who = str(threadlocals.get_current_user())
and now I get the usernmame updated correctly and no errors.
I am using Django 0.97-pre, SVN 5754
Michael Lake wrote:
> Hi all
>
> I am using ThreadLocals from
> http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
>
> I am getti
Hi all
I am using ThreadLocals from
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
I am getting this error on submitting the form:
InterfaceError at /erun/10/1/
Error binding parameter 5 - probably unsupported type.
This is my model:
class Data(models.Model):
date
go project :-)
"Near them their sisters three, the Gorgons, winged
With snakes for hair-- hated of mortal man--"
Aeschylus
Malcolm Tredinnick wrote:
> On Tue, 2007-07-03 at 13:02 +1000, Michael Lake wrote:
> [...]
>
>>I didn't realise I was dealing with b
Hi
> On Tue, 2007-07-03 at 11:35 +1000, Michael Lake wrote:
>>I'm having problems overriding a method in a model.
>>I have seen how to override the save and delete methods and overriding a save
>>works
>>fine http://www.djangoproject.com/documentation/model-a
Hi all
I'm having problems overriding a method in a model.
I have seen how to override the save and delete methods and overriding a save
works
fine http://www.djangoproject.com/documentation/model-api/
But I'm trying to override other automatically generated methods.
Currently if I create a pr
ng
the groups.
Mike
--
Michael Lake
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this gro
Jeremy Dunck wrote:
> On 5/23/07, Michael Lake <[EMAIL PROTECTED]> wrote:
>>I notice it's a Set object comprising a single list. So I thought I could do
>>this:
>>
>>{% for item in perms.lab %}
>>{{ item }}
>>{% endfor %}
>
>
&
; Aidas for your help.
I notice it's a Set object comprising a single list. So I thought I could do
this:
{% for item in perms.lab %}
{{ item }}
{% endfor %}
But the above just seems to hand the browser and waits and waits...
Mike
--
Michael Lake
--~--~-~--~~--
can add a lab test.
I could create a dictionary in the view of all the permission things I'd need
in a
template and pass that in but the {{ perms }} seems like it is really what I
should
be using as it supposed to be automatically available from the request object.
--
Michael Lake
--~--~
ong?
Mike
--
Michael Lake
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email
ween
{{ description | markdown | wikiform }} and
{{ description | textile | wikiform }} by editing all the templates :-)
Mike
--
Michael Lake
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
data
content = pattern_inputbox.sub(replacement, content, 1)
return content
# If you are not using Python 2.4 i.e. your using 2.3 then place the
# register.filter lines here after the defines above, otherwise you
# will get a NameError.
register.filter('wikiform', wikiform)
--
M
min example up and running and then add some validation (like
checking that it is an image and say checking its size) after I have a small
test
working fine.
Michael Lake wrote:
> Hi all
>
> Guillaume wrote in May "Newform and File Upload problem"
>
>
>>Well,
Hi all
Guillaume wrote in May "Newform and File Upload problem"
> Well, my message was maybe a little long. I still have not found answers
> to my problem. To make it short, Is there anywhere a short example of file
> upload using newform ?
> The most simple thing with a model with 1 FileFi
Alexander Pugachev wrote:
> Newlines characters do not break lines in HTML. You need in strings to
> show text in few lines in list view.
Ah :-) Obvious now why it wasn't rendering the text as text with newlines..
Thanks.
--
Michael Lake
Computational Research Support Unit
Scie
Michael Lake wrote:
> Alexander Pugachev wrote:
>>What is the type of the field? It should be TextField?
>
> Yes it is:
>description = models.TextField(core=True)
To be more precise; the new lines do not show when the admin interface just
displays
the field but it does
output like this:
>>line 1
>>line 2
>>
>>But when I view this in the admin interface I get
>>line 1 line 2
>>
>>How can I get the admin interface to not ignore newlines?
>>
>>Mike
--
Mi
Hi all
I have a content field which has newlines in it. When I do a select from the
database
of that field I get the output like this:
line 1
line 2
But when I view this in the admin interface I get
line 1 line 2
How can I get the admin interface to not ignore newlines?
Mike
--~--~
min the Data table show the correct headings and there is no errors.
ID Experiment id Node id Content
Hence it appears that in a model that if one has fields with _id in their name
there
are problems.
Michael Lake wrote:
> Hi all
>
> In the Admin interface I'm getting the
still get the error Error: variable not passed into template?>Data
> On Apr 18, 10:39 pm, Michael Lake <[EMAIL PROTECTED]> wrote:
>
>>Hi all
>>
>>In the Admin interface I'm getting the folloing error for a model:
>>Error: variable not passed into
te a row and I can edit the rows using the admin
interface.
I can't see whats wrong with this particular model.
manage syncdb runs with no errors and manage.py validate says 0 errors.
In models.py the other models display fine in the Admin interface.
message = 'Some other error message.'
return HttpResponseRedirect("%s" % request.path)
data = { 'request': request,
'message': message,
'form': form.as_table(),
}
return render_to_response('test_form_
tils is just in the site-packages directory but now
knowing
what to look for I can see where this is set. I modified
docutils/readers/standalone.py as set the value from 1 to 0 and now a lone H1
is
shown :-)
It's probably best to use for me to look at tryin
Hi
> On Mon, 2007-04-02 at 15:24 +1000, Michael Lake wrote:
>
>>Hi all
>>I have a problem I think when I use the markup package. This provides
>>markdown,
>>textile and restructuredtext markups. I have the following in views.py:
>>
>>def testwiki:
&
haracter above the heading like 'a' then the
heading
shows fine. It also works fine if I have a H1 anywhere lower down. But If I
just wish
to have one H1 level Im in problems.
Maybe this is a restructured text parsing problem? Has anyone seen this?
Mike
--
Michael Lake
--~--~--
Jeremy Dunck wrote:
> On 3/29/07, Michael Lake <[EMAIL PROTECTED]> wrote:
> ...
>>MyTag is {{ mytag }} end.
>>
> {% mytag %}
> {{ }} is for variables. :)
Thanks. With that change it is now working. Although I had read the
documentation and
it shows {% %}
he root URL depending on the DEBUG
> setting.
> """
> try:
> from django.conf import settings
> except ImportError:
> return ''
> if settings.DEBUG:
> return settings.URL_ROOT_DEBUG
> else:
> return set
#053f939b4f5cdaca
Root URI in templates
http://groups.google.com/group/django-users/browse_thread/thread/3346f3f509bf3bf8/c8595511c8d34c05?lnk=gst&q=url+root&rnum=4&hl=en#
Project URL-prefix
http://groups.google.com/group/django-users/browse_thread/thread/f16d6bcf4d667069/
limodou wrote:
> You can also use PyIf tag(written by me) to do that.
> http://www.djangosnippets.org/snippets/12/
> And it can support any python expression. So it's more general I think.
And it's short and understandable. I like it too.
Thanks
Mi
Kenneth Gonsalves wrote:
> On 22-Mar-07, at 9:25 AM, Michael Lake wrote:
>>>write your own tag - someone has done it, you can see it in this
>>>file:
>>>
>>>http://nrcfosshelpline.in/code/browser/trunk/web/templatetags/
>>>base_utils.py
>>
the markdown library is not installed
which is
much much better. I have to get and install that and then I think I should be
running
fine.
Thanks
--
Michael Lake
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
n/code/browser/trunk/web/templatetags/
> base_utils.py
>
> class CompareNode near the end
But that link above no longer works.
Does anyone have some code for this?
I looked in Django Snippets and didn't find such a snippet.
Mike
--
Michael Lake
--~--~-~--~~
on2.3/site-packages/django/contrib/markup/templatetags/markup.py
I searched this mailing list for a few things and got some hits like this:
http://groups.google.com/group/django-users/browse_thread/thread/67f702f85e66de72/aa735b7e29039693?lnk=gst&q=markup&rnum=4&hl=en#aa735b7e29039693
Hi all
>>On 14-Mar-07, at 12:02 PM, Michael Lake wrote:
>>>The textarea is about two lines high only. I want the text entry
>>>box to be much bigger as it will be holding a full page of text ...
Kenneth helped out and suggested this:
>>widgets.TextArea(attrs={
rm': form,
}
return render_to_response('test.html', data)
TEMPLATE
Lots of text: {{ form.details }}
--
Michael Lake
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users&q
n saving them.
>
> In short, form.save() is really just a convenience method for one class
> of forms where saving is an easy thing to work out how to do. You may
> not always have it available.
Oh, it's complex. I think I sort of understand the above. Time for me to go
back a
bit
Malcolm Tredinnick wrote:
> Hi Michael,
>
> On Fri, 2007-03-02 at 16:08 +1100, Michael Lake wrote:
>> Im trying to understand newforms and comparing the newforms docs at
>> http://www.djangoproject.com/documentation/newforms/ with "Using djangos
>> newforms&qu
Malcolm Tredinnick wrote:
> On Fri, 2007-03-02 at 15:27 +1100, Michael Lake wrote:
>
>>Hi all
>>
>>I see in the documentation for forms that the HTML output will include the
>>validation
>>errors as a near the field. How does one change that? I would like t
}
return render_to_response('lab/test.html', data)
# In test.html
{{ form }}
Also I'm confused on the save methods. Some exemples use form.save() and others
define a save method under the model Class.
Sorry this is a bit of a long post with many ques
Hi all
I see in the documentation for forms that the HTML output will include the
validation
errors as a near the field. How does one change that? I would like the
errors to
be after the form field similar to this below irrespective of whether im
rendering it
as_p or asdefault table layout
pcount.append( (e.id, my_count) )
>>
>>return render_to_response('lab/experiments.html',
>>{'experiment_list': experiment_list,
>> 'ecount': ecount, # ecount is the number of experiments.
>>
ats perfect, thanks.
I now have
{% if not no_display %}
... a help link in a div
{% else %}
... a blank div element ...
{% endif %}
and in my views for the just for the help function I have:
render-to_reponse('lab/help.html', {'no_display': 1})
Works a treat. Thanks
nk to appear on the help page itself so I was
wanting
to have something like this in base.html
{% if template_name == help.html %}
{% else %}
Help
{% endif %}
where template_name or something is the name of the current template file being
rendered.
Mike
--
Michael
Malcolm Tredinnick wrote:
> On Mon, 2007-02-12 at 13:04 +1100, Michael Lake wrote:
>
>>Hi all
>>
>>I made this post earlier but since then I have gone back to try and get this
>>working
>>by understanding things via the django shell. The app is for a lab w
se that are in each experiment. The id field would not really be
used at
all - django just adds it.
--
Michael Lake
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
ment_detail.html
Experiment Detail
ID: {{ object.id }}
Name:{{ object.name }}
Description: {{ object.description}}
List of procedures for this experiment.
{{ ??? procedure_list.name }}
INCLUDE HERE A LIST
53 matches
Mail list logo