the worst idea is:
class Picture(models.Model):
file = models.ImageField(upload_to=settings.MY_MEDIA, blank=True,
null=True)
entry = models.ForeignKey(Entry)
def filename(self):
if os.name == 'nt':
return str(self.f
Rohit wrote:
> I am using Django templates standalone for rendering an
> Apache/modpython website (without Django apps). I need to provide
> themes for each user: they will have the ability to choose from a set
> of themes and when that changes the base template directory needs to
> change *for th
>From tutorial, part 2, the following type of code
class Poll(models.Model):
...
class Admin:
fields = ( )
is used to control how the admin interface displays the Poll objects
(controlling which items appear on separate lines, etc).
How can I control how the contained obje
Well,
I figured this part out at least...
QNot(Q(field__filter='some value'))
Next Question. Is there a way to reference 'self.id' inside the model
class, to exclude the current self from the select list? In my case,
I have a self-referencing table of parents and children. I want to
elimin
On 12/6/06, Darin Lee <[EMAIL PROTECTED]> wrote:
> Does anyone have
> any pointers on how to make this work?
from django.core.meta import Q, QNot
q=QNot(Q(whatever__exact=1))
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Googl
Hi,
I'm trying to figure out how to use inverted/NOT logic in the
limit_choices_to argument for models.ForeignKey() fields. A google
search turned up the following:
http://code.djangoproject.com/ticket/1579
This tracker comment indicates that this issue was/is resolved by
adding support fo
Hrm if that's the case, I msut have slipped up in the code somewhere.
Thanks :)
I'll go see if i am inserting into sessions for some reason if they're
anonymous.
On Dec 6, 4:27 pm, Ivan Sagalaev <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > It is a problem. It hits the db if it has t
On 12/7/06, MerMer <[EMAIL PROTECTED]> wrote:
>
> I am trying to get to grips with the test client
> (Django.test.client.Client)
>
> I've done the following
>
> >>from Djano.test.client import Client
> >>c=Client()
> >>c=c.get('/promotions/',)
> >>c.status_code
> 301
301 is a permanent redirectio
I am trying to get to grips with the test client
(Django.test.client.Client)
I've done the following
>>from Djano.test.client import Client
>>c=Client()
>>c=c.get('/promotions/',)
>>c.status_code
301
I keep getting 301 or 500 status codes. I've tried the full URL but
have not got any further.
On 12/6/06, Uros Trebec <[EMAIL PROTECTED]> wrote:
> That might be a good idea. It seams that PgSQL scales 200% percent
> better than MySQL (when using multiple processors/cores/machines.
>
> Take a look at this test ( http://tweakers.net/reviews/646/1 ). It's
> basically a CPU comparison but usin
I have can generate random data like Alan Boyce suggested, and that
works to a point but as my models evolved I am looking for a more
general way of generate random data so that I don't have to mess with
the random generation section every time I change a model.
I am asking because I am still lea
You can use python. Try:
# Make a random phone number
def mkphone():
import random
phone = ""
for i in range(10):
if (i == 3):
phone += "-"
if (i == 6):
phone += "-"
phone += str(random.randrange(0,9))
return phone
# Based on
http
I did the rename trick, still screw today.
I will change my hosting pay a little bite more for a virtual server
and set up apache + mod_python.
i should have done this since the begining.
On Dec 5, 2:38 am, "Phil" <[EMAIL PROTECTED]> wrote:
> I stumbled across your post via jeffcrot.com and this
I wrote a utility to parse a model files as well as embedded comments
that provided data loading hints. It was trivial to do.
The utility used "cog" to generate a data loading program. That worked
like a charm even as the underlying models evolved. (This approach was
a "win" since the data loadin
You can add "editable=False" to you database model. This prevents it
from showing up in Admin, though of course it can still be edited
directly in the DB.
MerMer
Ross Burton wrote:
> Hi,
>
> Is it possible to have fields in the model that can be set at object
> creation, but are immutable a
There was a very recent post on CAS (Central Authentication System).
The author has written the middeware for Django and is making it
publically available.
I've no idea if there are any differences between CAS and OpenID, but
thought it might be worth a mention.
MerMer
--~--~-~--~~
I was wondering if anybody has any ideas on random generation of data.
I want to fill some of my models with random data with random users and
such. So that I can see how my UI is doing and some other tests. I
figured that becuase there is alot of data defenition in the models
there is probably aw
Also, I commented out all apps in settings.py except the "default"
django ones, and it still happened.
Anyone got any more ideas? I kind of need user admin!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
On 12/6/06 12:00 PM, garyrob wrote:
> Due to Python's global interpreter lock, I assume that Django can't
> take advantage of multiple CPU's. Is that correct? But most high-end
> machines these days come with multiple CPU's.
No, that's not correct; if you're running Django in an approved deployme
My company is buying a new machine to run a Django-based application.
Due to Python's global interpreter lock, I assume that Django can't
take advantage of multiple CPU's. Is that correct? But most high-end
machines these days come with multiple CPU's.
If so, is there any reason we can't amelior
Brilliant, 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 PROTE
Hi -- how can I make the admin interface display images? The default
is to show the link to an image. I know it should be easy but I'm not
sure how to go about doing it.
Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
On 12/6/06 1:48 PM, [EMAIL PROTECTED] wrote:
> I have a model, which has ForeignKey relationship to another model set
> up. How can I output a list of all the objects within the ForeignKey as
> a comma separated list?
>
> For example - the list has 3 objects (a, b, c) - so should output a
> list
On Dec 6, 2:48 pm, "Sarcastic Zombie" <[EMAIL PROTECTED]>
wrote:
> On Dec 5, 3:24 am, "Ross Burton" <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > Is it possible to have fields in the model that can be set at object
> > creation, but are immutable after that? I have an "original estimate"
> > field
On Dec 5, 3:24 am, "Ross Burton" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is it possible to have fields in the model that can be set at object
> creation, but are immutable after that? I have an "original estimate"
> field that should only be set when creating the object, and never
> edited after tha
Hey,
I have a model, which has ForeignKey relationship to another model set
up. How can I output a list of all the objects within the ForeignKey as
a comma separated list?
For example - the list has 3 objects (a, b, c) - so should output a
list like "a, b, c"
How can I do this (in the template)
Flat pages catches a 404 and then looks to see if a flat page exists
for that url
--~--~-~--~~~---~--~~
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
Here's the wget flags I'm using to do something similar:
wget -E --load-cookies /path/to/firefox/profiles/cookies.txt -r -k -l
inf -N -p
-E = use .html as extension
-r = recurse
-k = convert links
-l inf = infinite depth
-N = disable timestamping?
-p = get page requisites
Other than that, I als
Forwarded from the Django dev list in the hopes that future searchers
find this...
The python2.4 email module has a bug which affects Django upload
handling for multipart forms (e.g. forms w/ file uploads).
-- Forwarded message --
From: Jeremy Dunck <[EMAIL PROTECTED]>
Date: Dec
Ah, and you also have to override the .delete() method!
http://groups.google.com/group/django-developers/browse_frm/thread/2caa976249783fae/#
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
T
[EMAIL PROTECTED] wrote:
> I could create a model and then only have one row, but that seems
> clunky.
I did exactly this and overrode the .save() method so that the model
was constrained to only have one row by resetting self.id to 1 in the
.save() (I think...). Effect was that if you added a
[EMAIL PROTECTED] wrote:
> It is a problem. It hits the db if it has to create it.
Sorry I still don't understand :-). You say that you do need
authentication but don't need anonymous sessions. Then in default Django
setup you never hit a database unless you try to store something in
session.
On 12/6/06 9:04 AM, [EMAIL PROTECTED] wrote:
> I'm looking to manage site configuration data through an administrative
> interface, such as changing the header graphic of my site. In my
> pre-Django days I would have loaded a text configuration file's
> contents into form fields, and the save woul
I'm looking to manage site configuration data through an administrative
interface, such as changing the header graphic of my site. In my
pre-Django days I would have loaded a text configuration file's
contents into form fields, and the save would overwrite it.
I could create a model and then only
It is a problem. It hits the db if it has to create it. If i have to
I'll rewrite the library.
On Dec 6, 12:31 pm, Ivan Sagalaev <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > Well we obviously need authentication, we just don't need anonymous
> > session handling.Then it shouldn't be
On 12/6/06 6:32 AM, paulh wrote:
> Using a GenericForeignKey everything seems to work until you try to use
> fields in an Admin class.
That's right - generic relations don't (yet) have the necessary code for admin
interfaces. It'll happen eventually, but for now, sorry!
Jacob
--~--~-~
Hi, yes I looked at Curl but I was looking for a quick 'n' dirty way to
do it, without worrying too much about the options on the command line.
Since I'm coming to Python from Perl, I would also probably choose a
Perl-ish way to do what you're accomplishing with Python modules. But,
whatever :)
C
Using a GenericForeignKey everything seems to work until you try to use
fields in an Admin class. The you get an error like this:
FieldDoesNotExist at /modp/admin/tst2/comnam/add/
Comnam has no field named 'com_obj'
and a python dump.
Just updated by copy of django with the latest dev version and
[EMAIL PROTECTED] je napisal:
> We may test postgreSQL to see if this fixes our latest problem, as our
> SQL cluster isnt setup yet as the hoster didnt have it ready, and this
> is a peak traffic day.
That might be a good idea. It seams that PgSQL scales 200% percent
better than MySQL (when usi
[EMAIL PROTECTED] wrote:
> Well we obviously need authentication, we just don't need anonymous
> session handling.
Then it shouldn't be a problem. Sessions are created and hit db only if
you store something in it. Or if you have SESSION_SAVE_EVERY_REQUEST =
True. Otherwise request.session is ju
Well we obviously need authentication, we just don't need anonymous
session handling.
On Dec 6, 11:31 am, Ivan Sagalaev <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > I'd like a simple option to disable this, any plans to implement
> > something of the sorts?The intended way is to remo
[EMAIL PROTECTED] wrote:
> I'd like a simple option to disable this, any plans to implement
> something of the sorts?
The intended way is to remove SessionMiddleware and those depending on
it (AuthenticationMiddleware) from MIDDLEWARE_CLASSES and
'django.contrib.sessions', 'django.contrib.auth'
Anton Daneika wrote:
> Hello, everyone.
>
> I am trying to call django.views.generic.list_detail.object_list from my
> own view, but I get the error page saying "dict' object has no attribute
> '_clone'"
>
> Here is the function:
> def my_gallery_listing(request, gallery_id):
> d = dict(qu
Hello, everyone.
I am trying to call django.views.generic.list_detail.object_list from my own
view, but I get the error page saying "dict' object has no attribute
'_clone'"
Here is the function:
def my_gallery_listing(request, gallery_id):
d = dict(queryset=Photo.objects.filter(gallery__pk =
I am using Django templates standalone for rendering an
Apache/modpython website (without Django apps). I need to provide
themes for each user: they will have the ability to choose from a set
of themes and when that changes the base template directory needs to
change *for that user only*.
For the
45 matches
Mail list logo