coulix wrote:
> last time i look at it they were no solutions :/
Yeah i had the same problem. I needed some logging mechanism to trace
all changes in DB (also in m2m relations).
The solution i did take was application specific. I don't think that
django provides any hookups for such actions.
re
Yes, I know. Sorry, should have been more specific:
the problem is, that the second part of the url pattern comes from a
different model.
I've tried
(r'^categories/(?P\d+)/(?P\w+)/$','django.views.generic.list_detail.object_detail',
info_dict),
but it's obviously not quite there...? How would I
Hi.
Im not sure, but i guess You are using generic views.
If yes, make a wrapper of your view, and put that code in that wrapper
function.
Besides overriding save of the model works fine.
But i personally would put such code in my own form manipulator, you
keep clean views and your model also.
Kin
Hi Milan,
> Is there a workaround for that?
Sorry I don't know.
>I'll write my own views.
Maybe you can expand the admin using your own views. Take a look at the
next app for some ideas:
http://trac.dedhost-sil-076.sil.at/trac/filebrowser/wiki
Success.
Rob
--~--~-~--~~-
Hi Milan,
> Is there a workaround for that?
Sorry I don't know.
>I'll write my own views.
Maybe you can expand the admin using your own views. Take a look at the
next app for some ideas:
http://trac.dedhost-sil-076.sil.at/trac/filebrowser/wiki
Success.
Rob
--~--~-~--~~-
Mathew,
I think you need to look at "Signals". It's an implementation of
Pydispatcher. Basically, you register your signal to a particular
object. Whenever that object is about to be changed the signal is sent
and your code is runt.
There is a "Pre-Save" state which should allow you to ru
I'm developing an application in which different users should see different
data, I'd like to enforce this in the db rather that in the application. How
can I bypass the username/pass in settings.py with username/pass provided by
the user? Is that any possible?
Are there functions to connect as
thanks a lot. problem fixed as you said.
I use Firefox under linux. does it treat newline as \r\n??
On 12/11/06, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
> It seems that your browser treats new lines as under dos/windows. Is
> it Konqueror?
>
> I would suggest you to override the save method
You'll want to look into the save and delete hooks functionality here:
http://www.djangoproject.com/documentation/models/save_delete_hooks/
What it would look like is add to Publications:
def save(self):
super(Publications, self).save() # Call the "real" save() method
customer_list
I need some advice on configuring a separate media server for our jpeg
images.
We are running Django on Apache 2.2 with mod_python 3.2.10 (python2.5)
on a Windows 2003 server.
As recommended in the docs, I am setting up a separate web server to
serve the media. I've installed Lighttpd 1.4.13 and
It might be that it treats new lines as \r\n when you are using some
windows-* encoding for your html pages. Check the source code. I would
rather use UTF-8 in any case.
Regards
Aidas Bendoraitis [aka Archatas]
On 12/13/06, zhongke chen <[EMAIL PROTECTED]> wrote:
> thanks a lot. problem fixed as
On 12/13/06, conrad22 <[EMAIL PROTECTED]> wrote:
>
> Yes, I know. Sorry, should have been more specific:
> the problem is, that the second part of the url pattern comes from a
> different model.
>
> I've tried
> (r'^categories/(?P\d+)/(?P\w+)/$','django.views.generic.list_detail.object_detail',
>
On 12/13/06, Tipan <[EMAIL PROTECTED]> wrote:
>
> However, I can't seem to get an simple image to display through a
> Django template.
>
> I've tried all sorts of combinations and can't seem to make any
> headway.
>
> Any advice welcome. Details of my settings etc. below.
>
> Template call is simp
On 12/13/06, Sandro Dentella <[EMAIL PROTECTED]> wrote:
>
>
> I'm developing an application in which different users should see different
> data, I'd like to enforce this in the db rather that in the application. How
> can I bypass the username/pass in settings.py with username/pass provided by
>
Hello,
i really like the documentation intergration in Django's admin interface. I'm
wondering how to document parameters though. I've tried using ReST for my
classes and functions as described below, but :Parameters: doesn't seem to be
recognized.
http://epydoc.sourceforge.net/fields.html
5.
On Dec 13, 1:58 pm, "Waylan Limberg" <[EMAIL PROTECTED]> wrote:
> On 12/13/06, Tipan <[EMAIL PROTECTED]> wrote:
>
> http://192.168.1.9:3000/gobites.jpg";>
>
> Generally speaking I believe the conventional way to do this when both
> servers are on one machine is to point all traffic to the static
On 12/13/06, Tipan <[EMAIL PROTECTED]> wrote:
>
>
>
> On Dec 13, 1:58 pm, "Waylan Limberg" <[EMAIL PROTECTED]> wrote:
> > On 12/13/06, Tipan <[EMAIL PROTECTED]> wrote:
> >
> > http://192.168.1.9:3000/gobites.jpg";>
> >
> > Generally speaking I believe the conventional way to do this when both
> >
What you want to use in your template is a reference to the media URL prior
to the static images. We're using
blah blah blah
blah.. It generally requires a bunch of search & replace for the first time
you implement it, and then just remembering to reference the {{media_url}}
thereafter as you bui
On 12/12/06, Yatla <[EMAIL PROTECTED]> wrote:
>
> Newbie here - saw that the same question was asked earlier but not
> answered, and the post was locked so I could not reply.
>
> I have a Django site in a subdirectory as follows (via fcgi) - (using
> ver 0.96 pre via svn)
>
> http://mydomain.com/d
On 12/13/06, Joseph Heck <[EMAIL PROTECTED]> wrote:
> We're using
>
> blah blah blah
...
> And then in the settings.py under TEMPLATE_CONTEXT_PROCESSORS, we added:
>"myproject.context_processors.common",
>
> There may well be a much better way to accomplish this all, but that worked
> out nic
I'm not using the admin interface though...will this work with that?
(I'll give it a shot and see)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-u
Hmm...
I have to keep the Address on Company... as Address will be being used
in other places as well..and is not always related to a company... I
have a Property and User classes as well..and each of them will have an
Address foreign key.
I'd like to be able to show a form for Property and User
[EMAIL PROTECTED] ha scritto:
> I'm not using the admin interface though...will this work with that?
> (I'll give it a shot and see)
edit_inline argument works well with both admin interface and custom
views (I'm using the latter).
Massimiliano
--~--~-~--~~~---~--~
Ok..this is what I've changed it to... but it's still not displaying an
edit box for my street numberI'm using the Company
changemanipulator...
In my form I'm using the following ( I tried putting a 0 in there like
your sample..but it gave an unindexable object error )
Street #:{{
form.addres
Mmm...I actually got it to work in the category_detail template:
{% for organisation in object.organisation_set.all %}
{{organisation.org_name}}
{% endfor %}
Each category does return a list of the organisations that are in it,
but what I need to do is then simply provide access to
I kinda asked the before, but maybe I wasn't clear.
I know you can use sitemaps with an object_detail generic view, and
applaud the developers for how easy it is to do so.
But how do you use them with an .object_list view?
In particular, the genericSitemap, or in general?
--~--~-~--~-
hi,
I've just set up a django server which is currently available through
multiple domain names, and I just noticed that caching only works for
one of the domains.
what have I missed? how do I troubleshoot this?
(I'm using 0.95 on the deployment server, btw)
--~--~-~--~~-
Fredrik Lundh wrote:
> how do I troubleshoot this?
by hitting myself in the head with a suitable object, obviously.
(when using CACHE_MIDDLEWARE_ANONYMOUS_ONLY, make sure you're logged out
when testing cache behaviour...)
--~--~-~--~~~---~--~~
You received
If I have a fairly intensive view, is there a way to return the
response (ie a thank you) and continue doing my number crunching?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to thi
Don -
How do I check the revision? import django; django.__version__ prints
'0.95' but not the revision number.
I just updated from svn with:
svn co http://code.djangoproject.com/svn/django/trunk/
but I still get the same behavior - manage.py doesn't know about
"test".
Thanks,
Bob
On Dec
On 12/13/06, Bob <[EMAIL PROTECTED]> wrote:
>
> Don -
>
> How do I check the revision? import django; django.__version__ prints
> '0.95' but not the revision number.
On the command line from within your django_src directory do:
svn info
That should tell you the revision number among other
For your requirements OpenEMM might be a better solution:
http://www.openemm.org/home.html .
Reinhard
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djan
Hi Massimiliano,
I hope you don't mind my emailing you directly... I sent a reply on the
groups... but thought I'd send it directly to you as well... since you seem
to be using this technique...
In my form I'm using the following ( I tried putting a 0 in there like your
sample..but it gave an uni
Thanks all - that makes a lot more sense now. It was definately a case
of me looking for too simple a solution in the first place.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to t
Hi.
I'm using ImageFields in my portal application and allowing people to
upload their photos.
Since digital camera software creates rather predictable file names,
I've now got loads of files like this:
PICT0006.JPG
PICT0006_.JPG
PICT0006_.jpg
PICT0006__.JPG
PICT0006__.jpg
PICT0006___.JPG
PICT000
It seems that the most obvious way would be to alter _save_FIELD_file in
django/db/models/base.py ~ line 335.
Relatively trivial patch, you'd just need to add an accumulator to the while
loop, afaict.
Naturally there may be horrid consequences I haven't thought of ;)
Cheers,
~ol
On 12/13/06, [E
Hello all,
I have this setup (stripped):
class Album(models.Model):
title = models.CharField(maxlength=255)
...
class Person(models.Model):
first_name = models.CharField(maxlength=50, blank=True)
last_name = models.CharField(maxlength=100)
...
class Performance(models.Model):
album = models.For
Rob Slotboom wrote:
> I installed Luke Plant's Tagging App and started reading the README
> file and the comments provided in the source. Compared to the marvelous
> Django Book and -tutorial this reading isn't very funny :-)
>
> Has someone a simple example for how to include a tag in another mo
It looks like this edit_external option may be what you're looking for:
http://code.djangoproject.com/ticket/1476
Does anyone know if this enhancement is in the works? It would be
really neat.
--~--~-~--~~~---~--~~
You received this message because you are subsc
Jorge,
Many thanks! I was using an .htaccess in the subdirectory, but did not
have the subdirectory specified after the fcgi file in the last rewrite
rule. I don't know much about this so just copied from a tutorial on
this that did not have the subdirectory in the rewriterule. Thanks
again!
[EMAIL PROTECTED] wrote:
> I have to keep the Address on Company... as Address will be being used
> in other places as well..and is not always related to a company... I
> have a Property and User classes as well..and each of them will have an
> Address foreign key.
Well, I think we'll have to wai
I have a model for people and each person can have many other people as family:
related = models.ManyToManyField('self', verbose_name="Related",
filter_interface=models.HORIZONTAL, blank=TRUE)
Right now, the field is required, but I want it to be optional, but
blank=TRUE returns an error:
"name
Dear All,
I'm a newbie with Django, and have what is probably a very simple question.
I'm trying to get the values from an html drop-down form.
I've got a form like this:
A
B
C
D
E
with a method in views.py:
ansQuestion(request):
q = get_object_or_404(Question)
answer = requ
Austin Govella wrote:
> How do I make the self-referential Many to Many relationship optional?
Try to add "null=True".
Massimiliano
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
On 12/14/06, Noah <[EMAIL PROTECTED]> wrote:
>
> If I have a fairly intensive view, is there a way to return the
> response (ie a thank you) and continue doing my number crunching?
The only way to do this would be to use your view code to start a
thread and do your processing in the thread, with
Matt Williams wrote:
>
> A
> but I keep getting an error about an empty MultiValuedDict {}, which I
> think means that I'm not getting the values back.
Try:
A
...
and then read request.POST['letter']
Massimiliano
--~--~-~--~~~---~--~~
You received this
On 12/14/06, Austin Govella <[EMAIL PROTECTED]> wrote:
>
> How do I make the self-referential Many to Many relationship optional?
Um... m2m relationships are optional by definition. A ManyToMany field
sets up an intermediate table, but adds nothing to the model table
itself. You are not required
On 12/14/06, Austin Govella <[EMAIL PROTECTED]> wrote:
> blank=TRUE returns an error:
> "name 'TRUE' is not defined"
Oh.. and the obvious error here - The Python boolean truth symbol is
'True', not 'TRUE' - the error you are getting is because the symbol
TRUE is undefined.
Yours,
Russ Magee %-)
Russell Keith-Magee wrote:
> Um... m2m relationships are optional by definition
I wrote:
> Try to add "null=True".
Sorry Austin; too quick reply... and maybe it's time to go to bed :-)
I confused your m2m with a normal foreign-key.
Massimiliano
--~--~-~--~~~---~--
Oliver Lavery wrote:
> It seems that the most obvious way would be to alter _save_FIELD_file in
> django/db/models/base.py ~ line 335.
>
> Relatively trivial patch, you'd just need to add an accumulator to the while
> loop, afaict.
>
> Naturally there may be horrid consequences I haven't thought o
This is going to sound like an odd question, but I'm hoping people will
have some ideas.
I teach CS in a high school, and next semester my lab is going to be
replaced with a thin client lab running on Ubuntu. My seniors and I are
working on a Django project and will all be trying to run the
devel
I don't know about horrible, it depends what you're going for. I was
sort of suggesting that the default behaviour for file fields and image
fields is wrong, and changing it fundamentally would be the way to go.
Overriding save() is much cleaner, you're right. But I don't think the
test should be
You can avoid the test database issue by having the students use SQLite as
the database backend. They can store the database in their home directories
and be good to go.
-joe
On 12/13/06, Todd O'Bryan <[EMAIL PROTECTED]> wrote:
>
>
> This is going to sound like an odd question, but I'm hoping peo
Good point - done.
http://code.djangoproject.com/wiki/CookBookUsingExternalMedia
-joe
http://www.rhonabwy.com/wp/
On 12/13/06, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
>
>
> On 12/13/06, Joseph Heck <[EMAIL PROTECTED]> wrote:
> > We're using
> >
> > blah blah blah
> ...
> > And then in the setti
On 12/13/06, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
> On 12/14/06, Austin Govella <[EMAIL PROTECTED]> wrote:
> > How do I make the self-referential Many to Many relationship optional?
>
> Um... m2m relationships are optional by definition. A ManyToMany field
> sets up an intermediate table
Ooh. That's a great idea. I'd been meaning to try to move the test
database to SQLite anyway.
Thanks!
On Wed, 2006-12-13 at 16:29 -0800, Joseph Heck wrote:
> You can avoid the test database issue by having the students use
> SQLite as the database backend. They can store the database in thei
And for the record, blank=True does make it not required.
:-)
Thanks guys!
--
Austin Govella
Thinking & Making: IA, UX, and IxD
http://thinkingandmaking.com
[EMAIL PROTECTED]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the G
oliver.lavery wrote:
>
> class Photo( Model )
> def save( self ):
> c = Photo.objects.all().filter( name = self.name ).count()
> if c > 0:
> self.name += '_' + str( c + 1 )
> Model.save( self )
This won't work as you expect. The first file named 'foo' will be saved
a
If anyone else stumbles on this post and has a similar problem then
it's worth noting that the value field was a varchar doing an numeric
range evaluation on it. Even though it does in fact work some times
(mysql), you're better off hooking the save() method on a model and
converting the value to
My first experiment with Django is a kind of wiki that involves being
able to add a variety of different types of pages, each with their own
set of fields. The obvious way to do this would be to create a base
model page class which various page types inherit. But I can't imagine
how the Django ORM
60 matches
Mail list logo