Thanks for you answer. i resolve my problem with callback. I put the second
load in the first loaf callback function, and works OK.
2009/12/4 Daniel Roseman
> On Dec 4, 9:52 am, NMarcu wrote:
> > Hello all,
> >
> > I have a strange problem
2009/12/4 gentlestone :
> I've tried to folow the tutorial and customize the admin template and
> made a copy of 'change_form.html' template into the 'templates/admin'
> directory in my project. I also set the
> TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__),
>
Maybe this code can help you about the approach, is just an example
based on your previous templatetag (i haven't tested it):
http://dpaste.com/129361/
The view isn't really generic, but i probablly would follow that
approach to solve this problem.
--
You received this message because you are
Hi all,
I've created a few yaml fixtures, but they don't retain the primary
key you specify via "pk:". Here's a sample:
- model: locations.location
pk: 1
fields:
type: 2
name: 'USA'
aux_data: 'US'
latitude: 12
longitude: -10
The primary key seems to always be 2 for every
Not having any luck with this. Surely there's a simple example out
there somewhere of view agnostic DRY form logic.
On Dec 4, 10:43 am, jwpeddle wrote:
> That is definitely one approach I hadn't considered, and just might
> work in my situation.
>
> On Dec 4, 10:13 am,
I asked this in Stackoverflow but there was no answers:
http://stackoverflow.com/questions/1849250/django-admin-search-functionality
Can anyone here help with ways to achieve this:
I have a simple database in django with SQLite and now I want to
improve it with a better search capability (I will
I use the timeuntil tag in my template:
(( object.end_time|timeuntil }}
where end_time is a DateTimeField.
What I got is output like "2 days, 23 hours"
Is there any way to get timeuntil to display minutes as well?
Thanks
--
You received this message because you are subscribed to the Google
help_text is safe by default? Might be of some use.
aa56280 wrote:
> The "safe" filter works on a string, not the entire form. So you'll
> have to apply it to the label of the field:
>
> {{ form.tos.label|safe }}
>
> Hope that helps.
>
>
>
> On Dec 4, 11:55 am, Viktor
Doug Blank wrote:
> > Plutocrat.objects.all().delete()
>
> I found that quite slow. If you want to stay DB agnostic, I came up with this:
>
> from django.db import connection, transaction
> models = [Person, User, ...]
> cursor = connection.cursor()
> flush_tables = []
> for model
THANK YOU!! (sorry, just a little excited).
Yes, that worked perfectly. I edited my .get_hexdigest() by simply
copying the sha1 encryption "if" statement, changed "sha1" to
"ruby" (and did the same in my password field). Then I flipped salt
and raw_password to match how it was done in my previous
The "safe" filter works on a string, not the entire form. So you'll
have to apply it to the label of the field:
{{ form.tos.label|safe }}
Hope that helps.
On Dec 4, 11:55 am, Viktor wrote:
> ahoj,
>
> I wrote a simple backend that extends RegistrationFormTermsOfService
On Fri, Dec 4, 2009 at 12:56 PM, Christophe Pettus wrote:
>
> On Dec 4, 2009, at 12:37 PM, Phlip wrote:
>
> > could such a method
> > call only send one SQL command?
>
> If you are using PostgreSQL as a back-end, it has a very efficient
> command TRUNCATE for just such a
On Fri, Dec 4, 2009 at 3:44 PM, Daniel Roseman wrote:
> On Dec 4, 8:37 pm, Phlip wrote:
>> Django users:
>>
>> I only ask the question to help improve my esthetics, but others might
>> need a performance boost here.
>>
>> How to delete every record in
On Dec 4, 2009, at 12:37 PM, Phlip wrote:
> could such a method
> call only send one SQL command?
If you are using PostgreSQL as a back-end, it has a very efficient
command TRUNCATE for just such a purpose, which you could sending as a
raw SQL command:
On Dec 4, 8:37 pm, Phlip wrote:
> Django users:
>
> I only ask the question to help improve my esthetics, but others might
> need a performance boost here.
>
> How to delete every record in a table?
>
> A related question - how to delete every record matching a filter, out
>
Django users:
I only ask the question to help improve my esthetics, but others might
need a performance boost here.
How to delete every record in a table?
A related question - how to delete every record matching a filter, out
of one internal SQL command?
The brute-force way:
for p in
I don't want to jump on something too quickly, being somewhat
unproven, but it's a nice thing to have with GHRML being dead and HAML
being Ruby only. I'll keep an eye on this!
What plans do you have for future improvement?
Dave
On Nov 27, 1:08 pm, Steve Howell wrote:
> I
Ok, thanks Russell, I will do that. Just first wanted to confirm I
wasn't missing something.
Margie
On Dec 3, 3:59 pm, Russell Keith-Magee wrote:
> On Fri, Dec 4, 2009 at 6:23 AM, Margie Roginski
>
>
>
> wrote:
> > In forms/models.py I see
On Dec 4, 2009, at 1:34 PM, Philippe Clérié wrote:
> Are you using a library or did you code it yourself? What would be a good
> library to start with?
>
> --
>
>
> Philippe
>
I use jQuery, and that makes it simple.
First, have a view that returns JSON. Basically, this is all you need in
2009/12/4 Philippe Clérié :
> Are you using a library or did you code it yourself? What would be a good
> library to start with?
jQuery does it very handy:
$("#elementID").load("http://your_url/for/the/data",{'var':value,'var2',value});
this simply does an HTTP query (with
On 4 déc, 18:46, Todd Blanchard wrote:
> First, thanks for the critiques - I'm not surprised there are better ways to
> write this as I'm just learning python.
Thanks _you_ for taking the critiques as they were intented !-)
> Second, url mapping for me is trivial. Its a
Are you using a library or did you code it yourself? What would be a good
library to start with?
--
Philippe
--
The trouble with common sense is that it is so uncommon.
On Friday 04 December 2009 12:27:09 Shawn Milochik wrote:
> On Dec 4, 2009, at 12:10 PM, Philippe Clérié wrote:
> > I
The HTTP refresh has a time delay interval. The application is internal with
less than 20 users at this time. And it's not as if this operation is going
to be done by all of them at the same time. (Now that I think about it,
perhaps I also need a way to block access while the database is being
No progress so far. I know I can do this:
attrs[field.name] = copy.copy(field)
if attrs[field.name].rel:
attrs[field.name].rel.related_name = "audit_%s_%s" %
(cls.__name__,
field.name)
But this doesn't seem to make a difference. I still get:
Error: One
ahoj,
I wrote a simple backend that extends RegistrationFormTermsOfService
of django-restration as I would like to add links into the text
stating that the user accepts the terms of service.
But when I pass it to the template, the link's text is always escaped.
I've tried to add a template
First, thanks for the critiques - I'm not surprised there are better ways to
write this as I'm just learning python.
Second, url mapping for me is trivial. Its a web app, not a web site. I would
be fairly happy with totally opaque urls ala seaside as long as I didn't have
to think about
On Dec 4, 2009, at 12:10 PM, Philippe Clérié wrote:
> I am working on an application that requires getting some data offsite,
> process it and load the site database. This process can take up to five
> minutes. I would like to be able to capture the output and present it to the
> user so he
Hi!
I think you can just log everything in that five minute process into a file.
You can then write a view function that would read that file and display the
latest progress of the process. On client side, you can use some javascript to
visit the view function on a regular basis, say, every 10
I am working on an application that requires getting some data offsite,
process it and load the site database. This process can take up to five
minutes. I would like to be able to capture the output and present it to the
user so he knows how far along he is and whatever errors he needs to know
That is definitely one approach I hadn't considered, and just might
work in my situation.
On Dec 4, 10:13 am, Heigler wrote:
> I think the way is build your own generic view if you have customized
> things like that comment tag.
--
You received this message because you
Thanks lotz Tim!
On Nov 27, 4:02 pm, Tim Valenta wrote:
> You can expand your .add() statement slightly, by passing it an object
> instead of an id:
>
> request.user.user_permissions.add(Permission.objects.get(name='somepermissionname'))
>
> You could alternatively do
On Fri, Dec 4, 2009 at 4:48 AM, Max Battcher wrote:
> Continuation wrote:
>> if form.is_valid():
>> object = form.save(commit=False)
>> delta = datetime.timedelta(days=object.days_difference)
>> object.end = object.start + delta
>> object.save()
>>
>> But I
I think the way is build your own generic view if you have customized
things like that comment tag.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this
I am currently trying to write a custom generic comment app and
growing increasingly frustrated with template tags. As far as I can
tell, template tags are the only mechanism provided that allow pieces
of logic to be shared across templates. Nonetheless, you cannot treat
them like a view, and
I'm playing around with the Audit code here:
http://code.djangoproject.com/wiki/AuditTrail
The Caveats section mentions:
Likewise, it fails when there are multiple ForeignKeys? pointing
to the same Model, as it doesn't support / compensate for
related_name.
Does anyone know if this
Hi,
I have a hit_count integer field on my model with a default value of 0
In the admin area i would like to show this field (to see the amount
of hits) but make it not editable.
Is there any easy built in way to do this ?
Thanks for any tips.
--
You received this message because you are
Hi, I am trying to compare some existing permissions with the
permissions that a project member has. From views.py i am giving a
list with all available permissions. The problem is that the
permission format is different and i cannot think of a slick way to
compare them..My mind hovers around
./manage.py syncdb then
auto create a users permisions
tell me. How to decide
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
Hi,
I've installed django on an XP box and am trying to work through the
tutorial.
I got django from svn using the url from the django site:
http://code.djangoproject.com/svn/django/trunk
All is well until I try to do syncdb, at which point I get an error
message:
Error loading MySQLdb
I thinks I may have figured out what seems to be a good way. I create
the models in the top of the test.py file. This is working and the
table are only there for testing so I'm no polluting my database with
these tables after the tests are finished. Still looking for feedback
on best practice
Hello Django Users,
I have a few applications that don't have defined models but that
interact with other models. The most recent is a full text search
engine based on Whoosh. Whoosh has it own back end for storing
indexes. The application indexes models but doesn't have any of it's
own models
I've tried to folow the tutorial and customize the admin template and
made a copy of 'change_form.html' template into the 'templates/admin'
directory in my project. I also set the
TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__),
'templates').replace('\\','/'),
After this, the result is
Todd Blanchard wrote:
>
> I've solved my urls problem for now (though I'm open to more
> elegant solutions)
Depends what you're doing, but if what you're doing fits into its
"chained views" convention, django-catalyst will also autogen relevant
urls for you -
Yeah it's a twisted idea, but I'm going to use it for informative 403
405 pages.
On Dec 4, 3:51 pm, Daniel Roseman wrote:
> On Dec 4, 8:37 am, chefsmart wrote:
>
> > According to the docs
> >
2009/12/4 Geobase Isoscale :
> Hi all,
> Does anyone has an idea on how I can call a ' stored procedure' (function)
> in posgresql into Django Form?
> Many Thanks
> Isoscale
Do you mean in a Django way or do you mean into the Django Forms library?
I think you mean in a
Hi all,
Does anyone has an idea on how I can call a ' stored procedure' (function)
in posgresql into Django Form?
Many Thanks
Isoscale
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
On 4 déc, 09:22, chefsmart wrote:
> I guess it must be coming from
> django.contrib.auth.middleware.AuthenticationMiddleware that I am
> using. But I'm no Python / Django expert, so don't know for sure.
>
I really dont think so. Python's "global" namespace really means
On 3 déc, 16:56, chefsmart wrote:
> I have checked, and am not importing User in my code.
>
Perhaps not directly, but if, for example, your models.py imports User
AND your views.py does a "from models import *", then ALL names in the
models.py module will be imported.
--
Hi,
have a (probably simple) problem using ModelForms. I'm following this guide:
http://docs.djangoproject.com/en/1.0/topics/forms/modelforms/
Here are my models:
class Run(models.Model):
name = models.CharField(max_length=200)
class RunForm(ModelForm):
class Meta:
model =
On Dec 4, 8:37 am, chefsmart wrote:
> According to the docs
> athttp://docs.djangoproject.com/en/dev/topics/http/shortcuts/#render-to...
> the render_to_response shortcut "Renders a given template with a given
> context dictionary and returns an HttpResponse object with
On Dec 4, 9:52 am, NMarcu wrote:
> Hello all,
>
> I have a strange problem with jquery load. I have this two loads
> on a click event:
>
> action='first';
> $( '#operators_list_div' ).html( '' ).load( '{% url
> add_save_view %}',{'action':action, });
>
I put some alerts, before first load, before second load, and in every
template. Them are fired like this:
First the alert before first load
Second the alert before second load(strange, I was expected to fire
the alert from the first template)
Third the alert form the second template
Forth the
Hello all,
I have a strange problem with jquery load. I have this two loads
on a click event:
action='first';
$( '#operators_list_div' ).html( '' ).load( '{% url
add_save_view %}',{'action':action, });
action='second';
$( '#address_list' ).html( '' ).load( '{% url add_save_view %}',
Continuation wrote:
> if form.is_valid():
> object = form.save(commit=False)
> delta = datetime.timedelta(days=object.days_difference)
> object.end = object.start + delta
> object.save()
>
> But I got the error:
> type object 'datetime.datetime' has no attribute 'timedelta'
This
2009/12/3 Matt Schinckel :
> I have an app called person which has my UserProfile in it:
Now I got it. Thank you.
Greetings,
--
Kai Timmer | http://kaitimmer.de
Email : em...@kaitimmer.de
Jabber (Google Talk): k...@kait.de
--
You received this message because you are
On 3 déc, 08:37, Todd Blanchard wrote:
(snip)
>
A couple observations if you don't mind:
> urlpatterns += patterns('',
>
> (r'^(?P[^/]+)/(?P[^/]+)/(?P[^/]+)\.(?P[^/]+)',dispatch_request),
> (r'^(?P[^/]+)/(?P[^/]+)/(?P[^/]+)',dispatch_request),
>
To be more specific I created sample application called "animal":
### mypro/animal/models.py
from django.db import models
class Animal(models.Model):
name = models.CharField(max_length=30, primary_key=True)
class Cat(Animal):
tail_length = models.DecimalField(max_digits=4,
According to the docs at
http://docs.djangoproject.com/en/dev/topics/http/shortcuts/#render-to-response
the render_to_response shortcut "Renders a given template with a given
context dictionary and returns an HttpResponse object with that
rendered text."
The HttpResponse object have a default
I guess it must be coming from
django.contrib.auth.middleware.AuthenticationMiddleware that I am
using. But I'm no Python / Django expert, so don't know for sure.
On Dec 3, 8:56 pm, chefsmart wrote:
> I have checked, and am not importing User in my code.
>
> I guess
You should retrieve file from request.FILES, not request.POST.
On Dec 4, 2:57 pm, guptha wrote:
> Hi group ,
> I am getting error like "Key 'fathers_photo' not found in
>
> forms.py
> class FatherProfileForm(forms.Form):
> fathers_photo =
60 matches
Mail list logo