> I also get an error when I try 'parent.name'.
Try just 'parent'. It will display whatever is coming out of your
model by default (in the __str__() or __unicode__() method). That will
probably do it for you, but you can access the other information if
you write a method for it:
class
On Wed, 2008-04-23 at 22:30 -0700, jonknee wrote:
> I have four models that I want to combine into one report. The manual
> SQL is pretty easy, three INNER JOINS. I just can't figure out how to
> get the ORM to do it. I'm using the auth app with a custom profile
> model and that seems to be the
On Wed, 2008-04-23 at 22:19 -0700, Tim Saylor wrote:
> I have two columns in my database that must be, as a pair, unique
> throughout all the rows. Googling tells me I want a two column unique
> index. From the docs it looks like unique_together is what I want,
> but that looks like it makes
I have two columns in my database that must be, as a pair, unique
throughout all the rows. Googling tells me I want a two column unique
index. From the docs it looks like unique_together is what I want,
but that looks like it makes the two columns unique from each other
within the row. Is
On Wed, 2008-04-23 at 11:49 -0700, kalve wrote:
> Hi,
>
> I have got a Person model, and I need create a spouse field.
>
> When editing Jane, I need to be able to John as her spouse. Jane
> cannot have more than one spouse, and only one person can have Jane as
> spouse. The relation needs to
On Wed, 2008-04-23 at 17:18 +0200, Thomas Guettler wrote:
> Malcolm Tredinnick schrieb:
> > On Wed, 2008-04-23 at 15:37 +0200, Thomas Guettler wrote:
> >
> >> Hi,
> >>
> >> has some one a script to show the difference between the
> >> running database and one which get created by syncdb?
> >>
replying to myself
On 23-Apr-08, at 2:28 PM, Kenneth Gonsalves wrote:
> class Ingredientrecform(forms.ModelForm):
> """
> Form to add Ingredients.
> """
> def __init__(self,pageid, *args, **kwargs):
> super(Ingredientrecform, self).__init__(*args, **kwargs)
>
Rodney Topor wrote:
Is there something strange about using CSS with Django? When I make
my templates refer to external CSS files, the appearance of the
template changes, but not the way the CSS file says it should? Is
there something special I need to know about this?
Nothing that I am aware
I believe you need to go to the 'settings' page and enter a name and
email address first.
Cheers
-D
Tyler Erickson wrote:
What do I need to do to edit the following page?
http://code.djangoproject.com/wiki/GeoDjango
It lets me enter edit mode and preview the changes, but when I try to
submit
Is there something strange about using CSS with Django? When I make
my templates refer to external CSS files, the appearance of the
template changes, but not the way the CSS file says it should? Is
there something special I need to know about this?
What do I need to do to edit the following page?
http://code.djangoproject.com/wiki/GeoDjango
It lets me enter edit mode and preview the changes, but when I try to
submit the change I get:
"500 Internal Server Error (Submission rejected as potential spam)"
Awesome. Thanks for clearing that up for me.
On Apr 22, 4:12 pm, Michael <[EMAIL PROTECTED]> wrote:
> Thanks. It was something in your models.
>
> Django can't just magically figure out what url you want besed on the same
> function. Look at the way that you return the get_absolute_url:
>
> def
Gotcha, sorry about that, didn't quite get what was being asked. You can do
a full text search in your database or implement some external software for
search. Also if you have a field that you want items to be alike for you can
always bounce off the database for items like that.
I have
Apparently the design can be done before the dash:
This is pretty straightforward. Your team’s hands stay off the
keyboard until the Dash officially begins. You’re allowed paper
mockups and design but no code.
Now, wether that design can be done be someone that's not part of the
core team, I
On Apr 23, 10:29 pm, Jay <[EMAIL PROTECTED]> wrote:
> In the django docs I see that you can easily make a foreign key by
> referencing the model:
>
> manufacturer = models.ForeignKey('production.Manufacturer')
>
> ...but it feels like maybe stepping outside the "django way."
You can also just
I was thinking along the same lines-- it's more of a single, big app
than a bunch of portables. And I was worried about models.py becoming
too unwieldy. Thanks a lot!
On Apr 23, 4:38 pm, "Erik Vorhes" <[EMAIL PROTECTED]> wrote:
> There's nothing wrong with parceling out models across different
On Apr 24, 12:57 am, Rufman <[EMAIL PROTECTED]> wrote:
> Hey
>
> I was wondering: Is Django faster and stabler using mod_python or
> fcgi?
>
> I read that mod_python can be a memory hog...what are the concrete
> advantages of using fcgi or mod_python for that matter?
That mod_python can be a
On Wed, Apr 23, 2008 at 6:59 PM, falcon <[EMAIL PROTECTED]> wrote:
> 94. if (context.autoescape and not isinstance(output,
> SafeData)) or isinstance(output, EscapeData):
Right there's your problem. you've ended up passing a plain dictionary
someplace where Django was expecting you to
On Wed, Apr 23, 2008 at 11:09 AM, Don Spaulding
<[EMAIL PROTECTED]> wrote:
>
>
>
> On Apr 22, 11:24 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>
> > On Tue, 2008-04-22 at 13:47 -0700, Don Spaulding wrote:
> >
> > [...]
> >
> > > I try to do something like this:
> >
> > > order =
Hi,
A year or two ago I created a small web application in django. I've
now brought it out of retirement and am trying to get it up and
running with the latest svn trunk code. I realize there have been
many changes to django in the mean time, however, the error I am
getting just doesn't make
I'm a bit concern about that. my main development team is composed of
3 people one back one designer and one that takes care the the first
two not killing each other. looking at the ratings it seems that if we
take one of our 3 people out then we'll lose many points. and chance
to get 3? maybe by
How about this:
Set your model's user field so editable=False
Sub-class ModelAdmin
Override its `save_add` method, setting form.data['user'] =
request.user then calling the super method
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
> I'm experimenting (so far without success) with a bunch of ways to try
> to turn a chain into a queryset. If anybody has any tips, I will be
> grateful.
Ok, got it, I think - using the idiom from this snippet:
http://www.djangosnippets.org/snippets/26/
(My problem was using the chain to
On Apr 23, 8:32 pm, Michael <[EMAIL PROTECTED]> wrote:
> If you have auth and sessions working right in Django you can access a
> logged in user from the request (request.user) and user in auth if you have
> AUTH_PROFILE_MODULE [1] in your settings you can get the profile from the
thanks for
.96 is not unicode enabled, if you need to handle unicode strings you
will need to use SVN.
On Apr 23, 4:23 pm, "Boris Ozegovic" <[EMAIL PROTECTED]> wrote:
> On 4/23/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > Are you using .96 or SVN?
>
> 0.96
On 4/23/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Are you using .96 or SVN?
0.96
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Are you using .96 or SVN?
On Apr 23, 3:56 pm, "Boris Ozegovic" <[EMAIL PROTECTED]> wrote:
> I am getting UnicodeDecodeError, 'ascii' codec can't decode byte 0xc4.
> I using utf-8 in forms.py, and also, my template is saved as UTF-8.
> And it doesn't work. Any ideas?
>
> This is part of my
I am getting UnicodeDecodeError, 'ascii' codec can't decode byte 0xc4.
I using utf-8 in forms.py, and also, my template is saved as UTF-8.
And it doesn't work. Any ideas?
This is part of my forms.py
--
# -*- coding: utf-8 -*-
CHOICES1 = (
('child', 'Dječja'),
There's nothing wrong with parceling out models across different apps.
And unless you're planning on distributing each app separately, don't
worry about cross-app dependencies.
In this case, I'd encourage you to--since you'll probably want to do
more than just book-related stuff with your
As above, I have this working now.
Any suggestions on wrapping individual items in items from a
multivaluefield in tds?
Thanks.
-jsnyder
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
I'm working on a project which for the purposes of this conversation
we could say is about authors writing and sharing books.
My tendency is to want to make an app called "people" and an app
called "books," as these are two different models in my mind. A
person has certain attributes which
This fixed it!
http://peeved.org/blog/2007/11/20/
By adding this line after 'import ldap', I was able to search from the
root level without specifying an OU:
ldap.set_option(ldap.OPT_REFERRALS, 0)
--~--~-~--~~~---~--~~
You received this message because you are
Hi,
I have got a Person model, and I need create a spouse field.
When editing Jane, I need to be able to John as her spouse. Jane
cannot have more than one spouse, and only one person can have Jane as
spouse. The relation needs to be symmetrical.
I have tried both ManyToOne and ForeignKey, but
Hi,
I'm wondering if the following is possible with django templates. I
would like to override a given parent block, while maintaining the
contents of it's child block:
base.html:
{% block firstblock %}
Bla bla bla
{% block secondblock %} ble ble ble {% endblock %}
{% endblock %}
If you have auth and sessions working right in Django you can access a
logged in user from the request (request.user) and user in auth if you have
AUTH_PROFILE_MODULE [1] in your settings you can get the profile from the
user with the function get_profile()
[1]
Nice one! That's better than implementing a new field because I am
using FilePathField in one model only
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
And you don't even need to import os there (oops)
On Wed, Apr 23, 2008 at 1:53 PM, Michael <[EMAIL PROTECTED]> wrote:
> Add this to your model:
>
> def get_FILE_url(self):
> import os
> from django.conf import settings
> return '/' + str(self.FILE).split(settings.MEDIA_ROOT)[-1]
>
Add this to your model:
def get_FILE_url(self):
import os
from django.conf import settings
return '/' + str(self.FILE).split(settings.MEDIA_ROOT)[-1]
tadah you have your method without rewriting django fields
On Wed, Apr 23, 2008 at 1:22 PM, [EMAIL PROTECTED] <
[EMAIL
[EMAIL PROTECTED] wrote:
Hello All,
I've been working on a quality control portal that uses some features
of django. The application is now completely running but the upload of
large data files is quit slow. I've been looking around how to speed
things up and the only thing i saw was using ftp
i was wondering if there is django related solution for searching/
checking if user (django.contrib.auth + profile) exists or to retrieve
similar results?
so if i have:
search_for = request.POST['search_for']
do i split search_for and basically do sql LIKE search through table
fields or is
You could either do that, or just add a method to your model, both
would employ the same logic, it's just a question of reusable vs. time
to implement.
On Apr 23, 12:17 pm, skam <[EMAIL PROTECTED]> wrote:
> Okay, that's a valid reason, but I really want these files to be into
> MEDIA_ROOT and
Okay, that's a valid reason, but I really want these files to be into
MEDIA_ROOT and get file's absolute url using a get_FIELD_url method.
Is subclassing the field and implementing contribute_to_class method a
good idea?
On 23 Apr, 18:47, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
>
FilePathField can refer to any location on your system, there is no
reason to believe it is below the MEDIA_ROOT.
On Apr 23, 11:14 am, skam <[EMAIL PROTECTED]> wrote:
> It seems that get_FIELD_url accessor method is not available while
> using FilePathField into my models.
> Is there any reason
It seems that get_FIELD_url accessor method is not available while
using FilePathField into my models.
Is there any reason why it hasn't been implemented?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
I am implementing an academic publications database, and am looking
for a search solution.
I need at the very least Stemming and Accented Characters support
(i.e.: searching for "alvarez" returns "álvarez" and v.v.).
Some of the fields have a tinymce editor, so the data is stored with
html
On Thu, 24 Apr 2008 00:11:02 +1000, "Malcolm Tredinnick"
<[EMAIL PROTECTED]> said:
> Another possibility is to use some sort of queueing system or service so
> that the emails are inserted into the queue and then sent over an
> extended period of time.
django-mailer is intended to be used for
I haven't send near 8000 messages yet, but what I did was a
combination of what Malcom suggested. I setup a model to queue the
messages (pickled email.MIMEMultipart) with a priority, and a cron
that runs occasionally to dump N messages per mx domain over time so
the mailing trickles out. to the
Yes. That's including a designer. I base this on his mention of the team
sketching out the site design.
-justin
On Wed, Apr 23, 2008 at 11:25 AM, Eric <[EMAIL PROTECTED]> wrote:
>
> I see that you can have a team of two, does that include a designer?
>
> On Apr 14, 2:31 pm, "[EMAIL PROTECTED]"
I see that you can have a team of two, does that include a designer?
On Apr 14, 2:31 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Jonathan,
>
> I consider those to be utility libraries (unlikely to comprise your
> entire app) and should be fine for use. You may want to document what
>
> > (1) What geographic fields are in your model, what type are they
> > (e.g., PointField, etc.), and their SRID.
>
> A plain PointField, e.g.: ``location = PointField()``. I
> believeGeoDjangodefaults to WGS84 for the SRID.
>
> > (2) The geometry type of the parameter you're passing to
On Apr 23, 9:00 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> Complex Q-object combinations on trunk do have a few problems (bugs). It
> turns out to be quite hard to get all the combinations working
> correctly. This is one of the areas that development of the
> queryset-refactor branch
Malcolm Tredinnick schrieb:
> On Wed, 2008-04-23 at 15:37 +0200, Thomas Guettler wrote:
>
>> Hi,
>>
>> has some one a script to show the difference between the
>> running database and one which get created by syncdb?
>>
>>
>>
> This sounds like it would be really difficult (complex) to
Hey
I was wondering: Is Django faster and stabler using mod_python or
fcgi?
I read that mod_python can be a memory hog...what are the concrete
advantages of using fcgi or mod_python for that matter?
any ideas/tips, thanks
Stephane
--~--~-~--~~~---~--~~
You
This will get you started. The JS and the views needed are pretty
easy.
http://www.willarson.com/blog/?p=37
On Apr 23, 8:42 am, laspal <[EMAIL PROTECTED]> wrote:
> Hi,
> I have a form with the following field.
>
> 1)Title
> 2)Descriptions
> 3) No of person
> 3) Drop down box containing the
On Wed, 2008-04-23 at 07:03 -0700, gorans wrote:
> Hi,
>
> I've been sending out email to a list of around 8000 people on a
> monthly basis using django and was wondering whether there is a way to
> optimise the process.
>
> Currently, I open a mail connection [ mail_connection =
>
On Wed, 2008-04-23 at 06:51 -0700, sector119 wrote:
> Hi All
>
> Can I save m2m fields using MyModel.objects.create(**kwargs) ? If
> kwargs contains 'm2m_field': [Ob1, Obj2, Obj3].
No. You need to save an object before it can be used in a many-to-many
relation and create() is just a synonym
I'm not clear how it could be. Could you please explain it in detail?
Many thanks!
/BRs
On Apr 23, 1:34 pm, "Eric Liu" <[EMAIL PROTECTED]> wrote:
> Why don't you set 'images/' as a variant.then you can change it dynamically
>
> 2008/4/23, Rishabh Manocha <[EMAIL PROTECTED]>:
>
>
>
> > Yea, I
On Wed, 2008-04-23 at 15:37 +0200, Thomas Guettler wrote:
> Hi,
>
> has some one a script to show the difference between the
> running database and one which get created by syncdb?
>
> Up to now, I used the output of sqlall before and after
> a model change. But it would be better to do the
>
On Wed, 2008-04-23 at 15:06 +0200, Thomas Guettler wrote:
> Hi,
>
> if one unittest fails at the database level, often all following tests
> fail with this error:
>execute SQL failed: current transaction is aborted, commands ignored
> until end of transaction block
It's something that
On Wed, 2008-04-23 at 06:03 -0700, bobhaugen wrote:
> Replying to myself with more clues:
>
> I see the problem:
>
> For this filter statement:
> items = InventoryItem.objects.filter(
> Q(inventory_date__range=(weekstart, thisdate), received__exact=0)
> |
> Q(onhand__gt=0))
>
>
Panos,
Thanks for the links. I checked the conversation and the blog post, by
they address issues I've already solved. What I'm really struggling
with is the reverse() problem and how to cleanly move the language
activation logic from middleware (Django's default mechanism) to the
URL resolver.
Hi All
Can I save m2m fields using MyModel.objects.create(**kwargs) ? If
kwargs contains 'm2m_field': [Ob1, Obj2, Obj3].
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
Hi,
has some one a script to show the difference between the
running database and one which get created by syncdb?
Up to now, I used the output of sqlall before and after
a model change. But it would be better to do the
diff of the running database.
Up to now I do it like this:
pg_dump -s
Andrew,
Thanks for your thoughts!
> If the content is ultimately the same and you're simply offering
> translations you don't want to put the language code before the
> resource in the URL. Ie you don't want /fi/second/example/ because the
> hierarchy implies that for a different country it's
I think the key here is the fact that Django is very scalable. When
something starts going wrong with your system, Django has the tools
available to figure out where the bottle necks are and it is quite simple.
In the past I have hit bottlenecks with mod_python. That was easy to fix by
switching
Hi,
if one unittest fails at the database level, often all following tests
fail with this error:
execute SQL failed: current transaction is aborted, commands ignored
until end of transaction block
Is there a way to stop after the first failing test?
Thomas
--
Thomas Guettler,
Replying to myself with more clues:
I see the problem:
For this filter statement:
items = InventoryItem.objects.filter(
Q(inventory_date__range=(weekstart, thisdate), received__exact=0)
|
Q(onhand__gt=0))
,,, the SQL generated looks like this:
SELECT
On Wed, Apr 23, 2008 at 6:04 AM, bcurtu <[EMAIL PROTECTED]> wrote:
>
>
> But, turning back to my question... Can you tell these sites with
> thousands or hundreds of thousands hits per minute? Ok, let's leave
> apart their stats... Any big name on the internet? slashdot? twitter
> is RoR...
>
I
You can also have a look at www.djangosites.org , it lists some sites
running django. Revver (www.revver.com), a video-sharing site is one
of them.
On Wed, Apr 23, 2008 at 12:23 PM, Kenneth Gonsalves
<[EMAIL PROTECTED]> wrote:
>
>
> On 23-Apr-08, at 3:34 PM, bcurtu wrote:
>
> > But, turning back
> I had my project in an apache directory so maybe it has something to
> do with permissions.
Quoted from the Django Tutorial:
If your background is in PHP, you’re probably used to putting code
under the Web server’s document root (in a place such as /var/www).
With Django, you don’t do that.
I'm trying to retrieve all Inventory Items whose onhand quantity is
greater than zero, OR (whose date is within a specified range AND
whose received quantity is zero).
InventoryItems have three relevant fields for this query: onhand,
inventory_date, and received.
I currently have only 2
> There's nothing in the queryset-refactor branch that's really "work in
> progress" any longer (at least not committed to the tree). So please
> open a ticket with a short example so that this doesn't get forgotten.
Thanks Malcolm - I've opened a ticket for it now (number #7070).
Regards,
Matt
Hello All,
I've been working on a quality control portal that uses some features
of django. The application is now completely running but the upload of
large data files is quit slow. I've been looking around how to speed
things up and the only thing i saw was using ftp upload instead of the
http
andy baxter wrote:
> you want a tag that would let you write an include file like:
>
> {% for category in categorybranch %}
>
sorry that should be {% for category in categorybranch.sub_cats %}
> (print category name here)
> {% include "self.html" with categorybranch=category %}
> {% for
On 23-Apr-08, at 3:34 PM, bcurtu wrote:
> But, turning back to my question... Can you tell these sites with
> thousands or hundreds of thousands hits per minute? Ok, let's leave
> apart their stats... Any big name on the internet? slashdot? twitter
> is RoR...
you could take a look at the
2008/4/23 bcurtu <[EMAIL PROTECTED]>:
> But, turning back to my question... Can you tell these sites with
> thousands or hundreds of thousands hits per minute? Ok, let's leave
> apart their stats... Any big name on the internet? slashdot? twitter
> is RoR...
Pownce (http://pownce.com/) is
Malcom, you're right in many points... I'm trying to identify the
possible bottle-necks of the system, and hopefully, if we follow the
"share nothing" architecture and the best practices I won't have many
problems. The site is not that complex, the only point of danger could
be a recommendation
On Wed, 2008-04-23 at 02:13 -0700, bcurtu wrote:
> May you enumerate the largest django sites (apart from WSJ)? Do you
> know traffic stats of these sites? I'm building a big site, with
> potentially lots of traffic and I'm a bit afraid what I can expect...
There are at least two problems with
I was reading this page
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
and was wondering how the advice on avoiding the hack applied to my
own use case.
I am using the ThreadLocals hack to get the current user in a model
when overriding the save() method. Therefore I can't pass
May you enumerate the largest django sites (apart from WSJ)? Do you
know traffic stats of these sites? I'm building a big site, with
potentially lots of traffic and I'm a bit afraid what I can expect...
Thanks
--~--~-~--~~~---~--~~
You received this message
hi,
this is my code snippet:
class Ingredientrecform(forms.ModelForm):
"""
Form to add Ingredients.
"""
def __init__(self,pageid, *args, **kwargs):
super(Ingredientrecform, self).__init__(*args, **kwargs)
self.pageid = pageid
ingredient
On 23-Apr-08, at 1:12 PM, laspal wrote:
> So my question is does django gives any tool for this or do I have to
> write java script for it..???
you will have to write javascript for it
--
regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/code/
Hi,
I have a form with the following field.
1)Title
2)Descriptions
3) No of person
3) Drop down box containing the previous filled form title..
Now my question is how to auto fill the form field when a user choose
any title from the drop down box.
I am doing that so that user can choose any
83 matches
Mail list logo