On Wednesday 21 Jan 2009 12:56:53 pm elithrar wrote:
> And there's also the Google Group if you get stuck
and IRC channel
--
regards
KG
http://lawgon.livejournal.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Hi
i would use raw SQL to retrieve models, that would be the fastest way i
quess:
http://docs.djangoproject.com/en/dev/topics/db/sql/
from django.db import connection
cursor = connection.cursor()
cursor.execute(...Sqlquery...)
...
...
Other way could look like this:
result = []
all_m
I'd definitely wait until Practical Django Projects & The Django Book
(http://djangobook.com/) are updated to be compatible with Django 1.0+
- the authors of each book have stated that this should be the case by
mid this year. The problem with those books is that they don't account
for the newform
Hi,
more of your code (views, htmls) would help to find where the problem is. So
far it looks like Django is unable to find your html file. Or maybe it's
something that i'm facing right now, everything is ok but when i call
specific view, i get 404 on windows but not on Mac, there's everything ok
When began with Django a read this book
http://www.amazon.com/Sams-Teach-Yourself-Django-Hours/dp/067232959X
Maybe reviews are not so good, but it gave me good start, but real learning
began when I started to write own projects. And also it's little bit old
(Django releases prior to the version 1
On Wed, Jan 21, 2009 at 2:35 AM, Keyton Weissinger wrote:
>
> Oh and just to re-state, this exact same code works like a champ on
> import of School or Parent data (neither of which have a ManyToMany
> field).
>
> Keyton
I can't reproduce this exception. Try to print import_object_dict just
befo
On Tue, 2009-01-20 at 20:08 -0800, meppum wrote:
> I'm not sure if it's a bug, but I had to change the following line:
>
> value="Preview" />
>
> to instead be:
>
> value="Preview" />
It looks like you're using Django 1.0.0. Strongly recommended to upgrade
to version 1.0.2.
The above change
Oh and just to re-state, this exact same code works like a champ on
import of School or Parent data (neither of which have a ManyToMany
field).
Keyton
On Jan 20, 11:32 pm, Keyton Weissinger wrote:
> Hi Malcolm,
>
> Thanks very much for the quick reply. I'm using this code as part of a
> view in
Hi Malcolm,
Thanks very much for the quick reply. I'm using this code as part of a
view in which I'm processing an import of data (part of my reusable
django-batchimport app on google code). Here's a dpaste of the main
part of the code: http://dpaste.com/111306/
"model_import_info.model_for_impo
On Tue, 2009-01-20 at 19:32 -0800, Keyton Weissinger wrote:
> Hello,
>
> OK. I'm totally stuck. I am trying to create an object (of type
> Student -- see below) with the following:
>
> new_student = Student.objects.create(**import_object_dict)
>
> I'm using the following dictionary as "import_o
Hello,
OK. I'm totally stuck. I am trying to create an object (of type
Student -- see below) with the following:
new_student = Student.objects.create(**import_object_dict)
I'm using the following dictionary as "import_object_dict" above
(aside from the name of the school, this is fake data, so
On Tue, 2009-01-20 at 17:51 -0800, saved...@gmail.com wrote:
> Hello Malcolm,
>
> Thanks for you reply. Unfortunately, there is no 404 error message.
> For some reason (beyond the scope of my django knowledge), the view
> just won't redirect. The scope of my django knowledge. Here are my
> simp
Hello Malcolm,
Thanks for you reply. Unfortunately, there is no 404 error message.
For some reason (beyond the scope of my django knowledge), the view
just won't redirect. The scope of my django knowledge. Here are my
simple urls, if that is of any assistance.
urlpatterns = patterns('django.vi
Malcom is absolutely right, apologies for sending untested code to the
list.
--Derek
On Jan 20, 4:53 pm, Malcolm Tredinnick
wrote:
> On Tue, 2009-01-20 at 11:00 -0800, Derek Payton wrote:
> > The issue is that CLIENT_CHOICES is only evaluated once, when the
> > server is started an all the code
On Tue, 2009-01-20 at 11:00 -0800, Derek Payton wrote:
> The issue is that CLIENT_CHOICES is only evaluated once, when the
> server is started an all the code is loaded into memory. Try wrapping
> it all in a function, thusly:
>
> def CLIENT_CHOICES()
> choices = [
> ('', 'Select Clie
it didn't work ? you got the (remote) server correctly specified etc. ?
I haven't tried that myself.
I used to do this all the time with my old dev environment (a php
framework),
its very nice to run the dev code using the remote production db just to
check.
http://crucial-systems.com
On T
That makes perfect sense. Unfortunately, it's not working. I tried your
suggestion verbatim -- except added : after the CLIENT_CHOICES() function
definition. Values only refresh when the server is restarted.
On Tue, Jan 20, 2009 at 11:00 AM, Derek Payton wrote:
>
> The issue is that CLIENT_CHO
On Tue, 2009-01-20 at 15:43 -0800, saved...@gmail.com wrote:
> Hello Malcolm,
>
> Thanks for your reply. In response to your questions:
>
> > (a) what does "is_correct" contain when you think you should be entering
> > the "correct" branch? Is it really something that will evaluate to >True in
Hello Malcolm,
Thanks for your reply. In response to your questions:
> (a) what does "is_correct" contain when you think you should be entering the
> "correct" branch? Is it really something that will evaluate to >True in
> Python?
In hindsight, "is_correct" was really not required and would
I'm building a simple banner/promotion system for a site. Aside from a
few date-related fields, a banner consists of:
- an image
- a target url
- the image dimensions
- some tags (using django-tagging)
I'm trying to figure out how to build a template-tag to allow me to
display a number of banne
Hi everyone,
I'm trying to create a registration process that includes membership
details and a paypal bit (for a non-profit org), and use the
registration app as the first step.
However, I'd like to log people in when they 'activate' (click the
link in the email and return to the site). I've go
On Tue, 2009-01-20 at 13:08 -0800, saved...@gmail.com wrote:
> i have a quiz app, 4 answers per question, one correct via boolean.
> For some reason I can't get the view to redirect to next question if
> answer is correct. Whenever I click on the correct answer the app
> doesn't redirect to the n
On Tue, 2009-01-20 at 11:19 -0800, Ian wrote:
> On Jan 19, 5:20 pm, Malcolm Tredinnick
> wrote:
> > Just to be accurate, PEP 249 says that a paramstyle of "pyformat" is one
> > possible value, which would permit the above sort of query. It does not
> > say that every conforming database wrapper i
On Tue, 2009-01-20 at 11:11 -0800, Flo Ledermann wrote:
> Hi all,
>
> in my templates I often use combinations of "with...as" and "include"
> for modularization of HTML building blocks, like so:
>
> {% with "save" as label %}{% include "components/button.html" %}{%
> endwith %}
>
> however, thi
On Tue, 2009-01-20 at 07:46 -0800, Dan wrote:
> Hello,
>
> I am trying to make an application that can log events (changes to the
> database) from other django applications. To do this i am currently
> using the post_save hook and post_delete hook to get any inserts,
> updates or deletes however
I have a general question about creating a response in Django.
If I am creating a response using the return
django.shortcuts.render_to_response function:
return render_to_response(
'template_name.html',
{'huge_dictionary_of_data': huge_dictionary_of_data,},
RequestContext(request, {}
Hi there,
I've just got the JS catalogs working on my AppEngine/Django project,
and can access the JS library just fine, but the 'catalog' array is
empty.
I have created the djangojs.po files and populated them with the ID/
MSG pairs that I need, but nothing appears in the JS.
I'm wondering if
What you're looking for is explained in the documentation on writing
your own template tags:
http://docs.djangoproject.com/en/dev/howto/custom-template-tags/
Specifically, I'd look into inclusion tags:
http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#inclusion-tags
-Jeff
On Jan
i have a quiz app, 4 answers per question, one correct via boolean.
For some reason I can't get the view to redirect to next question if
answer is correct. Whenever I click on the correct answer the app
doesn't redirect to the next question. Could anyone take a look at
this and see what I'm doin
Am 19.01.2009 um 22:58 schrieb Briel:
>
> You should try playing around with the tags, trying to load comments
> different places trying some of the other comment tags to see what
> happens ect.
> Also are you using the block tags? what block tags do you have where
> have you placed them in rela
I was wondering if anyone has been able to access their production
environment via the development environment. Because of the amount of
data on the production environment, it would be advantageous to be
able to just connect to the production database for query purposes.
P.S. I tried modifying th
Should I override/overload the init function in my ApprovalForm class?
Am I misusing the ModelForm constructor?
On Jan 19, 2:27 pm, "tom.s.macken...@gmail.com"
wrote:
> I want to create a form based on a model and inject data into it
> manually. See below for implementation.
>
> class Approval(m
On Jan 19, 5:20 pm, Malcolm Tredinnick
wrote:
> Just to be accurate, PEP 249 says that a paramstyle of "pyformat" is one
> possible value, which would permit the above sort of query. It does not
> say that every conforming database wrapper is required to support it.
> Although the PEP recommends
Hi all,
in my templates I often use combinations of "with...as" and "include"
for modularization of HTML building blocks, like so:
{% with "save" as label %}{% include "components/button.html" %}{%
endwith %}
however, this is a bit cumbersome if used frequently or if multiple
variables must be
* Objective create and save a row/record to the table defined as
AUTH_PROFILE_MODULE
via the instructions in models.py
I'll demonstrate what I've tried to do so far, all which seemed
logical
but had no effect other than adding a row to auth.user and
registration.registrationprofile. my custom
Hello NoviceSortOf,
On Jan 20, 8:42 am, NoviceSortOf wrote:
> * django-registration is installed and works great
Yes, it is! Thank you James Bennett!
> * i'd suspect that somewhere in models.py there would be a hook for
> this,
> there is reference to something called profile_callback that
The issue is that CLIENT_CHOICES is only evaluated once, when the
server is started an all the code is loaded into memory. Try wrapping
it all in a function, thusly:
def CLIENT_CHOICES()
choices = [
('', 'Select Client'),
]
clients = CustomerMaster.objects.all().order_by('cust
Hi to all! I'm a long time python developer. For my web application
needs I've been relying on PHP, but I'm trying to switch to Django.
I'm in the learning phase.
A thing that is puzzling me is how to compose various apps like a
puzzle with "main" pages. An example. Suppose that I have a home pag
Hi Malcolm,
I'm building my forms in a file called forms.py. This is how I populate the
choice list:
CLIENT_CHOICES = [
('', 'Select Client'),
]
clients = CustomerMaster.objects.all().order_by('customer_name')
for client in clients:
CLIENT_CHOICES.extend([(client.id, client.cust
On Jan 20, 7:11 pm, "Karen Tracey" wrote:
> From a brief glance at the source, try specifying empty_label='whatever you
> want' as a parameter to the ModelChoiceField. This probably should be
> documented, but I can't find it.
Wow, strange, I could have sworn that I tried that without success
Yeah, I had to add a related_name to my ForeignKeys e.g:
first_photo = models.ForeignKey(Image, blank=True, null=True,
related_name="first photo")
The problem now is that with foreign keys, it generates a drop down
list to select the images - whereas, I want a browse type text box to
choose a
On Tue, Jan 20, 2009 at 12:45 PM, Flo Ledermann
wrote:
>
> Hi all,
>
> I want to change the default label for the None value in a
> ModelChoiceField from the default '' to something more
> meaningful in the context of my app.
>
> After some research I tried subclassing the ModelChoiceField
@Alex:
Nope, that's only pulling back entry's that have approved comments.
On Jan 20, 12:43 pm, "alex.gay...@gmail.com"
wrote:
> On Jan 20, 11:53 am, tlow wrote:
>
>
>
> > I think you can not do that with only one query using annotate.
>
> > You could do it manually in python using the code ab
I'm currently using the extra method (subquery) and it's working
perfectly.
Thanks for clearing that up for me Thomas.
On Jan 20, 11:53 am, tlow wrote:
> I think you can not do that with only one query using annotate.
>
> You could do it manually in python using the code above including the
> a
Hi all,
I want to change the default label for the None value in a
ModelChoiceField from the default '' to something more
meaningful in the context of my app.
After some research I tried subclassing the ModelChoiceField,
overriding the label_from_instance method like so:
class MyModelCh
On Jan 20, 11:53 am, tlow wrote:
> I think you can not do that with only one query using annotate.
>
> You could do it manually in python using the code above including the
> additional filter on comment_approved and merge all (entry, number)
> pairs with Entry.objects.all() using 0 for entries w
Hello,
I am trying to make an application that can log events (changes to the
database) from other django applications. To do this i am currently
using the post_save hook and post_delete hook to get any inserts,
updates or deletes however i am unable to get the user that caused
them.
Is there a
I think you can not do that with only one query using annotate.
You could do it manually in python using the code above including the
additional filter on comment_approved and merge all (entry, number)
pairs with Entry.objects.all() using 0 for entries which are not
listed in your first query. Si
You are welcome ))
--~--~-~--~~~---~--~~
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 to
django-users+u
Thanks creecode:
I've read those docs in the past, but they do help in further
refreshing my memory,
and further refining the question.
* django-registration is installed and works great, the only problem I
have
is that somehow I need to populate the profiles table defined as
AUTH_PROFILE_M
Found simple workaround. Just use count on the primary key column
instead:
objects_aggr = objects.values(name).annotate(count_without_null=Count
(attribute), count_with_null=Count("pk")).order_by(name)
--~--~-~--~~~---~--~~
You received this message because you are
Hello, I'm customizing the admin site, and I've run into an issue I
cannot find the solution to. I'm trying to create a new button on the
change_list page that, when pressed, runs a particular script with
input values dependent on the filters that are currently applied to
that change_list page.
S
I have this model:
http://dpaste.com/111206/
and this admin.py:
http://dpaste.com/111207/
but when I try to edit an existing "Impresa" i get a ValidationError:
ManagementForm data is missing or has been tampered with
what's the problem?
--
Alessandro Ronchi
Skype: aronchi
http://www.alessandro
Same problem here.. and as Eric, I couldn't understand the FilterSpec
thing..
It seems that every filter is a GET request but it's not clear where
to specify it..
Thanks in advance!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
All fixed - anyone who stumbles across this error - update to the
latest trunk of django-sphinx and works fine!
On Jan 20, 1:23 pm, Alfonso wrote:
> Hello,
>
> I've used django-sphinx/sphinx engine in the past and found it a
> fantasic solution but now running into a problem in a new build I
> h
Well, after googling and checking the django-project website, i found
an option to manage saession.
By default, the SESSION_ENGINE use the db backend. I changed it to use
file and voila.
All works fine. I'll do some more test.
Cia
On 20 jan, 15:50, "e.ban...@malezieux.com"
wrote:
> Hi, i'm usin
Here are my models:
class Entry(models.Model):
name = models.CharField(max_length=200, unique=True)
date_published = models.DateTimeField()
is_published = models.BooleanField(default=False)
class Comment(models.Model):
entry = models.ForeignKey('Entry')
na
Hi, i'm using django (svn 1.1 pre-alpha).
I have a project with 3 apps.
All i want is to allow different website to acces this project but
each website use
a different database.
So to do that, i've create different vhost in apache conf
and in the settings.py file i check which database the websi
Thanks guys, I'm gonna give this a try!
Mike.
On Jan 20, 1:53 pm, Daniel Roseman
wrote:
> On Jan 20, 12:56 pm, "shogunm...@googlemail.com"
>
>
>
> wrote:
> > Hi Thomas,
>
> > Thanks for your quick reply!
>
> > I had a look at the docs, but it seems I have to enter the initial
> > values at the
On Tue, Jan 20, 2009 at 2:28 AM, DragonSlayre wrote:
> [snip details of problem]
>
> This gives me loads of errors - i'm pretty sure it's because of the
> ForeignKeys.
>
Without trying it, I'm guessing you got four errors. If they are the errors
I think they are, the error message actually trie
Just now {% ifequal %} tag doesn't apply filters to its operands.
On Tue, Jan 20, 2009 at 2:58 PM, ltcstyle wrote:
>
> is this a bug or what?
>
> {{float_number|floatformat:"0"}} give me correct number 1
>
> but
> {% ifequal float_number|floatformat:"0" 1 %}
> never match
>
> Any ideas?
>
> Than
On Jan 20, 12:56 pm, "shogunm...@googlemail.com"
wrote:
> Hi Thomas,
>
> Thanks for your quick reply!
>
> I had a look at the docs, but it seems I have to enter the initial
> values at the Form definition level. However, I am interested in
> entering dynamic data depending on who is viewing the f
Hi,
at python level you can do it like this (untested):
def myview(request, ...):
form=MyForm(..., initial={'email': request.user.email})
or
form.fields['email'].initial=request.user.email
shogunm...@googlemail.com schrieb:
> Hi Thomas,
>
> Thanks for your quick reply!
>
> I had a look a
Hello,
I've used django-sphinx/sphinx engine in the past and found it a
fantasic solution but now running into a problem in a new build I
haven't seen before:
So sphinx is all set up and working and in the appropriate view I
have:
def search(request):
search_query = request.GET.get('q',
Hi all,
Since a good portion of my development time is spent trying to avoid
ways to write custom template tags (worst part of Django, fact) I was
wondering if anyone knows of a more powerful version of the simple_tag.
Ideally I'm looking for one that allows me to use this:
def latest_orders(
Hey, I want to count even null values using annotate. Is there a way
to do that?
Here is what I've done:
objects_aggr = objects.values(name).annotate(value=Count
(attribute)).order_by(name)
This does exactly what I want except that it does not count null
values. To count even null values I woul
Hi Malcolm,
On 20 Jan 2009, at 02:33, Malcolm Tredinnick wrote:
>
> On Tue, 2009-01-20 at 02:07 +, Hans Fangohr wrote:
> [...]
>> However, in the template files, I extend my base.html which makes use
>> of the request object (basically checking whether the request has as
>> authenticated us
Hi Thomas,
Thanks for your quick reply!
I had a look at the docs, but it seems I have to enter the initial
values at the Form definition level. However, I am interested in
entering dynamic data depending on who is viewing the form. For
instance, in my case I want the user's email address to be d
Hi
Does anyone know hot to get auth .login redirect to an https URL
Currently i'm running my site behind an SSL enabled reverse proxy
redirects to http. If i don't supply a URL login redirects
http://accounts/profile
I've tried to supply the full URL but auth.login does not allow this
I was thin
shogunm...@googlemail.com schrieb:
> Hi guys,
>
> I've hunted around the docs and googled this (it's quite a niche
> scenario so a bit hard to find!) and I'm still a bit stuck! I was
> hoping somebody might be able to help out!
>
> Can anyone tell me how to pre-fill form data without the form
> au
Hi guys,
I've hunted around the docs and googled this (it's quite a niche
scenario so a bit hard to find!) and I'm still a bit stuck! I was
hoping somebody might be able to help out!
Can anyone tell me how to pre-fill form data without the form
automatically calling submit on the form so that th
is this a bug or what?
{{float_number|floatformat:"0"}} give me correct number 1
but
{% ifequal float_number|floatformat:"0" 1 %}
never match
Any ideas?
Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Djan
Hello, when using the django admin site, none of my filters are
initially applied to the change-list page (all filters are instead set
to "All").
I'm wondering if there's a way to change this so that by default, one
of the filters is applied.
This was also asked here,
http://groups.google.com/g
Hello Bruno,
Karen Tracey solved my issue and now i will be able to apply those
refactoring you suggested me.
Thanks for tips :-)
Att
Thiago
On Jan 19, 7:18 pm, bruno desthuilliers
wrote:
> On 19 jan, 18:04, "Thiago F. Crepaldi" wrote:
>
> Absolutely not an answer to your question, but...
>
Hello Karen,
First of all, I really would like to thank you for helping me solve
this issue. Your fix (downloaded from
http://code.djangoproject.com/changeset/9778?format=zip&new=9778)
was perfect and my form is working again, but now with a final release
(1.0.2) instead of a development one (sv
Hi,
I'm trying to find a good and a comprehensive book to learn Django.
I found few great books on Amazon. The only problem with these books
is that they were finished before Django went 1.0 out, so there are
undoubtedly some places where things are not quite in sync with Django
1.0. Now, let
I changed
function CustomFileBrowser(field_name, url, type, win) {
into
function DjangoFileBrowser(field_name, url, type, win) {
and it works ...
Thank you krylatij, it was not a setting problem, anyway, thank you :)
On 20 jan, 11:11, martyn wrote:
> I have
>
> tinyMCE.init( ...
> "file_b
I have
tinyMCE.init( ...
"file_browser_callback": "DjangoFileBrowser"
)
using django-tinymce. What's wrong ??? This app doesn't look at the
settings ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" g
Ok, thank you, I've changed my settings, with unfortunately no
result :
TINYMCE_DEFAULT_CONFIG = {
'dialog_type' : "modal",
'extended_valid_elements' : "a[name|href|target|title|onclick|
rel]",
'theme':'advanced',
'theme_advanced_toolbar_location' : "top",
'theme_advanced_butt
not magic))
incorrect settings.
make sure that all required javascript is avaliable.
--~--~-~--~~~---~--~~
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
some magic... mh
'file_browser_callback' : "Abracadabra",
On 20 jan, 09:01, krylatij wrote:
> Look into your settings again.
> I've had such problem before.
> After some magic with settings everything works.
--~--~-~--~~~---~--~~
You received this message
Hi Malcolm,
Thanks for the tip! It works like I wanted it to.
Thanks!
On Jan 20, 4:44 pm, Malcolm Tredinnick
wrote:
> On Mon, 2009-01-19 at 22:38 -0800, I.A wrote:
> > Hi guys,
> > I apologize for the confusing title.
>
> > I'm still confused on using the models in a m2m relationship. Suppose
Look into your settings again.
I've had such problem before.
After some magic with settings everything works.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
83 matches
Mail list logo