I think you would either have to assign the antenna's phone:
antenna.phone = phone
or refetch the antenna from the database so Django creates the object
with the newly-created reference. The antenna you are looking at is
only coming from memory when you do antenna.phone, not from the
database. Y
Hi,
I have two models in a one-to-one relationship: Phone and Antenna.
In other words, within the Phone class I have this field:
antenna = models.OneToOneField(Antenna, related_name='phone')
What I want to do, given a specific antenna, is to delete its phone
and add a different phone:
antenna.
Keith Eberle wrote:
>Maybe you can do something similar to what's in this post (using queryset):
>http://groups.google.com/
>
>
> group/django-users/browse_thread/thread/c59b3807631d2914/a07cabfb4725447d?lnk=gst&q=restrict+users+to+their+own+data#a07cabfb4725447d
It is valid, tested and working
[EMAIL PROTECTED] wrote:
> OK, I'm new to Django and this is probably making a silly mistake but,
> to me the admin.site.register(Tag) line should appear at the bottom of
> the Tags model. If this is done Django will not syncdb or runserver
> because it thinks "Tag" has been registered more than o
OK, I'm new to Django and this is probably making a silly mistake but,
to me the admin.site.register(Tag) line should appear at the bottom of
the Tags model. If this is done Django will not syncdb or runserver
because it thinks "Tag" has been registered more than once. However,
if you put the admi
Hrm I have this working now, got lucky with a google and found a
django bug that had the info I needed to start. So am now using:
appt4.models import Tag
But am now actually experiencing the bug which is thought to be fixed.
I'm using Django 1.0: http://code.djangoproject.com/ticket/6776
Whilst
Hello,
I have 3 apps. When records are saved to each app I want to associate
tags to the records. In order for each app to access the same tags I
think I would need a Tag app. Is it possible for models in different
apps to access models in another ?
So..
App1
class m1(models.Model):
tag = model
On Sun, Sep 14, 2008 at 7:24 AM, Martin Diers <[EMAIL PROTECTED]> wrote:
>
> On Sep 6, 2008, at 11:36 AM, Posi wrote:
>>
>> Still though, how tied are we to a true relational model and how does
>> that tie to a column based DB.
>
> So utterly and completely, that if you wished to use HBase, there
On Sep 6, 2008, at 11:36 AM, Posi wrote:
>
> Still though, how tied are we to a true relational model and how does
> that tie to a column based DB.
So utterly and completely, that if you wished to use HBase, there
would be no possible way to integrate in into the current ORM. In
fact, the on
> What's the best way to use MEDIA_URL in a CSS file. For example, right
> now my CSS file has something like:
>
> body {
> background: transparent url('/media/images/bg.gif') repeat;
> }
>
> I would like to use MEDIA_URL instead of /media/ (in a number of
> places), but other than that the fi
You should instead simply use relative URLs to images in CSS files.
Style sheets and images are (normally) always at the same location
relative to each other so nothing will break if you change their
location. Of course if your images are in a different domain than your
style sheets, that'
What's the best way to use MEDIA_URL in a CSS file. For example, right
now my CSS file has something like:
body {
background: transparent url('/media/images/bg.gif') repeat;
}
I would like to use MEDIA_URL instead of /media/ (in a number of
places), but other than that the file is static. What
Sorry, must have forgotton that part, it just wasn't displaying
anything,
its was cos I was archive.datetime, when archive was already a dateime
object.
Now I've changed it to {{ archive }} its fine.
Thanks guys,
Andrew
--~--~-~--~~~---~--~~
You received this mes
Thanks for the quick reply.
I reinstalled Django using 'python setup.py install' and the problem
has disappeared. Previously I installed Django by running 'python
setup.py build' and then manually copying the Django directory created
under the build/ directory to another directory in my Python p
On Sep 13, 10:49 pm, djandrow <[EMAIL PROTECTED]> wrote:
> This is probably really really obvious. I have the following statement
> in my views.py:
>
> archive_list = Entry.objects.dates('entry_date', 'month',
> order='DESC')
>
> then I have;
>
> {% for archive in archive_list %}
>
> {{ archive.da
On Sat, Sep 13, 2008 at 11:49 PM, djandrow <[EMAIL PROTECTED]> wrote:
>
> This is probably really really obvious. I have the following statement
> in my views.py:
>
> archive_list = Entry.objects.dates('entry_date', 'month',
> order='DESC')
>
> then I have;
>
> {% for archive in archive_list %}
>
This is probably really really obvious. I have the following statement
in my views.py:
archive_list = Entry.objects.dates('entry_date', 'month',
order='DESC')
then I have;
{% for archive in archive_list %}
{{ archive.datetime }}
{% endfor %}
in my template, i am 99.9% my problem is with {{ a
On Sep 13, 10:56 am, Gerard Petersen <[EMAIL PROTECTED]> wrote:
> Daniel,
>
> > If you want a field that's populated with values from another model,
> > you should use a ForeignKey.
>
> Is it then still possible to use filters and such, and keep it in the model
> logic?
>
> Because the Meta model
Hi Mario,
> DATABASE_HOST ="http://192.168.1.128";
DATABASE_HOST must contain a hostname or IP address, not an URL. You
should remove the "http://"; part and check that the IP address is
correct and reachable.
- Sander
--~--~-~--~~~---~--~~
You received thi
On Sat, Sep 13, 2008 at 11:12 PM, shaunc <[EMAIL PROTECTED]> wrote:
>
> umm... but that's not exactly according to "D.R.Y." :) -- but thanks.
>
It's good to try to follow DRY, but it's not the solution for everything. Django
is a tool box, not a CMS with everything included. Sometimes it's better
umm... but that's not exactly according to "D.R.Y." :) -- but thanks.
On Sep 13, 3:36 pm, "Matthias Kestenholz" <[EMAIL PROTECTED]> wrote:
> On Sat, Sep 13, 2008 at 9:33 PM, shaunc <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > Does anyone know how to set the content type when serving a page via
>
Building on Marcelo's response, and an example from James Bennett's book (Ch
5), you could also add a custom manager. It'd go something like this:
class PublishedEntryManager(models.Manager):
def get_query_set(self):
return super(PublishedEntryManager,
self).get_query_set().filter(pub_date_
On Sat, Sep 13, 2008 at 9:33 PM, shaunc <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> Does anyone know how to set the content type when serving a page via
> FlatPages?
>
You have to write your own middleware or view function. This is
easy enough since you can copy the flatpages view and middleware
co
Hello,
Does anyone know how to set the content type when serving a page via
FlatPages?
Thanks,
- Shaun
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djan
On Sep 13, 2008, at 12:46 PM, Thejaswi Puthraya wrote:
>
> On Sep 12, 7:09 pm, Eric Abrahamsen <[EMAIL PROTECTED]> wrote:
>> Has anyone tried using akismet with the new comments contrib app?
>> I've
>> set up a signal handler to run on 'comment_will_be_posted' and check
>> the comment with akis
Mario wrote:
[some stuff which I have again moved to the bottom where it belongs]
> On Sep 13, 12:46 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
>> Ross wrote:
>> [some stuff you can now find after the question]
>>> On Sep 13, 9:37 am, Mario <[EMAIL PROTECTED]> wrote:
Hello,
I would like
Yep, you'll have some overlap, but I think it makes sense to create a
separate app wherever the data model/views could logically stand
alone. So, user registration would be one app. I'm working on a
project that does a lot with demographic data based on user profiles,
so profiles is another sep
Thank you for responding so quickly, but the question hasn't been
answered.
Assuming there are firewalls layered between the DMZ and the private
network and the routing table has been setup correctly;
what do I need to do to forward the http request to my remote
database.
Do I modify my settings.
I'm a little confuse as to when to create an app.
I'm trying to create a survey project. Is user registration an app on
its own, the part where the person login/register?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google G
Keith Eberle wrote:
>Maybe you can do something similar to what's in this post (using queryset):
>http://groups.google.com/group/django-users/browse_thread/thread/c59b3807631d2914/a07cabfb4725447d?lnk=gst&q=restrict+users+to+their+own+data#a07cabfb4725447d
Is that still valid? I can find no docu
Ross wrote:
[some stuff you can now find after the question]
> On Sep 13, 9:37 am, Mario <[EMAIL PROTECTED]> wrote:
>> Hello,
>>
>> I would like to move off the existing database server off Django.
>> Currently, my settings.py file include the following configuration:
>>
>> DATABASE_ENGINE = 'mysq
http://docs.djangoproject.com/en/dev/ref/databases/#connecting-to-the-database
Putting your database in the DMZ is probably a very bad idea... You
don't want to give the entire internet access to your database. The
standard Django setup expects your database to be accessible on the
same local net
Hi,
finally I decided to (re)start blogging. As it's django based (actually runs
on byteflow) I thought I will present it here.
Besides django - as it was already told - I use byteflow [1], plus
django-contact-form [2] and my own postimage [1] app.
If you are interested in posts on standard sett
That will definitely do the trick, but the idea of APPEND_SLASH from
what I understand is 'http://www.last.fm/music/Goo+Goo+Dolls/' and
'http://www.last.fm/music/Goo+Goo+Dolls' (with and without the
trailing slash) are considered different URLs. Appending the slash
normalizes all your URLs to alwa
You might want to give a shot with 'add_to_builtins':
http://blog.michaeltrier.com/2007/8/7/common-template-tags
On Sep 13, 11:05 am, akonsu <[EMAIL PROTECTED]> wrote:
> hello,
>
> is there a way to make my custom tags and filters available to a
> template that i create from a string like this:
>
Maybe you can do something similar to what's in this post (using queryset):
http://groups.google.com/group/django-users/browse_thread/thread/c59b3807631d2914/a07cabfb4725447d?lnk=gst&q=restrict+users+to+their+own+data#a07cabfb4725447d
keith
On Sat, Sep 13, 2008 at 10:30 AM, Gertjan Klein <[EMAIL
On Fri, Sep 12, 2008 at 1:58 PM, Kevin Teague <[EMAIL PROTECTED]> wrote:
> Finally, you could patch a Python program such as manage.py so that
> you do something like:
>
> import sys
> sys.path[0:0] = [
> '\somelocation-for-django-1.0\',
> ]
> import django
>
> This would pick up your Django 1.
> > Rather than suspecting caching, I'd suspect you've got code running at
> > import time instead of form instantiation time that is determining the file
> > list. You did not include the form definition, though, in what you showed
> > us, so it's hard to be sure.
Perfect pointer Karen, with y
Hello,
I would like to move off the existing database server off Django.
Currently, my settings.py file include the following configuration:
DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'golf_prod'
Steve Holden wrote:
>Gertjan Klein wrote:
>> However, there is one obvious problem
>> here: when editing an Hours instance, the ProjectCode dropdown lists
>> *all* project codes, not just those related to the selected customer.
>As long as you only want this in th admin, check out the
>"ForeignK
I wanted to do the same. I decided not to user GIS because of all the new
stuff I needed to install. Two Coordinates are good enough for the google
maps api.
I plan on using geopy (http://exogen.case.edu/projects/geopy/) for
translating addresses to coordinates.
I also found these articles that sh
URL keyed off of numeric month instead of localized name.
-Nathan
On Sat, Sep 13, 2008 at 6:02 AM, Julian <[EMAIL PROTECTED]> wrote:
>
> hi there,
>
> in my settings.py there is the language specified as "de_de", wich
> works well with things like:
>
> {{{
> blog_entry.timestamp|date:"b"
> }}}
>
hi there,
in my settings.py there is the language specified as "de_de", wich
works well with things like:
{{{
blog_entry.timestamp|date:"b"
}}}
in may, it returns "Mai", wich is german for may.
but i am using the generic views for my blog archive, and monthly
based i'm doing things like:
{{{
Gertjan Klein wrote:
> Hi,
>
> I am writing a timekeeping app with Django, and have some design
> questions. Stripped down, I have a model somewhat like this:
>
> class Customer(models.Model):
> Name = models.CharField(max_length=200)
>
> class ProjectCode(models.Model):
> Customer = mo
You are some kind of wonderful. Thanks for that, it has really helped me!
\d
--~--~-~--~~~---~--~~
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
T
Gerard Petersen wrote:
> Daniel,
>
>> If you want a field that's populated with values from another model,
>> you should use a ForeignKey.
> Is it then still possible to use filters and such, and keep it in the model
> logic?
>
> Because the Meta model has these fields: 'attribute', 'value', 'd
Hi,
I am writing a timekeeping app with Django, and have some design
questions. Stripped down, I have a model somewhat like this:
class Customer(models.Model):
Name = models.CharField(max_length=200)
class ProjectCode(models.Model):
Customer = models.ForeignKey('Customer')
Code = mo
On Sat, Sep 13, 2008 at 5:28 AM, vijay <[EMAIL PROTECTED]> wrote:
>
> When i'am trying to migrate my application which is wriiten in 0.96
> version to 1.0, i encountered the following error message.
>
> File "c:\python25\lib\site-packages\django\utils\dateformat.py",
> line 127, in D
>return
On Sat, Sep 13, 2008 at 8:00 AM, Donn <[EMAIL PROTECTED]> wrote:
>
> Extra info:
>
> I have many Projects that equate to 'websites'.
> Each has it's own database in Mysql.
>
> I want one Project to be our Admin that let's us set some stuff that the
> other
> websites (projects) read and act upon.
Extra info:
I have many Projects that equate to 'websites'.
Each has it's own database in Mysql.
I want one Project to be our Admin that let's us set some stuff that the other
websites (projects) read and act upon. (Hence OP needing to access a model
from another Project)
If I setup each "web
On Sat, Sep 13, 2008 at 4:14 AM, Shantp <[EMAIL PROTECTED]> wrote:
>
>
> Just to clear up some confusion, I posted only the relevant part of my
> urls.py file. I have all the other necessary stuff in it but i'm still
> getting this error.
>
So if your root urlconf file does have urlpatterns speci
> Thanks for your answer, Malcolm,
>
> I was refering to the
> branchhttp://code.djangoproject.com/browser/django/branches/per-object-perm...
> which (according to the wiki) appeared to be almost ready for
> inclusion in the
> main branch of 0.96. To me, this always seemed to be the most official
When i'am trying to migrate my application which is wriiten in 0.96
version to 1.0, i encountered the following error message.
File "c:\python25\lib\site-packages\django\utils\dateformat.py",
line 127, in D
return WEEKDAYS_ABBR[self.data.weekday()]
NameError: global name 'WEEKDAYS_ABBR' is
Hello,
The mod_python deployment doc says: "When you use Apache/mod_python,
errors will be caught by Django -- in other words, they won't
propagate to the Apache level and won't appear in the Apache
error_log". Is there a way to force errors to be recorded in the
error_log? Failing that is there
I am getting confused by terms, but this is the basic need:
1. In a base dir I have site1 and site2
2. I am in site2 (views) and I want to use the models defined in site1
3. from site1.models import Blah -- seems to work without error.
4. I get an error on stuff like this:
p = Blah.objects.all()
Daniel,
> If you want a field that's populated with values from another model,
> you should use a ForeignKey.
Is it then still possible to use filters and such, and keep it in the model
logic?
Because the Meta model has these fields: 'attribute', 'value', 'display',
'description'
And it's mor
On Sep 13, 9:25 am, Gerard Petersen <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I need to create a field with a choice set that looks like this:
>
> BTW_CHOICES = (
> ('0.0', '0%'),
> ('6.0', '6%'),
> ('19.0', '19%'),
> )
>
> This works as expected when using dropdown
Hi All,
I need to create a field with a choice set that looks like this:
BTW_CHOICES = (
('0.0', '0%'),
('6.0', '6%'),
('19.0', '19%'),
)
This works as expected when using dropdown lists in a form. But it needs to be
build from data in another model. When needed
Just to clear up some confusion, I posted only the relevant part of my
urls.py file. I have all the other necessary stuff in it but i'm still
getting this error.
On Sep 12, 8:14 pm, Eric Abrahamsen <[EMAIL PROTECTED]> wrote:
> On Sep 13, 2008, at 8:32 AM, Shantp wrote:
>
>
>
> > Hi,
>
> > I did
59 matches
Mail list logo