Great work.
There are some absolute filepaths used in views can be replaced with
settings.SITE_IMAGES_DIR_PATH
im.save("home/../../bg2.jpg',"JPEG")
im.save(settings.SITE_IMAGES_DIR_PATH+'/bg2.jpg',"JPEG")
It would be better if prepare some initial data for test,it puzzles
me some while when
Having installed multiple versions of Django on the same apache/modPy
server, I understand the PythonInterpreter and configurations, however
i am a little confused on the standard of naming and organizing the
varying symlinks between the two versions on the python path.
It is not possible to have
I have 2 issues with Admin and I am looking for a suggestion.
I am currently using
models.ForeignKey(Type, edit_inline=models.TABULAR, blank=True)
for a field in one of my models. In Admin of the parent Model the
children items appear as expected, however it would be nice to collapse
the childr
On 9/5/06, primitive <[EMAIL PROTECTED]
> wrote:
example codeqdict = QueryDict('id=1&fk_client_id=2')queryset = Ticket.objectsOk; so you have a GET request string 'id=1&fk_client_id=2', and you want to compose a query from it.
You will be hitting against two problems:1) The 'value' for each key in
Hi there. I found this nifty when I searched for Django and Dojo:
http://code.djangoproject.com/wiki/AddDojoEditor
The thread on this link is closed, so I am starting a new one.
Please explain how I invoke this code. I am fairly new to Django, and
I've avoided javascript like the plague over th
On Tue, 2006-09-05 at 18:27 -0700, robbie wrote:
> Malcolm Tredinnick wrote:
> > I am really close to finishing the rewrite work necessary to make this
> > easy. It's a bug that it doesn't work already.
>
> Is there a Django ticket for this bug? I think it's also in the way for
> something I'm tr
Malcolm Tredinnick wrote:
> I am really close to finishing the rewrite work necessary to make this
> easy. It's a bug that it doesn't work already.
Is there a Django ticket for this bug? I think it's also in the way for
something I'm trying to do, so it would be good to track its
progress...
(I
On 9/5/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> It occurs to me as I look at this further that I don't want to return
> the Section object at all and what I'm really trying to do is get the
> appropriate Section object and then return it's child sponsors.
>
>
Because all() will always
Hi Facundo,
Nope the problem's not in that code. The stack trace will tell you the
method with the problem.
Just in case you didn't know, UnboundLocalError is a Python error that
you get when a method refers to a variable before assigning it a
value. For example:
>>> def f():
... print q
..
On 9/5/06, Jay Parlar <[EMAIL PROTECTED]> wrote:
>
> On 9/5/06, limodou <[EMAIL PROTECTED]> wrote:
> >
> > Sometimes I will get below error message, but not each request I could
> > get this, but it occurs very often, I don't know why? I'm working in
> > windows XP, python 2.4.3, django trunk vers
primitive wrote:
> Is it possible to use a string (coming from an request object) as a
> keyword to filter? I keep getting errors, but I don't know how to
> convert these strings into types that filter will understand.
Sure, Python allows you to pass a dict as a set of keyword arguments,
so you
>> UnboundLocalError at /adm/viaj/
>>local variable 'viaje' referenced before assignment
>>
>
> You have an assignment to a local variable named 'viaje', but you are
> using the name 'viaje' before that assignment. Look for a line that
> begins "viaje =". It's best not to have variables
On Sep 1, 2006, at 9:35 AM, Rob Hudson wrote:
>
> If not, should it?
>
> If I'd like do have markup on my whole project it would be nice to set
> it once in base.html via {% load markup %} and have it automatically
> loaded in each template that extends base.
>
> I just tried this with template ta
On 9/5/06, Sean Perry <[EMAIL PROTECTED]> wrote:
Perhaps if symmetrical is true get_accessor_name should return None orsome similarly bogus value. This would also make the test incore/management.py work as planned.I had a quick attempt at this approach last night - it mostly works, but it causes a
cyberco:
If you want to do it in the interface, you will have to use some
javascript.
Here is a page that shows how to do it: http://www.felgall.com/
jstip20.htm
Corey
On Sep 5, 2006, at 8:50 AM, cyberco wrote:
>
> How can I set a maximum for the amount of text a user enters in a
> TextFie
You can change to collation of your MySQL tables by table and by
field. If you do it by table, all new fields are of that collation.
If you already have fields of a collation, you will have to change
all of them.
I used PHPMyAdmin to do it as the interface is nice and simple. You
probably
mthorley:
I think you just need to override the save() method of your model.
You can do all the processing you need before it's saved.
Corey
On Sep 5, 2006, at 10:21 AM, mthorley wrote:
>
> Thanks for the tip Nate!
>
> Does any one know what method receives the data from the form when it
>
On 9/6/06, Facundo Casco <[EMAIL PROTECTED]> wrote:
>
> Hi, maybe I'm doing something wrong (I'm just starting to learn Python and
> Django), I need to call a view (viaje) from another view in the same app but
> I get this error:
>
> UnboundLocalError at /adm/viaj/
>local variable 'viaje' re
Arthur, thanks for your replay. I've changed the definitions order but I
still get the same error.
Facundo
arthur debert wrote:
> Hi facundo.
>
> this is an issue in python that is pretty confusing for newbies.
>
> What's happening here is that viajes is making a forward reference to
> viaje, mea
Hi facundo.
this is an issue in python that is pretty confusing for newbies.
What's happening here is that viajes is making a forward reference to
viaje, meaning that when viajes is run viaje has not been defined yet,
so it throws an exception(methods get parsed top to bottom in modules).
The f
Hi, maybe I'm doing something wrong (I'm just
starting to learn Python and Django), I need to call a view (viaje)
from another view in the same app but I get this error:
UnboundLocalError at /adm/viaj/
local variable 'viaje' referenced before assignment
The relevant part of the code is
amx
Alan Green wrote:
On 9/2/06, Rob Hudson <[EMAIL PROTECTED]> wrote:
If not, should it?
No, it doesn't. There's good argument both for and against this
sub-templates picking up templatetag libraries from their base
templates.
If I'd like do have markup on my w
On 9/5/06, Katie Lohrenz <[EMAIL PROTECTED]> wrote:
> Is there a strong reason for putting the doc_head.tmpl code in a
> separate file? If you put that code directly into your base template,
> the title block would inherit the way you want.
Hmmm, I hadn't really thought about it. I'd been so gun
On 9/2/06, Rob Hudson <[EMAIL PROTECTED]> wrote:
>
> If not, should it?
No, it doesn't. There's good argument both for and against this
sub-templates picking up templatetag libraries from their base
templates.
> If I'd like do have markup on my whole project it would be nice to set
> it once in
Cole Tuininga wrote:
> Fair enough. Is there a better way to accomplish this? I'd much
> prefer to have the title defined within the template rather than
> having to pass it in as a variable from the view...
I've hit the same snag before. The block you're defining must be
present in the parent
Hi,
I have two models:
class Class(models.Model):
name = models.CharField(unique=True,maxlength=79)
class Person(models.Model):
name = models.CharField(maxlength=79)
classes = models.ManyToManyField(Class,
blank=True)
i define some classes (Musi
adamjspooner wrote:
> Ok, so I posted this request in a different topic and never heard a
> peep, so I thought I'd try it in it's own post.
>
> I'm a newb to Django. I love it because I love Python. I'm also a
> semi-newb to Python. I've written some cool stuff in Python that I
> like, but can
Filipe wrote:
> Hi,
>
> The docs say [1] that:
> "Django requires Apache 2.x and mod_python 3.x, and you should use
> Apache's prefork MPM, as opposed to the worker MPM."
>
> I want to test a Django site on a server (I plan to deploy there some
> other sites in the future) where there are instal
On 9/5/06, adamjspooner <[EMAIL PROTECTED]> wrote:
> I'm a newb to Django. I love it because I love Python. I'm also a
> semi-newb to Python. I've written some cool stuff in Python that I
> like, but can't seem to make the connection between my Python code and
> Django. My biggest trouble is w
> Hey Spoon,
>
> You're asking a lot of disparate questions here, but the basic thing
> to understand is that a Django view is *just Python code*. A view is
> just a Python function that returns an HttpResponse object. You can
> put whatever you want in there; you can do whatever you need to do
>
Hi,
The prepare is actually a method of Manipulator that calls the prepare
method in each of the fields.
So you might want to call it from the Manipulator.save() method. Or in
the html2python by overiding it, calling first self.prepare() and then
Method.html2Python(self). But I'm just guessing,
Ok, so I posted this request in a different topic and never heard a
peep, so I thought I'd try it in it's own post.
I'm a newb to Django. I love it because I love Python. I'm also a
semi-newb to Python. I've written some cool stuff in Python that I
like, but can't seem to make the connection b
Hi,
The docs say [1] that:
"Django requires Apache 2.x and mod_python 3.x, and you should use
Apache's prefork MPM, as opposed to the worker MPM."
I want to test a Django site on a server (I plan to deploy there some
other sites in the future) where there are installed Apache 2 and
mod_python 3.
I've run into a similar problem witha a custom field I am developing
that is, in-part, based off of CheckboxSelectMultipleField. Do you know
if there is any way to automate the call of prepare?
--
mthorley
--~--~-~--~~~---~--~~
You received this message because y
Cheers,
After a lot of trial-and-error and some source reading, an answer to
my own post:
In order to use a CheckboxSelectMultipleField as a SelectMultipleField
you must prepare the data before :-)
That means:
if request.POST:
new_data = request.POST.copy()
errors = manipulat
On Tue, Sep 05, 2006 at 04:23:59PM -, brian corrigan wrote:
>
> Hi all,
>
> I'm trying to run two seperate Django project on the same server, one
> on port 7000 and one on 8000. Both projects use the auto generated
> admin and authentication. When I am logged into one (say on port 7000)
> an
On 9/5/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote:
> I believe the {% include %} tag doesn't integrate with template
> inheritance as you're expecting it to.
Fair enough. Is there a better way to accomplish this? I'd much
prefer to have the title defined within the template rather than
havin
Damn. I figure it out 10 seconds after posting. I needed to add
allow_empty=True to the arguments for object_list. Sorry everyone.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
I'm trying to add my own app to the site I created when I went though
the tutorial. So, I've already got "polls" set up, and I'm trying to
set up an app called liontamer. I've done essentially the same thing
as the polls site (described below), but when I try to go to the root
url (localhost:800
I see. 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 [EMAIL PROTECTED]
Ok, got this one figured out, posting here if someone hits the same
wall.
The pre-installed gettext on the mac is version .10 something. gettext
support for python is >.12 so you must install a newer version.
installed it from darwin ports and it worked like a charm.
cheers
arthur
--~--~
Hey Rory...
On Monday 04 September 2006 17:03, Rory Campbell-Lange wrote:
> I'd be hugely grateful for advice on how suited Django might be to
> integrating with custom-written pl/pgsql queries, stuff that running the
> Django test tutorial does not answer. I imagine mapping python objects
> to pl
Hey Laundro,
On Tuesday 05 September 2006 06:56, [EMAIL PROTECTED] wrote:
> Do I need to create one big view.py that sends all relevant data to one
> large template? (I'd imagine not). Is there a way to 'cascade'
> view.py's, so that some sort of website-logic decision script can
> decide which v
Hi all,
I'm trying to run two seperate Django project on the same server, one
on port 7000 and one on 8000. Both projects use the auto generated
admin and authentication. When I am logged into one (say on port 7000)
and try and access the other project on 8000 I get the following error:
Suspicio
On 9/4/06, Cole Tuininga <[EMAIL PROTECTED]> wrote:
> The idea being that my individaul page templates can simply {% inherit
> "base.tmpl" %} and then simply do something like:
>
> {% block title %}The title for the particular template{% endblock %}
>
> However, when I render this, it turns out to
It occurs to me as I look at this further that I don't want to return
the Section object at all and what I'm really trying to do is get the
appropriate Section object and then return it's child sponsors.
--~--~-~--~~~---~--~~
You received this message because you
On 9/5/06, limodou <[EMAIL PROTECTED]> wrote:
>
> Sometimes I will get below error message, but not each request I could
> get this, but it occurs very often, I don't know why? I'm working in
> windows XP, python 2.4.3, django trunk version. Has anyone also
> encountered this problem?
>
> [05/Sep/
A short cut
register = template.Library()
class SponsorsListNode(template.Node):
def __init__(self, section, varname):
self.section = section
self.varname = varname
def __repr__(self):
return ""
def render(self, context):
context[self.varname] =
Secti
example code
qdict = QueryDict('id=1&fk_client_id=2')
queryset = Ticket.objects
for k, v in qdict.iteritems():
queryset = queryset.filter(k = v)
Essentially what I want to do here, is get a list of filter keywords
from an HTTP request, and then iterate through these to create the
final filt
What I'm trying to do is grab the site sponsors according to site
section. Some sponsor section A, others section B, etc.
As I have it, I'm returning a list of sponsors filtered by section.
This works, but it seems dumb, since I'm always returning a list of one
(section). In my template, which th
On 9/5/06, Chubby <[EMAIL PROTECTED]> wrote:
> I would want to have parts of the generated admin page available to the
> users.
> With parts i mean the functionality to add, edit and delete records
> from
> the tables containing the application data (so not the users/groups
> etc).
You'll want to
Thanks for the tip Nate!
Does any one know what method receives the data from the form when it
is submitted? I tried models.Field.get_db_prep_save but that doesn't
seem to be working. I need to process the form data before it is passed
off to the database for saving.
--
mthorley
--~--~
Hi,
i'm going to use django to develop a web app (and several more after
that :)).
I did the tutorial and a few things where unclear to me.
I would want to have parts of the generated admin page available to the
users.
With parts i mean the functionality to add, edit and delete records
from
the t
Thank you for the reply
I still use Django 0.91 and I could not find
django/db/backends/mysql/base.py
I found only C:\Python23\Lib\site-packages\django\core\base.py
and C:\Python23\Lib\site-packages\django\core\db\mysql.py
Which file should I change with
if self.connection.get_server_info() >=
Hi,
I'm relatively new to Django, but I have created my fair share of
view.py's already, some basic, some less basic. There's still something
I can't get my head around (yet), and that is how to integrate it all
into one big website.
For instance, the views I have created are search forms, regis
On 8/26/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> for svn checkout or export the correct trunk-url is
> http://svn.sourceforge.net/svnroot/django-userlibs/trunk
>
> Regards,
> Dirk
I finally got a chance to look at your work, but I really don't
understand how to make it work, t
Hi,
It seems to me that TextField has a maximum number of text.
In the code /django/forms/__init__.py:
class TextField(FormField):
def __init__(self, field_name, length=30, maxlength=None,
is_required=False, validator_list=None, member_name=None):
It seems to be maxlength. You can see it us
On 9/5/06, primitive <[EMAIL PROTECTED]> wrote:
Is it possible to use a string (coming from an request object) as akeyword to filter? I keep getting errors, but I don't know how toconvert these strings into types that filter will understand.
Short answer; yes. request.GET is just a dictionary of or
Just from the top of my head (I'm a bit bored at work).
As the filter options are python scripts anyway, maybe you could
integrate them in your script and call them from within the script and
send the altered text to your template?
Or maybe you could write your template from within the script its
thanks for the report, I'll fix it and push to SVN
--~--~-~--~~~---~--~~
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 gr
How can I set a maximum for the amount of text a user enters in a
TextField form? CharField has a 'maxlength' parameter, but TextField
not.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To po
Good day,
I am a Python and Django newbie, so bear with me if this is a silly
question.
Is it possible to use a string (coming from an request object) as a
keyword to filter? I keep getting errors, but I don't know how to
convert these strings into types that filter will understand.
eg. I conve
There is no formatting whatsoever, so I guess I can feel comfortable
storing (max) 5000 characters in a database field. Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this g
首诗,I think you can use Django without using its DB features -- only views and templates.Just check out the tutorials, and whenever Model data is being fetched or stored, use your server calls in whatever format you need instead.
On 9/4/06, 一首诗 <[EMAIL PROTECTED]> wrote:
Hi allIn most cases, web app
Sometimes I will get below error message, but not each request I could
get this, but it occurs very often, I don't know why? I'm working in
windows XP, python 2.4.3, django trunk version. Has anyone also
encountered this problem?
[05/Sep/2006 19:48:56] "GET /site_media/cbc/syntax/Scripts/shBrushX
That was the painfully obvious step I was missing. As expected, both
relieved and annoyed. Thanks for both.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email t
On 9/5/06, limodou <[EMAIL PROTECTED]> wrote:
> On 9/5/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > Link: http://code.google.com/p/diamanda/
> > The SVN repository contains the latest code for diamanda wiki and
> > MyghtyBoard forum (NEW).
> >
> > Requiremens:
> > - django svn or 0.95
in mysql config:
[mysqld]
default-character-set = cp1251
default-collation = cp1251_ukrainian_ci
init-connect="SET NAMES cp1251"
for your database:
create database dbase charset=utf8;
and ...
in file django/db/backends/mysql/base.py
we have:
if self.connection.get_server_info() >= '4.1':
curs
Yes, you can use MySQL's CONVERT() or CAST() functions
(http://dev.mysql.com/doc/refman/5.0/en/charset-convert.html). As
limodou says - move everything to UTF-8, it'll save you hours of
hardwork later.
--Simon
--~--~-~--~~~---~--~~
You received this message becau
For that reason I made a custom object_list view based on the generic one.
-- code start --
def object_list(request, queryset, paginate_by=None, page=None,
allow_empty=False, template_name=None, template_loader=loader,
extra_context=None, context_processors=None, template_object_
take a look at http://www.softcomplex.com table sorting and pagination, simply amazing- Original Message From: Robert <[EMAIL PROTECTED]>To: Django users Sent: Tuesday, September 5, 2006 11:13:55 AMSubject: Generic views table sortHi,I'm using 'object_list' for getting object list and now I
Hi,
In reference to [1], what would be the best way to provide a
datasource for a model that is backed on a WebService ?
Image you have a webservice that returns "customer objects", then I'd
like to have a model called Customer on which to use .objects.all()
and so. So, how should I build that mo
Filipe wrote:
Ian Holsman wrote:
im = Image.open('%s/blah.jpg' % settings.MEDIA_ROOT )
resp = HttpResponse( mimetype="image/jpeg" )
im.save( resp, 'JPEG' )
return resp
?
yeah, precisely! thanks.
although it works perfectly there's something I don't quite u
Hi,
I'm using 'object_list' for getting object list and now I need to add
column sorting in my table.
I am new to both python & Django, and read
contrib/admin/teamplates,tamplatetags many times and can't understand
how
pagination & column sorting works in Admin panel.
Also tried a javascript 's
Ian Holsman wrote:
> im = Image.open('%s/blah.jpg' % settings.MEDIA_ROOT )
> resp = HttpResponse( mimetype="image/jpeg" )
> im.save( resp, 'JPEG' )
> return resp
> ?
yeah, precisely! thanks.
although it works perfectly there's something I don't quite understand
(i'm still a newbie
On 9/5/06, PythonistL <[EMAIL PROTECTED]> wrote:
>
> Limodou,
> Thank you for your reply.
> Is it possible to "convert" the field in MySQL instead of converting
> characters?
> Thank you for reply
> L
>
I don't know. I only use utf-8, so I havenot encountered your problem till now.
--
I like pyt
Limodou,
Thank you for your reply.
Is it possible to "convert" the field in MySQL instead of converting
characters?
Thank you for reply
L
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
Hi,
Databases can handle much larger files than that. People use databases
to keep the entrances of the blogs, and some of them can be pretty
large (see some of the django developper blogs as an example).
Hope it helps.
G
On 9/5/06, cyberco <[EMAIL PROTECTED]> wrote:
>
> Thanks for the pointer
On 05-Sep-06, at 1:57 PM, cyberco wrote:
> he model (i.e. each row in the db table) potentially contains 5k
> characters. Is that too much for a database and should I put that text
> in files? Or is that no problem at all?
5k is nothing - the question is, what kind of formatting do you have
o
On 9/5/06, PythonistL <[EMAIL PROTECTED]> wrote:
>
> Hello ,
> I use MySQL with Django and it works great untill I try to insert
> non-English characters.Then I get
>
>
> (1267, "Illegal mix of collations (utf8_czech_ci,IMPLICIT) and
> (latin1_swedish_ci,COERCIBLE) for operation '='")
>
> How can
Thanks for the pointer, but flatpages is not exactly what I am after.
To be more specific: one of the fields in my model is a TextField that
holds a maximum of 5000 characters. This means that each instance of
the model (i.e. each row in the db table) potentially contains 5k
characters. Is that to
Hello ,
I use MySQL with Django and it works great untill I try to insert
non-English characters.Then I get
(1267, "Illegal mix of collations (utf8_czech_ci,IMPLICIT) and
(latin1_swedish_ci,COERCIBLE) for operation '='")
How can I correct this error?
Thank you for help
L.
--~--~-~--~-
Hi.
On 04/09/06, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
>
> Django ORM is high level and specific ORM which in generall work with
> tables described in models and it was designed for a
> CMS-maker-framework :) If you have more advanced database stuff then
> you could use independent python
If I understand you correctly your problem is the shell not finding the
django-admin.py file.
Setting the PythonPath doesn't put django-admin.py on your normal Path,
which is used to find commands in the shell.
So you could either symlink django-admin to some place in your Path,
like /usr/bin, or
84 matches
Mail list logo