Kai Kuehne wrote:
> models.py:
> def genres_title_list(self, separator=', '):
> return separator.join([x.title for x in self.genres])
If I reconstruct the case correctly and `genres` is a relation to child
objects with ForeignKey to a Movie then `self.genres` by default should
look
Hi,
On 12/3/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote:
> Kai Kuehne wrote:
> [model.py]
>
> If I reconstruct the case correctly and `genres` is a relation to child
> objects with ForeignKey to a Movie then `self.genres` by default should
> look like `self.genre_set.all()`. Otherwise it will rai
I'm stuck at what I think should have been one of the easiest steps of
building my magazines website: the models. :(
I really feel stupid for that, so please tell me the right way to do
this.
This is what I have: Magazines, with many Issues each, and articles,
which belong to only one Magazine, a
So an article can be in more than one issue of a magazine?
My guess is that each article only appears in one issue. If that's the
case, you should only have the issue as a foreign key. The problem there
is that you may be annoyed that the issue is something like "June 2004".
Just override the iss
> So an article can be in more than one issue of a magazine?
Not at all. The Article belongs to only one Issue, which is what I want
the ForeignKey to mean.
I just want to limit the choices of Issues to the ones that make sense,
i.e. to the Issues that belong to the chosen Magazine.
> Just over
If an issue belongs to only one magazine and an article belongs to only
one issue, then including both the magazine and the issue in the article
model is redundant, so if you can avoid it, I would.
On the other hand, I see your point that being able to quickly find the
right issue when you have e
Right, thanks a lot, Todd.
I guess I'm not *that* stupid after all... :) Phew! :D
I think I was actually using the wrong approach to building the
magazines. I mean, they should have been separate apps from the start.
Or else, every freaking article will be in a huge database table that
also house
coulix napisał(a):
> Any idea on how to fix these problems on dreamhost?
I'm not sure if what you're currently experiencing is the same problem
I had few days ago. I did notice zombie processes and my Django app on
Dreamhost was down every now and then. I've solved this problem by
renaming django
Hi,
What's the 'right' way to update the database when you change a model?
For example, when you add a new field?
I initially thought 'manage.py syncdb' would detect and handle this for
you, but it doesn't appear to.
Currently, I'm using MySql to 'DROP TABLE' and then using 'manage.py
syncdb' a
Hi,
I have a django 'files' app that simply maps 'virtual' file names to
physical files for downloading.
Currently, I'm getting the view to return a HttpResponseRedirect to a
'files' area, but I don't like this as it means the files are
'publicly' available and I'd like everything to go through
Thanks for the replies!
Because another IP addr isn't available, I decided to run Lighty on
port 81. I don't need SSL, so that seemed like the best solution, and
it's working well for me.
-Brandon
--~--~-~--~~~---~--~~
You received this message because you are
marksibly wrote:
> I couldn't find a 'HttpResponseStaticFile' class or anything, so what
> other options do I have?
You can pass an open file to a usual HttpResponse:
f = open(filename, 'rb')
return HttpResponse(f, mimetype='application/octet-stream')
> Also, how efficient would it be
Hi,
Thanks for that!
Another option I've found is to use mod_python's 'sendfile()' method in
req.
However, I'm having a problem using Django within a 'plain' mod_python
handler - I get the 'DJANGO_SETTINGS_MODULE' not found error as soon as
I try to import my models.
I've copied the apache co
Found it in the FAQ;
[quote]
If you're using mod_python but not using Django's request handler,
you'll need to work around a mod_python bug related to the use of
SetEnv; before you import anything from Django you'll need to do the
following:
os.environ.update(req.subprocess_env)
[/quote]
--~--~
marksibly wrote:
> Found it in the FAQ;
> [quote]
> If you're using mod_python but not using Django's request handler,
> you'll need to work around a mod_python bug related to the use of
> SetEnv; before you import anything from Django you'll need to do the
> following:
>
> os.environ.update(req.s
Jakub Labath wrote:
> Hi All,
>
> Sorry for being quiet for a while just got back from a vacation.
>
> >
> > Hi Jakub,
> >
> > Do you have any updates on this problem? Was it a mod_python bug?
> >
> > Adrian
> >
>
> No the problem persists and I noticed that my coworkers have not
> resolved this
Hi,
I am currently developing a small Django application for my personal use.
Now I like to have a date based archive page, and I thought that this
finally is a good thing to look into generic views. My requirements are,
that I can display the actually database item on the page and in a side bar
a
On 12/4/06, marksibly <[EMAIL PROTECTED]> wrote:
>
>
> I initially thought 'manage.py syncdb' would detect and handle this for
> you, but it doesn't appear to.
No - Syncdb will add any completely new model, but will not alter any
existing model.
The behaviour you are seeking is under development
I just got fed up and fired Dreamhost. They're FCGI implementation is
just too flakey for a production site.
To their credit, they try to warn people about using Django, but being
on the list of friendly hosts and kinda-sorta supporting it give
another impression.
Personally, I think they should
Btw I found the problem ...
details are here
http://wolfram.kriesing.de/blog/index.php/2006/multithreading-with-mysqldb-and-weakrefs
On 12/2/06, Wolfram Kriesing <[EMAIL PROTECTED]> wrote:
> django/db/__init__.py contains
> dispatcher.connect(connection.close, signal=signals.request_finished)
>
>
I have a problem with generic.list_detail.object_list, a limiting
queryset, and pagination variables.
For some reason when I use the code below, results are restricted to
the sliced 100, but all the pagination variables show results as if the
slice wasn't there.
Example:
{{ pages }} = 12 (not t
Hi,
I need to hide referrer url on HttpResponseRedirect. I was expecting to
find something like ReferrerURL in HttpResponseRedirect.headers, but
did not. I was hopping to change the header information right before
HttpResponseRedirect sends the user to the other server to hide the
referrer URL, o
We're trying to launch our Django site, and we're coming into severe
load issues.
The site right now has 2 SQL servers, clustered, and 3 web servers all
running with 4 cores and 4 gigs of memory.
Our biggest problem is everything seems ok on the development site,
load times are ok, the SQL queri
There are my two models:
class Messages(models.Model):
sender = models.ForeignKey(UserProfile)
to = models.ForeignKey(UserProfile)
body = models.TextField()
sent_date = models.DateTimeField()
class UserProfile(models.Model):
contactlist = models.ManyToMa
I have a custom manipulator and I am trying to set the checkbox default
to checked.
For example, my field name is:
forms.CheckboxField(field_name="current"),
Not sure how you to do it. I tried putting the attribute after the
field name which did not work.
I also tried right before the formwrap
Hi All,
I'm creating an application to track field-trial results for hounds.
Does anyone know of an easy way to edit multiple related tables inline
on one form in the Admin app?
Ideally, I want the hound "Groupings" edited inline with trials (which
works as expected), but I also want the "Standi
Hello All. I read django documentation about forms, had seek internet
and didn't found solution for situation like this: I have order form
divided to 3 steeps, after every step should be validation and if
validation is succesfull, user can fill form for next-step. Form for
every step doesn't map
hi guys
i have added a few viral features such as email friends, refer, share
item etc...
but the problem is the email gets delivered to bulk folder by gym...
please tell me how to ensure that emails dont get delivered to bulk
folder
thanks
John
--~--~-~--~~~---~--~-
I am trying to set the checkboxfield default value to checked but not
sure how you do it.
Here is my formfield for the checkbox
forms.CheckboxField(field_name="current"),
I tried ading checked="checked" but that did not work.
Thanks,
Jeff
--~--~-~--~~~---~--~~
Hello,
For interested people, I have wrapped the WSGI CherryPy server to be
used with Django. With the same wrapper you can start several django
projects (one cherrypy instance per project) with a configuration file
for each project. You can ask it to serve the Django admin media files
or not, it
Hi,
Is there a way to use regular home-spun python models in such a
way that they'll relate with Django's ORM models?
What I'd like to do is something like this:
class MyDay:
def __init__(self, date):
self.id = date.toordinal()
On 12/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Of course, I could just run out 10 years worth of days in a
> database table to get the same effect, but that seems like a kludge. As
> does every other method of tackling this particular problem that I've
> been able to come up w
Russ,
Because it seems like the cleanest way of pulling together a wide
variety of content that all pertains to a particular day, or list of
days.
The alternative, it seems to me, is running seperate queries on
Concerts, Meetings, DrinkSpecials, BallGames, etc., then passing all of
On 12/3/06, John <[EMAIL PROTECTED]> wrote:
> but the problem is the email gets delivered to bulk folder by gym...
> please tell me how to ensure that emails dont get delivered to bulk
> folder
There isn't, really. Whether an email provider filters your messages
into a user's "bulk" or "spam" fol
The other part, which I forgot to mention, is that I'd like to be
able to have an easy many-to-many relationship between days and, say,
meetings. A particular meeting can happen every other Tuesday, and it
seems a waste to have to enter a new record for it twice a month.
Hank
--~--~-
On 12/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Russ,
>
> Because it seems like the cleanest way of pulling together a wide
> variety of content that all pertains to a particular day, or list of
> days.
> The alternative, it seems to me, is running seperate queries on
On 12/4/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> The other part, which I forgot to mention, is that I'd like to be
> able to have an easy many-to-many relationship between days and, say,
> meetings. A particular meeting can happen every other Tuesday, and it
> seems a waste to h
> context = TemplateContext(
> dict([('todays'+model.name, model.objects.filter(date=date.today())) for
> model in [Concerts, Meetings]])
That's some awesome smart list-comprehension mojo, and I'll
definitely be ripping it off.
But I guess it doesn't quite answer my wish for a many-
We're driving right past each other on the information
superhighway.
Thanks for your advice, Russ. It still seems to me that a
many-to-many relationship between days and events would be desirable,
for the same reasons that all many-to-many relationships are desirable.
In my case, I
On 12/2/06 6:01 PM, Siah wrote:
> How can I accomplish that?
You can't; the Referer header gets set by the browser, not by the web server.
Jacob
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group
On Dec 1, 1:31 pm, Ivan Sagalaev <[EMAIL PROTECTED]> wrote:
> To not invent an artificial example could you describe your task in more
> detail?
Sure,
I have a long application form for a workshop (name, employment,
resume, ... 65 fields). The user logs in to the site via
django.contrib.auth.vi
41 matches
Mail list logo