Hi Christian.
I've tried a few hosting setups in the paste year with various degrees
of success too. I've never been able to get a good, stable fcgi setup
myself.
In the end I've settle of webfaction. They have a very good setup with
you own apache instance + mod_python, and it's very affordable
Hi Folks.
I've looked through the docs (which are pretty godd by the way) and
the source code, but it look as it's not easy to customize the
tag that goes along with a widget.
When instantiating a widget I can pass the attrs dict and those
properties will be rendered as html attributes. But th
Hi Leif.
Thanks for the pointer.
This certainly looks userful, but if I understand this right it makes
easier to link to external js and css, not customize the output of the
tag.
Cheers
Arthur
On Jul 9, 10:06 pm, leifbyron <[EMAIL PROTECTED]> wrote:
> Arthur,
>
> You'll probably find this of i
Hi Folks,
While implementing a form with edit inline like functionality, I've
hit a wall. In order to tell apart each inline model, I am using the
"prefix" parameter to instantiate the form. It works, but if it's a
bound form (whether from instance or getting values from a dict), if I
pass it a p
Hi Sam.
As someone who codes Actionscript for a living, I can understand where
you are coming from.
>
> That is the point, when HTML is the lowest common denominator, a web
> application is limited. HTML is evolving at a snail's pace, whereas
> Flash has steadily evolved into something far more
I'll second Patrick's opinion.
It's an interesting idea, but I doubt it will be practical at all to
put together classes at the backend and make that into an application
somehow. You're probably better off developing modules, precompiled
swf with functionality and a shell loading what modules you
Hi Rob.
After the unicode branch merge django expects and produces unicodes
objects throughout.
A detail how to port guide is here:
http://code.djangoproject.com/wiki/UnicodeBranch#PortingApplicationsTheQuickChecklist
In this specific case, you can call "lower" directly on your unicode
object:
It took me a while to understand manager better a little bit too.
Managers are pretty useful when you have a specific query / queryset
that will be common case, and it's more convenient to place that query
on one place and avoid repeating yourself.
For example, suppose you have a blogging app wit
yes, same thing here.
strangely enough, I have a model with a foreign key acting as a
list_fillter and it's fine.
another model (same app) list filters wont't work (foreign key or not)
.
this was working a little while ago.
still looking into it...
--~--~-~--~~~---
yes, syncdb is for current trunk (post magic removal).
please notice that if you're using 0.91, you can use the old
documentation from here:
http://www.djangoproject.com/documentation/0_91/
but if you're just getting started updating to the dev version is your
best bet.
cheers
arthur
--~--~--
yes this is a known bug.
see ticket 639
http://code.djangoproject.com/ticket/639
currently I'm using an ugly work around such as
def save(self):
if self.imagefield :
#do whetever, files does exist...
also this seems to cause problems withe DateFields with auto_now...
--~--~--
Hi Alan.
have you tried this one ?
http://code.djangoproject.com/wiki/CookBookShortcutsOpenIDAuthentication
(it's about a month old, but I haven't used it my self)
cheers,
arthur
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Hi folks.
I've just ran into a small glitch when moving an app to a new server.
My application is "missing" from the admin main view.
Everything is installed correctly. I can mange.py shell and work on my
models and my data interactively (I've moved the db as well).
the application's models do
Hi Doulgas.
It's not db related.
Somehow my fcgi script was setting the DJANGO_SETTINGS... env variable
on the wrong path.
Thanks a lot anyways,
arthur
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django us
I have an app deployed on lighttpd, but I am getting this memory error.
My local codebase runs fine (both on the devserver and on my local
lighttpd),which leads me to think it's a server issue. I am hosted on
textdrive - we're running lighttp + fcgi.
This only happens when uploading large files (
Hi beewee,
__repr__ has been replaced by __str__ . this is more of a return to
python conventions than anything.
try changing your __repr__ methods to __str__ ones.
more on this here:
http://groups.google.com/group/django-users/browse_frm/thread/9f6f205e0f9cbc8e/800b8c3367f79b38?q=__str__&rnum=
Hi Luke,
Please do so.
Tagging is, buzzword or not, pretty useful and many people have / will
implement it on their own (I was mid way through just now).
It would be great to leverage on your code, and I think it would
benefit django users in general, as it could make more applications
pluggabl
Hi Alloy.
Yes, it's a bug.
more details here:
http://code.djangoproject.com/ticket/639
basically you have to check for self.imatge != '' before doing anything
with the file.
cheers,
arthur
--~--~-~--~~~---~--~~
You received this message because you are subscrib
Hi Elver.
This is a feature.
This behaviour depends on wheter you want yor sessions to expire and
when. More details in the docs:
http://www.djangoproject.com/documentation/sessions/#browser-length-sessions-vs-persistent-sessions
arthur
--~--~-~--~~~---~--~~
You
Hi james,
regarding:
> when I upload a file (a 10+MB mp3) on my local machine, it
> takes quite a while and pegs the CPU. Is this expected and is this
> going to be the behavior when I put it in production under fastcgi?
django keeps the whole upload in memory.
this has been discussed a few times
Could this be it
http://code.djangoproject.com/ticket/572 or
http://code.djangoproject.com/ticket/1584 ?
me thinks this was fixed recently. =>
http://code.djangoproject.com/changeset/3002
are you running an up to date svn version?
see if that helps
--~--~-~--~~~--
won't this work for you:
class Node(Model):
parent = ForeignKey('self', blank=True, null=True)
... rest of your model...
then fetch it like Node.objects.filter(parent__isnull=True)
if you are worried with the possibility of ending up with mode that
one root node you could do either (bot
Hi Fabien.
> App User:
> class User:
> #some fields
>
> App Blog
> class Blog:
> author = models.ForeignKey(User.user)
>
> Is-it possible to do that ?
Sure. Models are regular python classes, all you must do is to import
it's module before using it.
Like:
from django.contr
I've been playig with GenericForeignKey and they are great.
One question though, they do not show up on the admin app.
For example on the object that should be 'tagged', I would like to edit
tags inline. Is thart possible at all?
thanks,
arthur
--~--~-~--~~~---~--
Hi Guillermo.
I haven't looked at those galleries but if you are going to code some
of it, take a look at nesh's ImageWithThumbnail[1] field and related
utilities. You might reduce the ammount of biolerplate code greatly.
cheers
arthur
[1] http://djangoutils.python-hosting.com/wiki/Thumbnails
In a current project, I've got a lot of fields that must accept markup.
Currently I am using markdown to parse the raw text. I am aware of the
useful template tags to apply markdown on the template itself, but
since reads are much more common than writes I would like to store the
markup on the dat
HI Ian.
Thanks for the pointer.
It's an interesting approach though, if I did understand it, that
requeries the "raw" markup source's name to be hardcoded into the
middleware, right (e.g. 'description')?
If so, I am back to square one, for among all models I have quite a few
that must be parsed
Hi Steven.
this one got me stuck for hours (grin).
if your INSTALLED_APPS is right and your admin inner class too, you
probably have an error on an import on your model class.
fire up the shell on your server setup. can you import your model
module?
--~--~-~--~~~---
Hi Russel.
Thanks for the patch. I am sure this one will save newbies a few hours
of starting blankly at the screen.
cheers
Arthur
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to t
In your model, overide the save method :
def save(self):
# get number of objects
maxNumber = 5
current = MyModel.objects.all().count()
if current < maxNumber:
super(MyModel, self).save()
#you can either pass - object won't be saved, or raise an exception
cheers,
arthu
"A Django Model"
...
--~--~-~--~~~---~--~~
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 PROT
Yes, you will probably run into memory issues for larger uploads if you
are on a shared host.
There is,however, ticket's 2070 patch that adrresses that issue.
http://code.djangoproject.com/ticket/2070
arthur
--~--~-~--~~~---~--~~
You received this message becau
What you are looking for is the edit_inline option for the event field:
class EventDate(models.Model):
...
event = models.ForeignKey(Event, edit_inline=True)
more info here:
http://www.djangoproject.com/documentation/tutorial2/#adding-related-objects
[]
arthur
--~--~-~--~
On macrodobe's site, there's a reference implementation of php
receiveing the flash upload. it's php, but you can have an idea of
where things are on the request:
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=1591.html
The flash
Hi drakepad.
I am not aware of a good way to implement this, but this is how I have
been doing it...If you must have an arbitrary order (not by date or
alphabetical) you must create a field specifically to store your
desired order.
class MyModel(Model):
... regular fields go here...
posi
also, simon willison's javascript introduction is excellent:
http://flickr.com/photos/simon/sets/72057594077197868/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
Hi Bob.
If you're getting 404's, then it's not in import problem on your view.
>From your code this line grabbed my attention:
p = get_object_or_404(Myclass, pk=slug)
if your are searching against the pk, this will only get any results if
the slug is the pk for your model (that will only happe
Bob wrote:
> What would it be if I want to get my item from the database by the slug?
this depends on the moel's ttribute name (the one that's a slug).
If you can post you model's code, I can assiste further...
cheers
--~--~-~--~~~---~--~~
You received this me
Hi Joe.
Also if you don't fell like reinventing the wheel, you might want to
take a look at limodou's multi-user blog app written in django.
It's been a while since I haven't played with it, but it's probably
worth a look. More info here:
http://groups.google.com/group/django-users/browse_frm/th
You should also take a look at nesh's excellent
ImageWIthThumbnailField:
http://djangoutils.python-hosting.com/wiki/Thumbnails
cheers
arthur
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
Hi Patrick.
I've been planing to implement this, but haven't found the time to. I
know code speaks louder than words... but I've done some thought over
this and would like to share my opinions.
> 1. right now, you can drag & drop table rows within the change-list.
> NOT every action is stored
Hi Folks.
I am trying to set up my first django i18n site, and when running
make-messages.py on the command line I get the following error:
'errors happened while running xgettext on __init__.py
language `Python' unknown'
any ideas?
thanks,
arthur
p.s.: I am running make-messages on my projec
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
--~--~
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 there
In an app we are coding, we are allowing users to upload image files -
in django's admin nonetheless.
we want to set a max file size (e.g. 400 kb) so we can keep our
servers happy (those file will be processed by PIL). The idea is to
avoid an uneducated user uploading his 10 mb digital
Hi Gabor, I am dealing with the same issue here, and I've opened a
ticked for this : http://code.djangoproject.com/ticket/1315
It seems that on the admin's template ('file.html'), filefields are
susbtituted to "bound_field.original_url" which evaluates to blank
even if you use the "bound_fiel
Hi folks.
I realize this is a recurring question on this list but I have not
found an authoritative answer, maybe some one can show me the best path
to take.
I want to add new fields to a User class.
should I:
1) extend from auth.User as described in the wiki. This seems nice, but
I feel like
Hi there. I am having trouble with two many to many fields on the same
model.
I've looked around and found this very similar to ticket 327 (
http://code.djangoproject.com/ticket/327 )
my models follow:
class Project(meta.Model):
name = name = meta.CharField(maxlength=100)
...
c
Hi Andy.
Regarding memory usage on the server, AFAIK this is something related
to cgi.FieldStorage. more about this here:
http://groups.google.com/group/django-developers/browse_frm/thread/2c379ec0fa30804a/#
It would be great to have a streaming option, but aparentely this is
trickier than it se
If I read you right:
http://www.djangoproject.com/documentation/faq/#how-do-i-automatically-set-a-field-s-value-to-the-user-who-last-edited-the-object-in-the-admin
I've solved almost this problem in an app, but that's because I would
get the user from the session cookie and put it on the request
I am subclassing User in magic-removal, and ran into this gotcha. My
model:
class Account(User):
tel = models.CharField(maxlength = 14, blank=True)
book = models.ManyToManyField(Book, blank=True)
in a view I when I try this:
acc = Account.objects.get(username=test_username)
prin
Hi. I am trying to get a model's content type in magic-removal.
I have a model's instance when I try :
ContentTypeManager().get_for_model(instance)
I get :
AttributeError: 'NoneType' object has no attribute 'DoesNotExist'
I got it working with:
def get_content_type(model):
opts = model.
thanks a lot Jacob, I WAS missing the obvious.
--~--~-~--~~~---~--~~
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,
Hi Todd.
I guess what you are looking for is:
u = User.objects.get(username='namehere')
but you could also:
1) fire the shell (cd to your project dir) then:
python manage.py shell
from django.contrib.auth.models import User
dir(User) or dir(User,objetcts.all()[0])
2) on the admin sit
I stumbled upon this error message after porting a project to
magic-removal. In the admin, if I try to get the list view for
something like:
class SomeModel(models.Model):
title = models.CharField(maxlength=200)
date_due = models.DateField(blank= True, null=True)
class Admin:
hi michael.
inheritance is not working yet in magic-removal. the confusing thing
about it is you can create the class and the table does get created,
but when you access the same class later in your python code, it will
be treated as the super class (User in your case).
Extending User is a very
right now this is not possible.
there is, however, a patch in the ticket system #1541 (
http://code.djangoproject.com/ticket/1541 ) that will do it... ) sample
usage on the ticket...
cheers
--~--~-~--~~~---~--~~
You received this message because you are subscribe
Hi Norbert,
this is not possible on trunk , if you are using magic-removal, you can
do it like this:
def delete(self):
if conditionIsMet == True:
super(ModelName, self).delete() # Call the "real" delete()
method.
else:
# Don't delete.
pass
more
Hi Glenn.
the thing is, if there's anything in django's knowledge to avoid the
save / delete it DOES raise an error. (such as trying to delete an non
existant object or trying to save a model that does not pass
validation). my guess here is if you need anything else in you logic
that django does
hi folks...
am I all for it.
I've got no experience on e-commerce but there's a few things (I guess)
I may help with... I guess this would be agreat project...
I just suppose some "liberal licensing" would be nice (such as BSD or
the like)...
cheers
arthur
--~--~-~--~~~
Ok. This one is more of a "philosophy" question on django naming from
someone who's learning django, webdev and databases at the same time.
If I understand right, one of django's aim at the ORM level is to
abstract the sql level, including naming. This makes a lot of sense,
and when you see :
Man
"Setup a free python project on python-hosting.com"
+1 on this one. when getting started we better focus on the coding
right away, and python hosting's capabilities (svn + trac ) setup with
no fuss will be very helpfull (it seems).
" Any brilliant ideas?" not really...
djell, djuy , djart
--~
Hi Cary.
that depends if you're using magic-removal or trunk. On the m-r branch
there are no "magic" modules, whatever is on your path can be imported
as usual.
if you're using trunk, you must import inside your models methods, or
user module_constants (
http://www.djangoproject.com/documentatio
another thing that would be nice is a "downloadable type" of product
where the order relates to a download. of course, this could get pretty
complex if you add in things like serial numbers, versions, etc...but
we can start simple.I (personally) would like this, and I guess quite a
few of the earl
I like th idea of usign jazz musicians' names:
"monk"!
--~--~-~--~~~---~--~~
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 t
just a quick extra on this one. The documentation on the admin site
(link at top right, must have doc utils installed for this to work) is
also available on the magic-removal branch and for newbies and people
doing the transition from trunk t's pretty useful.
cheers
arthur
--~--~-~--~-
Clint, I believe this is a fcgi thing. Dreamhost kills it after a
perdiod of inactivity, which means that the first request after a few
minutes of stillness has to load django & everything else.
Later request should respond better. There are mixed reviews on
dreamhost and django on this list, qui
Oh My!
my bad. yes that should read..
" are not going to achieve *great* performance on DREAMHOST."
I just meant to say that dreamhost has nice price / feature ration but
it's just a little unreliable to host a *critical* site on it.
Isn't it great that you could just read through my mistake (a
68 matches
Mail list logo