On 2007-12-17 22:41:08 -0700, Kenneth Gonsalves <[EMAIL PROTECTED]> said:
>
>
> On 18-Dec-07, at 10:33 AM, MrJogo wrote:
>
>> What's the practical difference between calling
>> DB.objects.filter(**kwargs) and DB.objects.get(**kwargs) (where
>> **kwargs can be whichever paramenters)? I understa
Manually call get_template() or select_template(), and stuff the
>resulting Template object into a module-global variable somewhere.
>Then just re-use it, calling render() with different contexts, each
>time you need it.
Along those lines, I recently noticed this bit of code that swaps the
get_te
If I pass a form into my template as a variable, is there a way to
tell what input type a field is in the template? My template creates
pretty boxes for the form fields, but I don't want them around hidden
inputs. I was hoping for something like {% ifequal field.type "hidden"
%} but I can't seem t
Hello
I am a newbe on this list. With the oldforms-admin i made a model with
some fields with 'limit_choices_to' options. Then i tried it with the
newadmin. There is no error message but also no effect. The list is not
'limited' but 'full'. Is this option gone in newadmin or have i to
program
I understand now. Thanks.
On Dec 17, 9:11 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote:
> On 18-Dec-07, at 10:33 AM, MrJogo wrote:
>
> > What's the practical difference between calling
> > DB.objects.filter(**kwargs) and DB.objects.get(**kwargs) (where
> > **kwargs can be whichever paramenters
On 18-Dec-07, at 10:33 AM, MrJogo wrote:
> What's the practical difference between calling
> DB.objects.filter(**kwargs) and DB.objects.get(**kwargs) (where
> **kwargs can be whichever paramenters)? I understand that filter
> returns a QuerySet, but I don't really get how that affects me or my
>
What's the practical difference between calling
DB.objects.filter(**kwargs) and DB.objects.get(**kwargs) (where
**kwargs can be whichever paramenters)? I understand that filter
returns a QuerySet, but I don't really get how that affects me or my
code.
--~--~-~--~~~---~-
Sorry for the spam, looks like I can just grab the messages via
{{request.messages}} from within the templates.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email t
I know this has been asked a few times and the answer seems to be that
this is already included in generic views by default, but it's just
not showing anything in my {{messages}} variable on all of my generic
views. If i send messages and go to a regular page that's rendered
with render_to_respons
Hello,
I'm fairly certain this is a really easy thing I'm just not
understanding. I have some generic views that I want to pass a
RequestContext(request) object, but I'm not exactly sure how to do so.
I've been passing a RequestContext to all of my other pages using
render_to_response(), but I do
I have several fields define in my models like this:
CREDENTIALS_CHOICES = (
('LM', "Commercial Driver's License"),
('IN', 'Insured'),
('DR', 'DOT Registered (Interstate)'),
('FI', 'Fragile Item Qualified'),
)
credentials = models.CharField(max_length=2, blank=True,
Seems someone has already given this way better thought than I did.
See: "newforms-admin enable registering custom FilterSpecs" [1]
Very interesting indeed.
[1] http://code.djangoproject.com/ticket/5833
On Dec 18, 4:45 am, weathermess <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a question a
Hello,
I have a question about the use of 'list_filter' in the Django admin:
Is it possible to filter a list of records ('Chapters') of model 'B'
by a field ('language') of model 'A' (to which a ForeignKey field in
model 'B' is referring)?
For example:
--
Hello,
I have a question about the use of 'list_filter' in the Django admin:
Is it possible to filter a list of records ('Chapters') of model 'B'
by a field ('language') of model 'A' (to which a ForeignKey field in
model 'B' is referring)?
For example:
--
I'm close to launch a redesing of www.paradondevamos.com, with social
& multimedia capabilities.
I wonder what kind of tool let me do load testing against the site.
This is my base config:
- I'm running under joyent "M" virtual server, so Solaris 10, 256 RAM.
- I plan to use nginx as server for
On 2007-12-17 11:34:47 -0700, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> said:
>
> Dear all,
>
> I have two object :
>
> 1. contacts
> 2. phone number
>
> contacts and phone number is linked via a primary key foreign key
> connection with the primary key in contacts. The way the admin
> interfa
> On Sun, 2007-12-16 at 10:56 -0500, Tim Riley wrote:
> > Is there a way that the admins can limit the amount of spam coming
> > from this mailing list?
I've never moderated a google group, but it seems like a nice feature
would be the ability to require moderator approval of the FIRST post
made
So the recommendation seems to be when your selection choices are not
static you should go ahead and use a Foreign Key relationship. You get
the automatic loading of the table into a select widget etc.
But there's this issue of the cascade on delete.
I have a Student model with a Foreign Key rel
What about
$
{% filter floatformat:2 %}
{% get_element secondprice forloop.counter0 %}
{% endfilter %}
Regards,
--
Martín Conte Mac Donell
On Dec 17, 2007 6:53 PM, Greg <[EMAIL PROTECTED]> wrote:
>
> Martin,
> Yep...that worked. Thanks!
>
> However, now I'm not using the '|fl
Thank you Malcom.
Could you tell me: when the functionality is available, do you know
what the steps to create the sort order will be?
On Dec 17, 7:38 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sun, 2007-12-16 at 17:42 -0800,borntonetworkwrote:
> > Hello.
>
> > Does anyone have an i
On Dec 17, 2007 4:03 PM, Rob Hudson <[EMAIL PROTECTED]> wrote:
> If I understand correctly, these cache the templates after they have
> been rendered. What I'm curious about is if there is a way to cache
> templates before they are rendered so you can provide different
> contexts to them. It see
Rob Hudson schrieb:
> If I understand correctly, these cache the templates after they have
> been rendered. What I'm curious about is if there is a way to cache
> templates before they are rendered so you can provide different
> contexts to them. It seems like there would still be some gains
> If that does not get you any further, could you paste your complete
> model on dpaste.com?
Never mind dpaste, just post to this group.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post t
Hello
Could u share your code of the new template extends tag? I have very
similar problems here.
Kind Regards
Enoch Qin
On Nov 27, 5:58 pm, jorjun <[EMAIL PROTECTED]> wrote:
> OK, managed to do this in the end, by creating a new template tag and
> node derived from django.template.loader_tag.
Am 17.12.2007 um 23:03 schrieb Jan Rademaker:
>
>
> On Dec 17, 6:36 pm, Florian Lindner <[EMAIL PROTECTED]> wrote:
>>
>> my code in the model:
>>
>>def get_absolute_url(self):
>>return self.id
>>
>> Anyone else got an idea? I would send anyone any code he requests...
>>
>
On 12/17/07, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> http://www.djangoproject.com/documentation/cache/
If I understand correctly, these cache the templates after they have
been rendered. What I'm curious about is if there is a way to cache
templates before they are rendered so you can provi
On Dec 17, 6:36 pm, Florian Lindner <[EMAIL PROTECTED]> wrote:
>
> my code in the model:
>
> def get_absolute_url(self):
> return self.id
>
> Anyone else got an idea? I would send anyone any code he requests...
>
Are you sure your code is indented right, e.g. did you mix s
Martin,
Yep...that worked. Thanks!
However, now I'm not using the '|floatformat:2'. Is there anyway that
I can use that in my template with the new way:
${% get_element secondprice forloop.counter0 %}
For an example...currently I'm getting back 124.1...I would like to
have it be 124.10
On D
http://www.djangoproject.com/documentation/cache/
On 17 дек, 23:49, "Rob Hudson" <[EMAIL PROTECTED]> wrote:
> Howdy,
>
> A thought occurred to me today and I'm not 100% sure what Django does
> by default...
>
> Similar to the idea that PHP parses scripts for each request and
> having an opcode ca
In your mysite.fcgi script, just pass in the variable "prefork" instead of
threaded.
The other thing you could try is to use the ip address instead of 127.0.0.1.
-Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
I would like you to stop sending messages to me.
Thanks.
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
Check this game out! This is my city: http://mikeyopolis.myminicity.com
Whenever someone clicks on it, I get points! Start one up for
yourself!
Thanks Jim for your help. I have decided to set up one of the
database engines.
:-)
On Dec 17, 11:13 am, intercoder <[EMAIL PROTECTED]> wrote:
> So, should I make a file in the settings.py file called
> django_session, or something like that?
>
> Thanks again.:-)
>
> On Dec 13, 2:01 pm, jim
Howdy,
A thought occurred to me today and I'm not 100% sure what Django does
by default...
Similar to the idea that PHP parses scripts for each request and
having an opcode cache can increase performance, I'm wondering if
Django reads templates from the file system, parses them, and then
does th
0.97-pre-SVN-6940
Nothing much in the logs.
I just tried telnet 127.0.0.1 3303 and I get connection refused, so
maybe that is where the problem lies . . .
On Dec 17, 7:54 pm, "Martin Conte Mac Donell" <[EMAIL PROTECTED]>
wrote:
> Which version of django are you using? What do you see on lighttpd
How would I "run it prefork"? Sorry to be a dunce - I'm a bit new to
this!
I checked the logs, nothing in the error logs since I made a couple of
changes, thus:
fastcgi.server = (
"/mysite.fcgi" => (
"main" => (
# Use host / port instead of socket for TCP fastcgi
Which version of django are you using? What do you see on lighttpd logs? Is
port 3303 open with fcgi process?
Regards,
Martin Conte Mac Donell
On Dec 17, 2007 4:23 PM, Chris Moffitt <[EMAIL PROTECTED]> wrote:
> Take a look in the lighttpd server logs to see if there are any errors
> that might
You can do that with a very simple template tag
register = template.Library()
@register.simple_tag
def get_element(list, index):
# You should catch IndexError here.
return list[index]
Template side:
{% get_element secondprice forloop.counter0 %}
Regards,
Martin Conte Mac Donell
>
>
Thanks,
I changed that and my path in urls.py and it worked. I appreciate the
help.
On Dec 17, 2:37 pm, "Tim Riley" <[EMAIL PROTECTED]> wrote:
> you are missing the beginning quote in the html line.
>
> On Dec 17, 2007 2:27 PM, newDjangoer <[EMAIL PROTECTED]> wrote:
>
>
>
> > That is the html
you are missing the beginning quote in the html line.
On Dec 17, 2007 2:27 PM, newDjangoer <[EMAIL PROTECTED]> wrote:
>
> That is the html line
>
>
> from django.http import HttpResponse
> import datetime
>
> def current_datetime(request):
> now = datetime.datetime.now()
> html =
That is the html line
from django.http import HttpResponse
import datetime
def current_datetime(request):
now = datetime.datetime.now()
html = :It is now %s." % now
return HttpResponse(html)
On Dec 17, 2:13 pm, Christian Joergensen <[EMAIL PROTECTED]> wrote:
> newDjango
Take a look in the lighttpd server logs to see if there are any errors that
might point you in the right direction.
The other thing is that you're running this threaded but you're spawning
multiple processes. I suspect that could be causing problems too. Trying
running it prefork and see if that
newDjangoer wrote:
> Hello,
>
> I am a new user to Django and developing apps at that. I ran the
> server successfully . Once I created the "First View" tutorial
> (datetime page17) in the book and changed the settings.py and urls.py,
> I get the following:
[...]
> Exception Type: SyntaxE
HI,
Does anyone have recent experience of setting of a Django site with
FastCGI and Lighttpd?
We have a new dedicated server and have been trying to set this up
without succcess.
Software:
Lighttpd 1.4.18
Flup 0.5
Django 0.97 pre-SVN (ie: current SVN trunk)
Excerpt from Lighttpd config:
--
Check this game out! This is my city: http://mikeyopolis.myminicity.com
Whenever someone clicks on it, I get points! Start one up for
yourself!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
Dear all,
I have two object :
1. contacts
2. phone number
contacts and phone number is linked via a primary key foreign key
connection with the primary key in contacts. The way the admin
interface is done now is that the contact object has an add function
and the contacts too has an add functio
Whats really interesting in this discussion is that there are no words
about the django application it self have you coded your
application in a django effencient way?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Group
On Dec 17, 2007 12:31 PM, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> wrote:
>
> Hi!
>
> I could not find an open ticket so I open it myself ;)
> http://code.djangoproject.com/ticket/6226
>
> I could write the patch, but I don't know what is the best approach,
> if we must port allow_tags or if the
So, should I make a file in the settings.py file called
django_session, or something like that?
Thanks again.:-)
On Dec 13, 2:01 pm, jim <[EMAIL PROTECTED]> wrote:
> Even if your simple app dosen't do anything with the database, django
> still needs those values populated in the settings.py
Hello,
I am a new user to Django and developing apps at that. I ran the
server successfully . Once I created the "First View" tutorial
(datetime page17) in the book and changed the settings.py and urls.py,
I get the following:
Request Method: GET
Request URL:http://127.0.0.1:8000/
Exception
Hello,
I have the following in my template:
{% for a in thespinfo %}
{{ secondprice.forloop.counter0|floatformat:2 }}
{% endfor %}
However, nothing appears when I run this code
///
My secondprice variable contians a list like ['25', '14', '56']. Each
time that my for loop is run t
On Dec 2, 8:27 pm, Darryl Ross <[EMAIL PROTECTED]> wrote:
> I've done this is CSS files before, so it should work just fine. Just
> make sure you set the correct Content-Type header in your JS view.
FTR, this works fine. I couldn't use render_to_response() as I had to
supply the mimetype, but oth
I'm trying to write db initialization code for an existing db
framework on a product that I work on. To do this I'm "asking" django
to show SQL that it would use to create its db, so I can copy it into
the initialization code.
I can't though, as I haven't created the db yet, and for some reason
i
Am 16.12.2007 um 18:09 schrieb yml:
>
> Hello,
> This exact situation happens to me sometimes ago and the root cause is
> that either you have an error in your urls.py or you are using the
> decorator "user_passes_test".
Never heard of this decorator therefore I suppose I don't use it. ;-)
>
>
Hi!
I could not find an open ticket so I open it myself ;)
http://code.djangoproject.com/ticket/6226
I could write the patch, but I don't know what is the best approach,
if we must port allow_tags or if the function should return a
SafeString instance. Even breaking backward compatibility, I thi
Hi everyone,
I have the following situation, and I would value advice.
I have two classes, FolderUpload and FileUpload as given below. I want
a dynamic upload_to url in FileUpload, such that the upload to field
depends on the value of the folder field, specifically path field. I
realist that cu
Django Noobie
XMLRPC Noobie
JavaScript (AJAX) Noobie
Jsolait Noobie
Django 0.96
jsolait 1.1 full version
Windows XP
Hello All,
I'm trying to use JavaScript with Jsolait to invoke a Django view
through Xmlrpc, but I guess there is some problem with the parsing
(Unmashalling) of the XML. The Dja
Django Noobie
XMLRPC Noobie
JavaScript (AJAX) Noobie
Jsolait Noobie
Django 0.96
jsolait 1.1 full version
Windows XP
Hello All,
I'm using trying to use JavaScript with Jsolait to invoke a Django
view through Xmlrpc, but I guess there is some problem with the
parsing (Unmashalling) of the XML. T
Thanks Malcolm
But I have one little difference between form and model - only one new
field that needs to be on top of all other fields
example:
#model
class SomeModel(modles.Model):
field1
field2
...
field20
#form
class SomeModelForm(forms.ModelForm):
some_new_field
c
>> This: Model.objects.filter(...).exclude(id__in = processed)
>> gives me: Truncated incorrect DOUBLE value: 'Model object'
I've seen the above request on the ML several times now.
Is there any hope that, in the QuerySet refactor, the "__in" form
can sniff the datatype of the parameter for oth
On Mon, 2007-12-17 at 05:13 -0800, Vitaliy wrote:
> How can I change fields order in form generated using ModelForm ?
I think you're approach the problem from the wrong angle. ModelForm is a
shortcut for converting a model directly to a form. If you want to alter
a lot of things, such as the ord
How can I change fields order in form generated using ModelForm ?
--~--~-~--~~~---~--~~
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 unsubscrib
On Mon, 2007-12-17 at 07:10 -0500, Ariel Calzada wrote:
> l5x wrote:
> > "I propose to design and implement an API to make Comet behavior
> > available to Django applications."
> > http://hosted.corp.it/django/full.html
> > >
> >
> >
> Good Idea :-)
Keep in mind that that link was a proposal
On Sun, 2007-12-16 at 16:14 -0800, azer wrote:
> Hi,
>
> I'm trying to use Time.sleep function on printing, here is the code:
>
> def sleep(request):
> res = HttpResponse()
> res.write("hello")
> time.sleep(3)
> res.write("hello");
> return res
>
> But it doesn't
On Sun, 2007-12-16 at 17:42 -0800, borntonetwork wrote:
> Hello.
>
> Does anyone have an idea how to create a specific sort order for a
> select box that represents a foreign key field in a django admin
> change form.
>
> For example, when adding a new "book" object via the django admin
> chang
On Fri, 2007-12-14 at 23:29 +0100, Florian Lindner wrote:
> Hello,
> I have two question regarding get_absolute_url:
>
> 1) I have the template code:
>
> {% for entry in object_list %}
> {{ entry.title }}
> {% endfor %}
>
> It's called from a .generic.list_detail.object_list. My
> get_absol
On Sun, 2007-12-16 at 10:56 -0500, Tim Riley wrote:
> Is there a way that the admins can limit the amount of spam coming
> from this mailing list? I am subscribed to many mailing lists and I
> haven't received even a fraction of the spam that I am getting from
> this group.
The spam is already b
Hi there,
NFS seemed like to easiest way, but the problem is that I'm using 2
different shared hosting services: one for the actual site
(Webfaction) and one for the media storage (Dreamhost). Apparently to
mount NFS directories you need to be root, so that doesn't quite work
in shared hosting si
On Fri, 2007-12-14 at 16:31 +, Matt Davies wrote:
> Thanks Pete
>
> You're a star
I don't understand the conclusion here. Does this mean you have to
change your site all over the place? The change in [6852] should have
been very close to backwards compatible except in some really odd
side-c
On Fri, 2007-12-14 at 09:29 -0500, Karen Tracey wrote:
[...]
> Looks like a bug in newforms-admin to me. Seems that somehow the fix
> for this on trunk (changeset 6703) didn't get merged into the
> newforms-admin branch. newforms-admin has code to check the setting
> of allow_tags, so I believe
l5x wrote:
> "I propose to design and implement an API to make Comet behavior
> available to Django applications."
> http://hosted.corp.it/django/full.html
> >
>
>
Good Idea :-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Go
"I propose to design and implement an API to make Comet behavior
available to Django applications."
http://hosted.corp.it/django/full.html
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
If I understand what you're doing here, you need to be very careful.
Converting a dictionary to a string (or pickle) does not guarantee that
two equal dictionaries convert into two equal strings (or pickles),
especially if your version of Python changes. For example, your code
below may creat
On Fri, 2007-12-14 at 02:18 -0800, Udi wrote:
> Is there any way to turn this completely off? It would be nice to be
> able to get the latest django src before I refactor all my code to
> handle this new stuff.
>
> {% autoescape off %} works fine if all of your templates inherit from
> a base,
Comet:http://www.google.com/search?hl=en&q=comet
reverse ajax: http://www.google.com/search?hl=en&q=reverse ajax
On Dec 17, 3:35 am, l5x <[EMAIL PROTECTED]> wrote:
> If you put /print "hello"/, the server should print it with given
> delay (on the server side).
> I think that you should use JS/AJ
Hi all!
I try to reimplement django generic create_object and update_object
using newforms and formtools.preview. But I get some problems with
HttpResponseRedirect (can't redirect from model_post_save sub, but
why?) and preview (got strange errors).
When I try to use preview when I create an obj
You have to convert s.price.name to float (or .9 to a DecimalObject if
the float-precision should be a problem).
This should work:
for s in s2:
s.price.name = float(s.price.name) * .9
s.price.save()
On Dec 16, 8:43 pm, Greg <[EMAIL PROTECTED]> wrote:
> Shabda,
> I added the follow
76 matches
Mail list logo