hi , now I want to pass a parameter named user (user is a instance of
User) to the self_defined tags,could I do this ? I think the passed
parameter are all strings , is there a way to get its real type ?
thank you for your replying !
--~--~-~--~~~---~--~~
You
On 25-Aug-09, at 1:45 PM, Michel Thadeu Sabchuk wrote:
> This way I can disable signals for an specific operation, this is what
> I want but I prefer not modify django source. Is there another way to
> disable signals for an specific operation?
Here's an example:
On Tue, Aug 25, 2009 at 9:26 PM, stevedegrace wrote:
> I suppose this is easy enough to fix by doing the binding in the view
> when the context is first constructed which would probably have been
> easier in the first place, but now I'm curious and want to know what's
>
I just discovered something I did not expect.
Apparently a Django template does not behave like its context is a
single global scope where if you set a new variable using a custom
template tag it can be accessed anywhere subsequently in the template.
Variables you set into the context initially
Hi guys, i dont know from where is coming this error... but two hours
ago all was working fine... but know when i try to delete a user from
the Django Admin i got this error:
TypeError: coercing to Unicode: need string or buffer, User found
Somebody know why?
complete error code:
TypeError
I had this problem when I started developing this project (my first)
on my server space at Dreamhost, so as suggested by a forum member I
began developing on my local machine with the django dev server. Why
is it that changes made to templates are not reflected upon restarting
the server or
I had this identical problem. Thanks for the help.
Chris
On Jul 10, 8:12 pm, adelaide_mike wrote:
> Very cool, Rajesh D. Thanks.
>
> Mike
>
> On Jul 11, 12:31 am, Rajesh D wrote:
>
> > On Jul 10, 11:06 am, adelaide_mike
I had a working web service that I built with django 1.0.1 , python
2.3, soaplib using the djangostack from BitNami. Everything worked
fine with the development server. I never could get my service
working under mod_python and the BitNami apache install.
Throwing caution to the wind, I did a
On Tue, Aug 25, 2009 at 7:37 PM, Sonal Breed wrote:
>
> Hello all,
>
> I am trying to have enchant package on server machine. Just using easy-
> install PyEnchant did not work as I get following errors when I try to
> import enchant package in python interactive window:
>
Use python to call a PDF reader via the command line -
http://support.adobe.com/devsup/devsup.nsf/docs/52080.htm
http://foxit.vo.llnwd.net/o28/pub/foxit/manual/enu/FoxitReader30_Manual.pdf
(see the Command Line section)
Depending on the complexity of your PDFs, I'd recommend using Foxit
Hi guys :o)
Im attempting to create a template tag but I get a strange response.
it returns "None" where I put the {% if blog_detail %} tag
Here is my template tag
class BlogNode(Node):
def __init__(self, user, varname):
self.user, self.varname = user, varname
Hi all,
I am trying to understand spanning multi-valued relationships (as
documented here
http://docs.djangoproject.com/en/dev/topics/db/queries/#spanning-multi-valued-relationships).
More specifically, these paragraphs:
"Everything inside a single filter() call is applied simultaneously to
Hello all,
I am trying to have enchant package on server machine. Just using easy-
install PyEnchant did not work as I get following errors when I try to
import enchant package in python interactive window:
>>> import enchant
Traceback (most recent call last):
File "", line 1, in
File
The solution I eventually used is to require that the reviewer
queryset be stored in a session variable. Since this queryset is
required in the template context in order for the templatetags to
work, saving the value in a session variable isn't much to ask.
Please let me know if you think this
Hi all,
First, congrats on the release of 1.1, real exciting!
Second, I'm working on a web site that basically allows athletes to register
on it with the goal of tracking their game stats. So, for example, if an
athlete plays baseball, he can track specific stats such as number of home
runs,
Ya, when I'm writing unit tests for my forms. What I wanted was a way in my
testing logic to generate a dictionary of values to post back to the server
based on the initial values of the forms in the content property of the
response object returned from the test client get() and/or post() methods.
Since you say you refreshed your web browsers and refreshed your web server,
the only thing I can guess is that you did not save your edits or you did
not commit to your source repositories and do an update of the source on the
server. If you are sure your edits are there, perhaps there is a hung
When I make changes to templates they are not showing up upon refresh
or restarting the test server, any ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email
You can add and modify fields on a form in the form's __init__
function.
class MyForm(forms.Form):
country = forms.ChoiceField()
def __init__(self, *args, **kwargs):
super(MyForm, self).__init__(*args, **kwargs)
self.fields['country'].choices = \
[(c.iso_code,
On Tuesday 25 August 2009 01:44:56 pm Sandra Django wrote:
> Hi Mike, excellent answer, thanks. Look, I followed this example:
> http://www.djangrrl.com/view/custom-template-tags-in-django/
> But my problem is that don't displays list categories, but neither I get
> error. I copied exactly that
I fear your only option is to write a recursive function which you
feed with what you define to be "the end of the chain".
You can collect all the entries in a mutable list. Some example,
untested, code:
def get_all_parents(list_, current):
for entry in current.following_to.all():
Hi Mike, excellent answer, thanks. Look, I followed this example:
http://www.djangrrl.com/view/custom-template-tags-in-django/
But my problem is that don't displays list categories, but neither I get
error. I copied exactly that appears in that article, but I don't have good
results.
Can you help
what's wrong with turning it into a list? If you gzip it it won't be
that big.
On Aug 25, 5:16 pm, John Baker wrote:
> I need to json serialize some very large objects which include large
> arrays. How can I do this in django? The arrays will be very big and
> heavily
Hi guys,
I'm using the following snippet to duplicate instances of objects:
http://www.djangosnippets.org/snippets/1282/
The problem is that some objects have signals connected to auto create
some related information. What do you suggests me to avoid problems
with these signals? I found the
Do you mean when you write tests?
If so, when you get the response you can extract all the variables
that was created inside the view if you're using locals().
That way, you can probably get the form instance (created for example
by form=MyForm(request.POST)) which you can then untangle to get
Here's an example:
http://www.djangosnippets.org/snippets/1322/
On Aug 25, 5:43 pm, John wrote:
> > Isn't it just
> > request.raw_post_data
>
> Thanks and I suspected it was that but hoped there might be a little
> example somewhere as the docs don't say much only this:
>
>
On Tuesday 25 August 2009 12:56:12 pm Sandra Django wrote:
> Hi friends, I'm trying to custom the index.html of Django. For that, I'm
> writing a custom template tag (categories.py). This module should display a
> list, but don't display anything. Why? I'll describe that I did because if
> you can
Hi friends, I'm trying to custom the index.html of Django. For that, I'm
writing a custom template tag (categories.py). This module should display a
list, but don't display anything. Why? I'll describe that I did because if
you can you explain me what is the problem, ok?
1) I created
On Aug 25, 12:22 pm, Alex Gaynor wrote:
> You can put your tests in a tests.py file, however you still need to
> have an empty models.py file, so Django picks up the app correctly.
Thanks Alex - unfortunately, if I put an empty models.py file in, I
get an exception when
On Tue, Aug 25, 2009 at 2:40 PM, tom wrote:
> Hi all,
>
> i want to create a form with django. the form should look like a matrix
> (or like an excel/oocalc sheet). i attached a screenshot how the form
> should look like.
> can anybody tell me how to do this with django?
>
Hi all,
i want to create a form with django. the form should look like a matrix
(or like an excel/oocalc sheet). i attached a screenshot how the form
should look like.
can anybody tell me how to do this with django?
Cheers
tom
--~--~-~--~~~---~--~~
You received
On Tue, Aug 25, 2009 at 8:35 PM, Dennis Fogg wrote:
> PS: more succinctly: status notifications can happen in many places and
> passing the session to all these places just for the status notification
> does not make the code any clearer. Thus, I just want to access the
Hi,
first, my models:
class Connection(models.Model):
p1 = models.ForeignKey(SinglePoint, related_name='p1_set',
help_text="Punkt 1")
p2 = models.ForeignKey(SinglePoint, related_name='p2_set',
help_text="Punkt 2")
...
class Meta:
unique_together = (('p1',
On Tue, Aug 25, 2009 at 2:12 PM, Joseph (Driftwood Cove
Designs) wrote:
>
> We use a custom authentication backend, and I'm trying to develop a
> test suite for it. The app has no model, since it uses the model from
> contrib.auth So, I put my tests in tests.py, but the
We use a custom authentication backend, and I'm trying to develop a
test suite for it. The app has no model, since it uses the model from
contrib.auth So, I put my tests in tests.py, but the test runner does
not load it, even though the custom auth app is in INSTALLED_APPS. I
tried adding an
PS: more succinctly: status notifications can happen in many places and
passing the session to all these places just for the status notification
does not make the code any clearer. Thus, I just want to access the session
as a global variable -- how can I do that?
On Wed, Aug 26, 2009 at 2:30
I looked at my code based on your feedback.
In this particular case, the code that needs the request is doing status
notifications
http://blog.ianbicking.org/web-application-patterns-status-notification.html
and
it needs access to the session from the request object.
You are correct in that what
On Jul 26, 6:06 pm, Russell Keith-Magee
wrote:
> One approach that may be worth considering is to look at whether you
> actually need to put contrib.authin INSTALLED APPS. If you're just
> using some of the backend utilities - such as the authentication
> backends - you
On Tue, Aug 25, 2009 at 7:32 PM, Dennis wrote:
>
> I seem to need the Django HttpRequest object in functions that are
> called by view functions.
> I could pass the request, but I'm thinking of trying to create a
> closure in middleware so that
> I can access the request
I seem to need the Django HttpRequest object in functions that are
called by view functions.
I could pass the request, but I'm thinking of trying to create a
closure in middleware so that
I can access the request object (and maybe other objects) from
anywhere.
This seems like it's stretching the
I am putting together a project that involves the following models:
class contentcreator(models.Model):
name = models.CharField(max_length=50)
phone = models.CharField(max_length=60, blank=True)
supervisor = models.CharField(max_length=60)
department =
> Isn't it just
> request.raw_post_data
Thanks and I suspected it was that but hoped there might be a little
example somewhere as the docs don't say much only this:
HttpRequest.raw_post_data
The raw HTTP POST data. This is only useful for advanced
processing. Use POST instead.
As I am
On Tue, Aug 25, 2009 at 4:44 PM, Benjamin Wohlwend wrote:
>
> Hi,
>
> I'm trying to generate documentation for my django project with sphinx
> [1] and autodoc[2]. It's mostly working, but I can't get sphinx to
> pick up my model field definitions (with the exception of
Suppose you have a PDF (generated or downloaded from the internet),
are you able to get it printed by scripting?
On Aug 25, 4:38 pm, mettwoch wrote:
> How do the Django people handle printing directly on Windows? I
> remembered
I need to json serialize some very large objects which include large
arrays. How can I do this in django? The arrays will be very big and
heavily processed before so need to use efficient array storage.
Testing with arrays I get..
TypeError at /zeros/
array([ 0., 0., 0., 0., 0., 0., 0.,
On Aug 25, 4:54 pm, John Baker wrote:
> Some of my views need to process arbitrary incoming data that isn't a
> normal web request i.e. process an incoming document and return an
> altered document.
>
> How do I get a view to process raw incoming data rather than the usual
Group,
I am attempting to connect Django with SQL Server 2008. My dev server
is running on a Win 7 box and SQL Server is on a Win 2003 box. When
posting from the authentication form, I get exception 10061,
'Connection refused'. Traceback below. I am using django-pyodbc
revision 115. I had it all
Now I'm able to login etc, but only with django-server, with apache also the
admin interface informs me that my browser doesn't allow cookies. So there's
a problem with apache and/or mod_python. :-/
I'll test this after the planned upgrade to lenny again.
Some of my views need to process arbitrary incoming data that isn't a
normal web request i.e. process an incoming document and return an
altered document.
How do I get a view to process raw incoming data rather than the usual
encoded parameters and form etc?
It is obvious how to do this on
How do the Django people handle printing directly on Windows? I
remembered about http://timgolden.me.uk/python/win32_how_do_i/print.html,
but unfortunately his method for PDFs only print on the default
printer. I need the server to produce the PDF, save it (works already)
and send it to a
I'm working on putting together parsing logic so that I can extract the form
variables from the response content of the test Client. That way I can just
change a few values and throw it back at the server. This is especially
helpful with large dynamic forms that use formsets.
My question is, has
Hi,
Does anyone have tried django-lucene module for search ??
I am able to compile the lucene and jcc as required but the module is
not working properly as it is expected to work. As mentioned in the
docs I have added to fields in my model
objects = models.Manager()
objects_search =
Hi,
I'm trying to generate documentation for my django project with sphinx
[1] and autodoc[2]. It's mostly working, but I can't get sphinx to
pick up my model field definitions (with the exception of related
fields like m2m or ForeignKey). I asked in the IRC channel of sphinx
(#pocoo on
Almost resolved with this code:
class EntryForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(EntryForm, self).__init__(*args, **kwargs)
self.fields['authorcategory'].queryset =
AuthorCategory.objects.filter(
author=2)
class
Does anyone else have an idea of what could possibly cause this type
of error?
No found
matching the query
I'm not looking for a spoonfed solution, just an idea of why this type
of error occurs.
Thanks for all your help,
Bob
On Aug 24, 1:24 pm, Daniel Roseman wrote:
i solved it with:
def add_project(request):
if request.method == 'POST':
form = ProjectForm(data=request.POST)
if form.is_valid():
new_project = form.save(commit=False)
new_project.slug = new_project.title.lower().replace('
','-')
Hi django Users.
I need to know if somebody has used Django on godaddy Host service ?
If yes, is easy to configure ? what recomended to me in that case ?
Thank you!
Regards
--
Andrés Martín Ochoa;
passport: andresmar...@linuxmail.org;
Linux Registered User #436420;
Asterisk User Number: 1000;
On Tue, Aug 25, 2009 at 6:28 PM, peterf81 wrote:
>
> Hello,
> what could be the problem when from this code :
>
> reputation = Repute.objects.extra(
> select={'positive': 'sum(positive)', 'negative': 'sum
> (negative)', 'question_id':'question_id',
>
If you have plain text (After you have removed out all HTML tags), a
simple URLIZE filter would work, and allow links to be clickable.
more details:
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#urlize
On Tue, Aug 25, 2009 at 2:27 PM, Matias wrote:
>
So, how to see AuthorCategory items filtered by currently loged in
user in admin ?
On Aug 25, 3:54 pm, Alsond wrote:
> System needs to types of categories. First one is used by all. Second
> one is created by author.
> In admin on new Entry I would like tu see all
Hello i have this:
errore = """
{ alert('test_js')};
"""
return mark_safe(errore)
I get this error : AttributeError: 'SafeString' object has no
attribute 'status_code'
can you help me to write the correct one?
Thanks
Luca
System needs to types of categories. First one is used by all. Second
one is created by author.
In admin on new Entry I would like tu see all items from Category
and in AuthorCategory would like to see AuthorCategory items where
User is current user.
from django.contrib.auth.models import User
On Aug 25, 2:07 pm, luca72 wrote:
> Hello i have this:
> errore = """
> { alert('test_js')};
> """
> return mark_safe(errore)
> I get this error : AttributeError: 'SafeString' object has no
> attribute 'status_code'
> can you help me
hi,
i have a custom add method for a front end editing of my project model.
now i have the problem that my url is composed by /year/slug and slug is
set as unique for pub_date__year in the model. obviously this is not
respected by my form so i want to check if the slug already exists for
the
Thanks now it works
Luca
On 25 Ago, 15:12, Daniel Roseman wrote:
> On Aug 25, 2:07 pm, luca72 wrote:
>
> > Hello i have this:
> > errore = """
> > { alert('test_js')};
> > """
> > return mark_safe(errore)
> >
Hi,
I think there is no such filter, so you'll have to code it.
This
http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#filters-and-auto-escapingmay
help
HTH,
Matias.
On Tue, Aug 25, 2009 at 5:54 AM, When ideas fail
wrote:
>
> Thanks, can i strip out all
Hello,
what could be the problem when from this code :
reputation = Repute.objects.extra(
select={'positive': 'sum(positive)', 'negative': 'sum
(negative)', 'question_id':'question_id',
'title': 'question.title'},
tables=['repute', 'question'],
an ideea:
build a custom Model Form for Character, and after that define CharacterHome
Model Form.
class CharacterForm(forms.ModelForm):
class Meta:
model = Character
exclude = ('some', 'fields','here', 'that', 'you', 'do', 'not',
'want', 'to', 'display' )
class
Hi Thomas,
I did a Google search and did as one suggestion:
$ export PYTHONPATH=$HOME/:$PYTHONPATH
$ export DJANGO_SETTINGS_MODULE=mysite3.settings
$ python
>>> from django.contrib.sessions.backends import db
It works with no error. The same thing works if I do "python manage.py
shell" without
Hi Léon,
it's not that basic. Picking up your example, I define a Form based on
CharacterHome. Then I show 1 entry from CharacterHome; the field
'character' is shown as a MultipleChoiceField where ALL entries from
Character are listed. But I need only the one particular record that
ist referenced
Hi Léon,
it's not that basic. Picking up your example, I define a Form based on
CharacterHome. Then I show 1 entry from CharacterHome; the field
'character' is shown as a MultipleChoiceField where ALL entries from
Character are listed. But I need only the one particular record that
ist referenced
Hi,
i implemented a many-to-many field in my model like:
class Entries(models.Model):
following_to = models.ManyToManyField('self', blank=True, null=True)
Now i can get all related Entries in a template with entry.following_to.all.
But i want to go deeper in relationships.
Lets say i have 4
Hi. Im sorry. I closed the question again, cause I found out that it
worked just fine :o)
Thanks for helping though :o)
On 25 Aug., 02:51, Karen Tracey wrote:
> On Mon, Aug 24, 2009 at 7:01 PM, MIL wrote:Since I had
>
> the pleasure of getting help in
Thanks, can i strip out all tags other than tags.
I would like people to be able to put links in comments.
Andrew
On 25 Aug, 03:42, Parag Shah wrote:
> Hi,
>
> You can use the strip_tags function to strip all html from text.
>
> from django.utils.html import strip_tags
>
Hi Thomas,
When I typed the following into my python console as advised:
>>> from django.contrib.session.backends import db
I got the following error:
Traceback (most recent call last): File "", line 1, in File
You have a good point there.
I only needed this to work with a small number of items.
Would you know how to do this any other way?
On 20 Aug 2009, at 14:36, krylatij wrote:
>
> I think that is not the best solution.
> As i understand you are ordering only displayed items because of
>
On Pzt, 2009-08-24 at 07:14 -0700, Daniel Roseman wrote:
> On Aug 24, 2:45 pm, Hotmail wrote:
> > On Pzt, 2009-08-24 at 06:17 -0700, Daniel Roseman wrote:
> >
> > > On Aug 24, 12:51 pm, Gungor wrote:
> > > > I have a register() takes at most 3
Hi Simon,
your first traceback looked like this:
[Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1] mod_wsgi
(pid=120): Exception occurred processing WSGI script '/Users/myname/
mysite3/apache/myapp.wsgi'.
[Wed Aug 19 11:00:26 2009] [error] [client 127.0.0.1] Traceback (most
recent call
Hi,
Is it possible to dynamically add fields to a formwizard form. I have
been able to add the fields I want but if the form fails validation
the new dynamic fields disappear when the form re-renders. Is it
possible to override this so that I can validate and return the new
fields if the
jOn Tue, Aug 25, 2009 at 12:30 AM, Fergus wrote:
>
> Running Django 1.1, and I get funny results in testing which indicate
> ordering.
>
> Two applications: A and B.
>
> A requires that you set settings.A_SETTING in your project's
> settings.py, which refers to an
80 matches
Mail list logo