Hi Gerard,
Actually part of my solution was and is using modelform but that was
really just for the convenience of save().
I've got a solution together now but thanks for your response,
Nick
>
> Nick,
>
> I'm not a longtime Django user, but I would check de django
tweaks/missing something crucial/missing the
point entirely/etc and if there are any tricks/features/alternative
approaches I should consider?
With thanks,
Nick
p.s. Please feel free to mock my code as much as is needed!
--~--~-~--~~~---~--~~
You receiv
to XML/SWF charts
with minidom:
http://code.google.com/p/open-flash-chart-python/
http://www.maani.us/xml_charts/
Nick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to t
be php coded into that part of
> the site. Any help / advice would be a great help, thanks
That question doesn't read very clearly but this may have answers:
http://wiki.developers.facebook.com/index.php/PythonPyFacebookTutorial
Cheers,
Nick
--~--~-~--~~~---~-
g application which is I think what Alex asked originally.
A little more detail will probably get you a few more productive
responses,
Nick
> Sure,
>
> Typo is a blogging platform/cms (Like wordpress). I know about
> Django-cms and I am wondering if there are any others?
>
>
eed to have directories as 755 and files as
644 before I have any joy.
Cheers,
Nick
--~--~-~--~~~---~--~~
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
e:
/images/pub/{{ x.id }}-thumbnail.jpg
Hope that helps?
Nick
--~--~-~--~~~---~--~~
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
That worked, thanks.
--~--~-~--~~~---~--~~
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
ond edition
is aimed at Django 1.1.
In short, if you can afford it, get both.
Nick
--~--~-~--~~~---~--~~
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
about this same issue
(http://stackoverflow.com/questions/1042211/get-name-for-matched-url-pattern),
but the solution requires duplicating the URL pattern name in a
dictionary.
Thanks,
Nick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
our method looks pretty fast. Thanks!
Shawn, request.build_absolute_uri() returns a full path like
http://hostname/path/goes/here/, but it doesn't tell me the name of
the URL pattern that caused the request to be resolved to a particular
view.
Nick
--~--~-~--~~~---~-
es entries with keys
"fragment_name:additional:arguments:seperated:by:colons", so this seems
possible.
Any thoughts?
Nick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send e
with setting a large constant in a
context_processor and using that as the "effectively expire never"
time. I'd have to use a similar trick when using the low-level cache
API, anyway.
Thanks,
Nick
--~--~-~--~~~---~--~~
You received this message because you are subs
> I am hoping to get some reasonably knowledgeable, and unbiased,
> responses.
>
> I was thinking about putting together a wordpress blog. Then I came
> across a recent slashdot article about recent wordpress security
> issues. I did a little research, and found that wordpress has quite a
> histor
been installed properly and you'll need to give more info as to
what steps you're taking, such as the output from the above. The basic
idea is really only that the main django file (the one that contains
eg contrib, auth, db, etc.) is in that site-packages directory and
therefo
l of access to your host (shell access for
example). If you find your host doesn't provide what you need then you
could consider a host that has been recognised for its Django
"friendliness":
http://djangofriendly.com/
Hope that's a start,
Nick
--~--~-~--~~---
e, to keep it DRY. My first thought was to include a
different base.html template when the url of that view was like /embed/
my_url so but I'm not sure if that is the best approach.
I hope my question is clear. Any thoughts?
Many thanks!
Nick.
--~--~-~--~~~-
ave a urls like:
/mycoolfeed and /embed/mycoolfeed that both fetch exactly the same
data from the database, but render a different template based upon the
url.
How would you do this?
Thanks!
Nick.
On Apr 9, 3:57 pm, Nick Boucart wrote:
> Hi,
>
> I'm pretty new to django, so bear
is in this old post (2005)...
http://www.aaronsw.com/weblog/rewritingreddit
...that compares web.py with Django based on the needs of the project.
Choosing between Django and web.py doesn't need to be a mutually
exclusive situation. You may use one in one case, the other another.
Anyway, I
mplate. Then
since you're going to be making queries to a service that, depending
on your network, may or may be available or may be slow, take a look
at caching that information.
Nick
--~--~-~--~~~---~--~~
You received this message because you are subsc
te iself ?
Aside from the various code repositories; like http://
code.google.com/, http://github.com/, http://bitbucket.org/,
http://launchpad.net/
the django site itself has:
http://code.djangoproject.com/wiki/DjangoResources
Nick
--~--~-~--~~~---~--~~
You rece
ed (I'm currently reading it):
http://www.apress.com/book/view/1430210478
Safari books online: http://my.safaribooksonline.com has a selection
of these if you don't mind on-screen reading.
Cheers,
Nick
--~--~-~--~~~---~--~~
You received this message b
/page/
BADDATA
Request Method: GET
In the second case, Django catches the last argument, but not the first. But
in both cases, it doesn't read my custom string message.
Is there any way to display custom error strings, or am I doing something
completely wrong?
Thanks a ton!
N
b-in-a-web-application-serverfor
anyone who might have similar problems.
Nick
On Wed, Jun 17, 2009 at 11:08 PM, Vincent wrote:
>
> That sounds like a great idea. Something i have been meaning to try
> for a while but haven't gotten around to.
>
> For a class website i did t
You might find this useful:
http://code.google.com/p/django-crumbs/
>> the only point where DRY comes into play is when you're retrieving
>> data from the same view, is there a better way to make breadcrumbs?
--~--~-~--~~~---~--~~
You received this message becau
This may be helpful:
http://djangofriendly.com/hosts/
> I think I'm ready to finally switch to a django vps host due to
> problems with django on DreamHost. Can anyone recommend a good vps
> host?
--~--~-~--~~~---~--~~
You received this message because you are su
> anybody knows when djangocon september/portland videos will be
> available?
I expect you'll hear about their availability here first:
http://twitter.com/djangocon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
ust can't quite grok how to
put this together.
Processing the form means updating the target with the new Boolean
values selected by the user in the form, of course.
If anybody has an example that does something like this, that'll be
great.
Thanks in advance,
Nick
--~--~-~--~~
column to the tables who use the foreign
key combination as their primary keys.
As I ask the question, it now seems clear to me that the column is
needed.
Nick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
e this helps you to find a way to do your multiple items edit form.
Ah, that does look helpful and I wondered it I might do better to create one
form per line, as it suggests.
Nick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to th
ile called forms.py... but somewhere
I'd expect to then see an import statement along the lines of "from
mysite.forms import *". If I use forms.py for my forms, where does that
file need to be imported?
Thanks,
Nick
--~--~-~--~~~---~--~~
You received thi
On Tue, Nov 3, 2009 at 11:26 AM, f4nt wrote:
>
> forms.py is pretty standard. You'd end up importing them in your
> views.py.
Thanks... that's what I was guessing. But it appears to me that I sometimes
see ModelForms in models.py... wondering if th
umn. The solution looks like this in the template:
{% for field in form.visible_fields %}
{{ field }}
{% endfor %}
Now I'm trying to figure out how to get the "year" column data into the
form, dynamically from a model.
Nick
--~--~-~--~~~---~--~~
You
d and what it doesn't contain it has an ever increasing list of 3rd
party solutions that can be used even if temporarily.
I could probably go on but I think I need to let sleep have it's way for a
change!
Cheers,
Nick
--
You received this message because you are subscribed to the
> of the model)
>
> and how should i store the values independently from each other?
I believe the simple way would be a model that has month and year fields,
with a meta method that defines them as unique together.
Nick
--
You received this message because you are subscribed to th
like this:
SELECT * FROM `test_mymodel` t1, (SELECT `id` FROM `test_mymodel2`) t2 WHERE
t1.id = t2.id
Nick
--
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
)))._as_sql())
> and write here output.
>
Ah, sorry - I was confused... I thought you wrote the SQL yourself. That
does seem to be a problem with the ORM.
Nick
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
tial values... but how do I do that
with a model form? Or should it be a custom form to do that?
Thanks in advance,
Nick
--
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...@googlegro
nwhile, I kludged it by using a loop to generate the choices and "ifequal
choice.id selected_project" to insert the "checked" attribute into the
appropriate choice, which works.
Nice to know the right way, however. Thanks
Nick
--
You received this message because you are s
s.
Anybody aware of this as a known issue? Any fix?
Since I can avoid it by not stepping through the "magic" parts of the
database stuff, it isn't critical.
Nick
--
You received this message because you are subscribed to the Google Groups
"Django users"
cate ID.
Anybody have a working example of a form that updates, rather than inserts?
Oh, and forcing an update in the save method doesn't solve the problem.
I have no problem performing updates outside of the context of forms - I
just can't figure out how to get it to work with forms.
Th
gine that there's a Python library or module that will do this for
you, but it's not hard to write your own.
Nick
--
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
rors and either produces no results or some
other error.
What I think this generally means is that in your view, the object isn't
getting initialized for some reason. I'm assuming that you get the error
when you try to save. I'd carefully go over whatever initializes or sets
t
ports from Django):
import os
os.environ['DJANGO_SETTINGS_MODULE'] = "settings"
(The absolute or relative path to your settings file.)
Nick
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to dj
nyone done this without writing their own widget? It would be
> great to know how.
> Thank you in advance,
>
Rather than trying to do that on the client side (which is what I think
you're saying), have you considered just passing the required values to the
template as context variables?
easy as passing a dict as "initial" to your form instance you
create in the view:
form = MyForm(initial = {"foo"=True, "bar"=True}
with the field names (instead of foo and bar) of the check boxes you want
checked. Your form then should have them checked when it is ren
ys is the same as the server port
number. Gotta be so.
Nick
--
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
django-u
desired port. But the client really doesn't care -
> it just expects the server to reply to the same port number it sent its
> request from.
>
Of course, but I can't imagine why anybody would ever worry about that at
the application level.
Nick
--
You received this message becau
odifyProfileForm(initial=initial_dict)
Something like your last line might work, but it is a lot more work than
just passing the form the initialization dict.
Others feel free to jump in here and set me straight as needed. I'm still
fairly new to Django, so I'm no expert... but I
In other words, at some point when you save a
form, you're creating a row like this:
rel = Friendship.objects.create(to_friend=user1, from_friend=user2)
rel.save()
But are you doing the reverse?
rel = Friendship.objects.create(to_friend=user2, from_friend=user1)
rel.save()
There are other ways to accomp
go was built for,
of course.
If you want to scale, really scale, you'll want to use a graph library.
There are several for Python, including NetworkX, which I've used, and
Boost, which I haven't.
Probably more info than you wanted, but there it is.
Nick
--
You received this message be
27;value'] = force_unicode(value)
return mark_safe(u'%s' %
(forms.util.flatatt(final_attrs),value))
I found it here:
http://www.djangosnippets.org/snippets/1185/
Nick
(tempted not to respond due to the "deafening silence" comment... did you
imagine you're due an i
On Thu, Dec 3, 2009 at 2:50 PM, Todd Blanchard wrote:
> I'd gotten nearly a dozen responses to a later question so I figured the
> threshold of awareness had passed on this one.
Never assume correlation implies causation... ;-)
Nick
--
You received this message because you are su
uch a purpose, which you could sending as a
> raw SQL command:
Same works for MySQL. And it is far, far faster than most other ways, for
large tables.
Nick
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
I'm working with 2 clients hosting on and am part leasing servers from Servint
that I've setup to serve Django applications. Their green initiative is
outlined here:
http://www.servint.net/servintgreeninitiative.php
Nick
> I'm working on a project for an environmentally-co
ssification is a column on which you define the partitioning), which
would be a Good Thing (because this really doesn't belong at the application
level if at all possible).
Nick
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
bat FROM
old_foo.
Nick
--
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
django-users+unsubscr...@googlegroups.com.
F
ractice would be to create a data access module
for this purpose and import it when you need it. I've done this a few times
for MySQL access and even wrapped some of the more frequent patterns and
queries into methods in that module.
Nick
--
You received this message because you are subscr
You would order them on the model level or on the view level. In the
model, you can set ordering with the Meta class 'ordering' parameter.
In the view, you would just add .order_by() to your query. Check out
these thinks:
http://docs.djangoproject.com/en/dev/ref/models/options/#ordering
http://do
Those *links! Hah.
On Apr 16, 12:08 pm, Nick Serra wrote:
> You would order them on the model level or on the view level. In the
> model, you can set ordering with the Meta class 'ordering' parameter.
> In the view, you would just add .order_by() to your query. Check out
>
it
going on, I can't begin to fix it.
Anyway - I will persevere, and your link above looks very useful.
Thanks,
Nick
--
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...@go
Hey everyone, thanks for looking.
I'm overriding a model save(), and was wondering if there is an
instance of the model being passed in that i can access.
My situation is that i have a title and a slug. I only want to change
the slug when the title is changed. So in my save i want to check:
if s
Thank you, that seems like a clean way to do it. I'm getting a weird
error when overriding init though. When I simply do this:
class Entry(models.Model):
title = models.CharField(max_length=255)
slug = models.SlugField(max_length=255)
body = models.TextField()
user
Ahh, that'll do it. I'm used to the save() where you call super last.
Works perfect, thanks for the solution!
On Apr 21, 1:19 pm, Shawn Milochik wrote:
> You should probably call that super __init__ first thing. Otherwise the
> object won't really know how to behave like a Django model.
>
> Shaw
I think i ran into this issue before. I don't think they define a
max_length anywhere, the restriction is just on the database. Just
increase the field size in the database and you should be good.
On Apr 21, 2:20 pm, Tom Evans wrote:
> On Wed, Apr 21, 2010 at 6:22 PM, CrabbyPete wrote:
> > Yes,
y to read, but I'd be curious what attracted them.
There's a snake oil joke in there somewhere.
Nick
--
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.
Just create a model that stores the url and the expiration time. If
the url is hit past the expiration time, delete it, if it's still
within the time limit, display whatever you want to display. Obviously
this is for a small system, since you would be waiting to delete until
the url is hit, but its
Request is an object that django passes view functions that includes
post data, meta data, and data about the request taking place. Not
sure what your test function is doing, but to start, python is
complaining because you are referencing the variable before it has
been declared. You need to define
Whenever I use django on my windows box, i use XAMPP, which is a all
in one installer that gets apache and mysql.
So I:
- install XAMPP
- install python
- svn checkout django in the site-packages folder
- install mysql bindings for python
- install python image library
and I think you need to add
A post save signal seems better suited for this. The post save signal
has an attribute 'created' that will be true or false depending on if
the object is being created or updated. Check out the post_save
documentation:
http://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.post
efined rather than
> auto-incrementing pk.
>
> On Apr 23, 4:21 pm, Nick Serra wrote:
>
>
>
>
>
> > A post save signal seems better suited for this. The post save signal
> > has an attribute 'created' that will be true or false depending on if
>
w, it increments TWICE!
>
> Is there some glaring error in my logic above?
>
> On Apr 23, 4:50 pm, Nick Serra wrote:
>
>
>
> > I didn't even think of that. It's not very common to be specifying
> > pk's on create anyway, so yours would probably
:)
On Apr 26, 9:48 am, Jim N wrote:
> Nick,
>
> Thanks very much. That worked! I can't work out why my code didn't
> though (or rather, worked twice).
>
> -Jim
>
> On Apr 23, 6:37 pm, Nick Serra wrote:
>
>
>
>
>
> > Try this out and see
There are a couple ways to do this. You can either override the model
methods like save and init, or you can use signals and tie into the
pre_save, post_save, etc. Signals are here:
http://docs.djangoproject.com/en/dev/ref/signals/
If using signals, you will have an instance of the object being s
Can you be more clear on the exact result you're trying to achieve? Do
you want to see, for a given high school, how many recruit objects are
foreign keyed to it?
On Apr 26, 7:38 am, Nuno Maltez wrote:
> Are you saying that:
>
> collegelist =
> college.current_objects.filter(collegechoices__scho
Seems very odd how you're trying to implement this. Unless your
pseudocode has me confused. Can you give us the view functions too?
Seems like you're trying to use a decorator function on two views. Why
don't you just bail on the decorator, and just check for
request.GET.get('format') == 'rss', and
Include request context:
from django.template import RequestContext
...and then pass it in with the render. That should include the token
in the template.
return render_to_response('add_pair.html', {},
context_instance=RequestContext(request))
On Apr 26, 12:45 pm, jeff wrote:
> so i have some
Interesting. If the file is an mp3, maybe try:
file = open("/path/to/my/song.mp3", "rb").read()
response['Content-Disposition'] = 'attachment; filename=filename.mp3'
return HttpResponse(file, mimetype="audio/mpeg")
On Apr 26, 1:20 pm, Dexter wrote:
> Hi there,
>
> I want to send an audio file v
You could create a model that references the join table itself.
class ArticlePublicationsJoin(models.Model):
id = models.AutoField()
publicaiton_id = models.IntegerField()
article_id = models.IntegerField()
class Meta:
db_table = 'article_publications'
then just query on
Are you trying to interface django with an existing table? Why do you
have the StandardCode class foreign key-ing to the table, instead of
just making a model that references the table exactly?
On Apr 26, 2:43 pm, Jesse wrote:
> Table LOINCCode has loinc_obr4 (a number) and a description field
>
Hey everyone. I'm trying to access the request object while overriding
the save or tapping into the post_save on a model. I need request info
when someone posts a comment. But I don't just want to handle this in
my view, I would like it to be cleaner than that, so that
functionality would remain ev
Hey, quick query question. I know there has to be an answer for this
one, just don't know the syntax. I need to follow the reverse
relationship for an extended model.
class Account(models.Model):
name = CharField
class Entry(models.Model):
account = ForeignKey(Account)
class Page(Entry):
Yeah, that is going to be my fallback, I was just curious on an actual
reverse relationship solution to the situation. Thanks for the input!
On Apr 28, 4:12 pm, zinckiwi wrote:
> > class Account(models.Model):
> > name = CharField
>
> > class Entry(models.Model):
> > account = ForeignKey(
Yeah, I realize this now hah. Instead I am now passing request into a
ModelForm for what I need. Basically I have a comment system, and on
each comment post I wanted to run it through Akismet, which required
the IP and User Agent. So I just passed request into my form.save()
method on comment adds.
ring... but
I'm hoping somebody here has seen something similar - vanishing string after
encoding...?
Thanks in advance for any insights.
Nick
P.S. As often happens, describing the problem helped a bit... it seems to be
related to mixing unicode and non-unicode strings. When I decode the
r data... or, even easier,
create a whole new database with syncdb and copy your data into it.
Nick
--
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 fro
On Sat, May 1, 2010 at 11:13 AM, Continuation wrote:
>
> On Apr 30, 9:42 pm, Nick Arnett wrote:
>
> > If you don't have data in the table, just drop it and use
> "unique_together"
> > in models.py to define your composite key. You'll find that i
I just implemented this and it's a hassle. There are heated
discussions about it. I ended up modifying the auth app and completely
eliminating the 'username' field and just using email. Then I modified
the admin app to allow the login, and am basically just completely
overriding both. Good luck!
O
Awesome! Thanks so much!
On May 6, 3:32 am, Federico Capoano wrote:
> I've been using the beta for a while and it works pretty good for what
> I've seen.
>
> On May 6, 6:40 am, James Bennett wrote:
>
>
>
>
>
> > Tonight we're proud to announce, finally, the first Django 1.2 release
> > candidate
ld be greatly appreciated!
Thanks a lot,
Nick
--
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
django-users+unsubscr...@google
the rest.
Hopefully I'm pretty close, any ideas anyone?
Thanks in advance,
Nick
--
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
Sorry for the confusing title. Here is a simple example to illustrate
my question:
class Item(models.Model):
name = models.CharField()
class Manager(models.Model):
item = models.ForeignKey(Item)
On a POST I have the PK of the Item I want to link to a new instance
of the Manager object.
Thanks for the response. I actually will already have the PK, and am
trying to avoid grabbing an instance of the actual item object.
On May 12, 11:26 am, Daniel Roseman wrote:
> On May 12, 4:04 pm, Nick Serra wrote:
>
>
>
>
>
> > Sorry for the confusing title. Her
Exactly what I was looking for, thanks!
On May 12, 11:50 am, Daniel Roseman wrote:
> On May 12, 4:34 pm, Nick Serra wrote:
>
> > Thanks for the response. I actually will already have the PK, and am
> > trying to avoid grabbing an instance of the actual item object.
>
>
nth, which I'd rather not have to pay yet.
Nick
--
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
django-users+unsub
technology for a long time and I should know
that search performance always demands lots of memory... So I may bite the
bullet and use Solr, after all. I just wish there were a way to trade off
the memory for speed until I'm ready to deploy a real working version.
Nick
--
You received t
fairly good description of the issue, look at the HTML Writer's Guild
guidelines:
http://www.hwg.org/resources/faqs/priceFAQ.html
Nick
--
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..
locale like en-US,
some django pages won't ever display.
Nick
On 07/08/2010 04:11 PM, eon wrote:
Same for me. The problem is in the firefox profile (maybe due to the
switch from 3.5 to 3.6 ?)
Start-up with a new profile (backport plugins, bookmarks argh...)
resolves the issue
On 5 juil
locale like en-US,
some django pages won't ever display.
Nick
On 07/08/2010 04:11 PM, eon wrote:
Same for me. The problem is in the firefox profile (maybe due to the
switch from 3.5 to 3.6 ?)
Start-up with a new profile (backport plugins, bookmarks argh...)
resolves the issue
On 5 juil
h mail
accounts configured for the list and thought only one would go through
as the first answer I sent lagged significantly. I hope this gets sent
properly.
Glad i could be of help, Nick
On 07/08/2010 06:32 PM, Andi wrote:
On Jul 8, 5:12 pm, Nick Raptis wrote:
If there is a non-standar
201 - 300 of 611 matches
Mail list logo