must be declared before the other, and
the other is therefore invalid at that time
Perhaps there is a work around?
Mike
On Nov 29, 2:56 pm, Karen Tracey <kmtra...@gmail.com> wrote:
> On Sat, Nov 28, 2009 at 11:50 PM, adelaide_mike <mike.ro...@internode.on.net
>
>
>
> >
I have three models:
class Connector(models.Model):
connectorname = models.CharField(max_length=32)
class Cable(models.Model):
cablename = models.CharField(max_length=32)
class Node(models.Model):
connector = models.ForeignKey(Connector)
cable = models.ForeignKey(Cable)
One final question if I may (well I hope its the last).
In my standard report generating view I need to use Arial font (for
example).
I have studied the reportlab docs (Paragraphs chapter) for hours and
tried all sorts of guesses as to how to do it. Nothing I have tried
works. My fault. Now
In my report generating view I have this (snip):
if tablename == 'Area':
areas = Area.objects.all()
data.append(['Code','Name','Description'])
for area in areas:
data.append([
Paragraph(area.area, normalstyle, bulletText=None),
Nevermind. Found the solution in a post from abrightwell. Thanks.
Mike
On Nov 22, 8:40 pm, adelaide_mike <mike.ro...@internode.on.net> wrote:
> Hi Kenneth, and thanks for the reference. I must admin I did not
> think of looking int he Django docs for ReportLab related stuff.
&
able to prodice the pdf I want. I do not see how to
incorporate this technology into the given example.
Perhaps someone has done this and can give me the next pointer?
Mike
On Nov 22, 9:30 am, Kenneth Gonsalves <law...@au-kbc.org> wrote:
> On Sunday 22 Nov 2009 3:38:24 am adelaide_m
Please excuse my lack of knowledge about the following. (If I knew
the answer, I would not be asking...)
Django 1.0.2 being used to create, manage and report on data in
tables. I am using ReportLab to generate a .pdf which I store with a
known name in a sub-directory.
I have seen websites
I am attempting to user ReportLab with Django to make a report
displaying my data in a tabular format.
An example model is:
class Vehicle(models.Model):
ve_name = models.CharField(max_length=20)
ve_type = models.CharField(max_length=20)
My report generating view a copy of the example in
Hi. Still learning, slowly. This is Django 1.0.2
The relevant models are Unit, Connector and Cable
class Cable(models.Model):
cable = models.CharField(max_length=8, blank=False)
desc = models.CharField(max_length=128, blank=True)
cabletype = models.ForeignKey(Cabletype, blank=True,
, allow me to achieve this. I will investigate
your itertools suggestion.
Mike
On Oct 20, 8:38 am, Max Battcher <m...@worldmaker.net> wrote:
> adelaide_mike wrote:
> > Hi
> > My models are, essentially :
> > class Cable(models.Model):
> > cable = models.Ch
Hi
My models are, essentially :
class Cable(models.Model):
cable = models.CharField(max_length=8)
class Connector(models.Model):
connector = models.CharField(max_length=8)
class Node(models.Model):
cable = models.ForeignKey(Cable)
connector = models ForeignKey(Connector)
So, a
On Oct 4, 2:11 am, Nan <ringe...@gmail.com> wrote:
> Yes.
>
> class Foo(models.Model):
> # field definitions here
> class Meta:
> verbose_name = 'Bar'
>
> See
> also:http://docs.djangoproject.com/en/dev/ref/models/options/#ref-models-o...
>
>
Hi again.
I have made a couple of confusing choices for table names in my
database. I do not really want to change them in the PostgreSQL
database. Can I change the labels given to them in the Admin. For
example in the list of administratable tables and the pages that
follow when doing add or
My only dissatisfaction is that other contributors to this list seem
to do almost anything with very few lines of code, whereas I am using
many. And, being a newbie I naturally worry that I am on the wrong
pathway, having missed the turning.
Thanks to both for your reassurance.
Mike
On Oct 3,
Hi
In my app the user needs to drill down through a series of templates
and their views to identify a house. We start with the city, then the
street and finally the house, in each case chosen from a rendering of
the possible values selected from the relevant database table.
I have all this
Django itself uses the term "column" as witnessed by an exception I
just raised reading:
no such column.
Mike
On Sep 17, 11:34 pm, Javier Guerra <jav...@guerrag.com> wrote:
> On Thu, Sep 17, 2009 at 9:04 AM, adelaide_mike
>
> <mike.ro...@internode.on.net> wro
I have a multi-table model, each table related to the next by a one to
many foreign key.
I wish to do:
q = Child.objects.filter(date__gte=startdate).order_by
('parent.grandparent.greatgrandparent__name')
This raises an exception no such column:
parent.grandparent.greatgrandparent__name
Is
Hi.
In my Django 1.0.2 app I have a parent and a child table. On my child
ModelForm a selector field for the parent is automatically provided.
The form also displays a "date" field representing a column in the
child model.
In my view I have:
form = MyForm(initial={'date':
or not certain fields depending on whether their
value changed or did not, in each successive "row".
Thanks for your clear explanation. It helped greatly.
Mike
On Sep 17, 10:26 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Sep 17, 1:48 pm, adelaide_mike <mike.ro...@i
Hello
I, a newbie to Django and Python, have a model thus:
class Person(model.Models):
first_name = models.CharField(max_length=32)
last_name = models.CharField(max_length=32)
In my view.py can do this, to illustrate my question:
def testing(request):
persons = Person.objects.all()
Django 1.0.2 In the following template I intend to make rows that
have an empty second column bold. Hence trying 2 in row. My syntax
is wrong due to inexperience with Python, and possibly my methodology
also.
{% extends "base.html" %}
{% block content %}
Agent summary report
The most
Oops - my mistake within admin.py. Sorry to waste bandwidtrh.
Mike
On Sep 11, 10:36 am, adelaide_mike <mike.ro...@internode.on.net>
wrote:
> Hi
> I am just getting into my second project/app but have run into a
> problem I have not seen before. My models.py has the follo
Hi
I am just getting into my second project/app but have run into a
problem I have not seen before. My models.py has the following:
class Cabletype(models.Model):
cabletype = models.CharField(max_length=16, blank=False,
unique=True)
desc = models.TextField()
def __unicode__(self):
I (newbie) am looking at using Blueprintcss to display a 7 column
array of data. The data is passed to the template in "dataarray". I
have tested the code below without the section and the column
headings display correctly.
Adding the section to the code causes an error at {% for row
in
Thank you Mike Ramirez. [1] makes a difference. I now see the css
taking effect.
Mike
On Aug 30, 8:55 am, Mike Ramirez <gufym...@gmail.com> wrote:
> On Saturday 29 August 2009 04:35:11 pm adelaide_mike wrote:
>
>
>
> > As a very newbie I am struggling to understand
As a very newbie I am struggling to understand how to use CSS. I read
in
http://docs.djangoproject.com/en/dev/topics/forms/media/#paths-in-media-definitions
that I need to write:
class Media:
css = {
'screen': ('pretty.css',),
'print': ('newspaper.css',)
}
for
After adding a model to my Django 1.0.2 app I would like to change the
names of two models. Will the syncdb take care of this for me? I
anticipate I will need to change the table names in PostgreSQL.
Any caveats? Any hints? TIA
Mike
--~--~-~--~~~---~--~~
You
In my reporting function I need to have:
If DATABASE_NAME = x:
#do this
Else:
#do the other
How can I obtain that name, which is established in settings.py?
Mike
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
indicators.
I have not found more than a paragraph or two concerning the use of
raw sql. Any pointers would be appreciated.
Thanks
Mike
On Aug 15, 5:37 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Aug 15, 5:23 am, adelaide_mike <mike.ro...@internode.on.net> wrote:
>
>
My raw sql returns a list of data very nicely, except that character
cols have data surrounded by u'', and dates have datetime.date
(2009-01-01) etc.
In my newbie innocence I have not discovered how to remove these
extras. Any clues?
Thanks
Mike
Working in Django 1.0.2 with PostgreSQL backend the following produces
an error:
Operational Error at /report/agent_summary/
near "ON": syntax error
The SQL works if run in pgadminIII but with %s replaced by
"2009-01-01". Must be a newbie error somewhere.
def agent_summary(request):
This should really be a Python enquiry, but I am sure someone will
know:
I need to calculate the date 12 weeks before today. What is the best
way? TIA
Mike
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
Hi
Lets say I have two models Street and House, related by a foreign key
thus:
class House(models.Model):
house_number = models.CharField(max_length=16)
street = models.ForeignKey(Street)
In the admin area, the Change House page displays a list widget by
which to select the street. I
Hi
Can some kind soul tell me what, in principle, this means:
'str' object not callable
? It seems to be associated with urls.py
Newbie just needs some additional words to help. Have looked at the
history of this, which did not help. I do not want to know why the
error is arising, I simply
009 at 10:08 AM, adelaide_mike <mike.ro...@internode.on.net
>
>
>
> > wrote:
>
> > Django 1.0.2. My ModelForm concerns (and is based on the table for)
> > advertisements for houses placed by real estate agents.
>
> > I need the agent widget (which by defaul
Django 1.0.2. My ModelForm concerns (and is based on the table for)
advertisements for houses placed by real estate agents.
I need the agent widget (which by default is a pick list of all
agents), to be modified on the form to be either (depending on
circumstances) a non-editable preset display
Very cool, Rajesh D. Thanks.
Mike
On Jul 11, 12:31 am, Rajesh D <rajesh.dha...@gmail.com> wrote:
> On Jul 10, 11:06 am, adelaide_mike <mike.ro...@internode.on.net>
> wrote:
>
>
>
> > I suspect this is a question more for a PostgreSQL list, but please
> &
I suspect this is a question more for a PostgreSQL list, but please
bear with me.
In Django 1.0.2 working with PostgreSQL 8.3 I have a model with an
implied pkey. PostgreSQL syas this:
CREATE TABLE wha_property
(
id serial NOT NULL,
propnum character varying(16) NOT NULL,
beds integer,
(that I know is set).
Thanks for your reply.
Mike
On Jun 23, 1:08 pm, Kenneth Gonsalves <law...@thenilgiris.com> wrote:
> On Tuesday 23 June 2009 09:14:01 adelaide_mike wrote:
>
> > form = MyModelForm(initial={'myforeignkeyfieldname': myvalue})
>
> assuming the foreignkey valu
Having failed to get any takers to my earlier posts on this, I will
keep it v. short:
How do I preset a foreign key value in a Model Form?
form = MyModelForm(initial={'myforeignkeyfieldname': myvalue})
does not do it.
Surely this can be done?
Mike
Try again. I am new to Django and the web, so I do not know all the
right vocabulary. Sorry.
I need my ModelForm to be displayed, for creation of a new record,
with a date field and a foreign key (pointing to the Source table)
selector list aleady populated. I am doing this:
form =
Oops werong action - incomplete message.
I have a ModelForm:
class ListingForm(ModelForm):
class Meta:
model = Listing
that has a method that, for a new record, should set the ForeighKey
field "source" to an object identified in the UserProfile. The "date"
value is
if request.method == 'GET':
if listing_id > '0':
listing=Listing.objects.get(pk=listing_id)
form = ListingForm(instance=listing)
else:
print "In listings GET source=",
Hi
Newbie trying to preset a field on a form where the object is to be
inserted. The snippet below does not do it.
class FooForm(ModelForm):
class Meta:
model = Foo
if request.method == 'GET':
if foo_id > '0':
Hmm. Sorry. I see it, for this list. But is there a way for the
Snippets?
On Jun 10, 6:12 am, adelaide_mike <mike.ro...@internode.on.net> wrote:
> Is there a way to search for a word in the Subject line or the text of
> posts to this group? Same with the list of snippets. Sca
Is there a way to search for a word in the Subject line or the text of
posts to this group? Same with the list of snippets. Scanning twenty
at a time (out of 1500 or more) seems a long way to see what exists.
Mke
--~--~-~--~~~---~--~~
You received this message
Hi
I need to store additional info about my users. The following in
models.py raises a name error due to User. Have tried auth_users and
Users as well. No joy.
class User_settings(models.Model):
user = models.ForeignKey(User,unique=True)
current_date =
different thinking c/w "normal" desktop apps. Still heaps to learn.
Thanks again.
Mike
On Jun 5, 6:15 pm, TiNo <tin...@gmail.com> wrote:
> On Fri, Jun 5, 2009 at 11:04, adelaide_mike
> <mike.ro...@internode.on.net>wrote:
>
> > Exception Value: 'Prope
' object does not support item
assignment
On Jun 5, 5:15 pm, Daniel Roseman <roseman.dan...@googlemail.com>
wrote:
> On Jun 5, 5:33 am, adelaide_mike <mike.ro...@internode.on.net> wrote:
>
>
>
> > Another "in principle" question. My Street model is the par
Another "in principle" question. My Street model is the parent of my
Property model, many to one via foreign key.
User selects the street and I store it in request.session. User then
gets to enter the property details in this form:
class PropertyForm(ModelForm):
class Meta:
My latest problem can be illustrated thus:
In the first form we select the main course - spam or eggs. In the
next form we select the dessert - ice cream or mud cake, and in the
third form we select the after-dimmer drink - tea or coffee.
How is the proper way to remember the choice made in
My non-wizard templates are in this directory, all working as
expected:
my_wha_templates/wha/
I have built a form wizard in my whasite.wha.forms.py exactly as per
the docs. I have pasted the suggested template HTML into a file:
my_wha_templates/wha/contact/forms/wizard.html
My urls.py is
zard/
> I guess
>
> On Jun 3, 8:04 am, adelaide_mike <mike.ro...@internode.on.net> wrote:
>
> > I am a newbie with Django and web stuff, but have long experience with
> > desktop databases.
>
> > In Django my user runs through a series of template.htmls choosing a
I am a newbie with Django and web stuff, but have long experience with
desktop databases.
In Django my user runs through a series of template.htmls choosing a
particular great great grandchild object, a house.
Then she must select a sales agent object. Just in general, how do I
arrange for the
uot;if request is a POST" check, so that if the form.is_valid() check fails,
> # we go back and show the HTML again with the form containing errors.
> return render__to_response('contests/edit_result.html',
> {'form': form})
>
> Hope that helps!
>
> Ti
data" labels. I conclude the line:
form = PropertyForm(request.POST)
does not populate the validation form. What have I got wrong here?
TIA
Mike
On Jun 1, 8:14 pm, Tim Sawyer <list.dja...@calidris.co.uk> wrote:
> On Monday 01 June 2009 01:38:30 adelaide_mike wrote:
>
&g
I found a really clear explanation of creating and updating database
objects in SAMS TeachYourself Django, but it appears to be for v
0.96.
I have looked at "Creating forms from models" in the documentation,
and about one-third the way down it shows the following:
# Create a form instance from
Thanks Gabriel. I think it would be good if the tutorial included a
three-level hierarchy sowing how to handle the url.py and views.py for
the third layer. Anyway, I now understandone step more.
Thanks and regards
On May 31, 11:46 am, Gabriel <gabriel@gmail.com> wrote:
> adel
I have model classes Suburb, Street ,Property and Event.
Each has a name , a foreign key to the model above, and the id
provided by default. In the admin everything is fine.
The template address.html has a search field and returns a startswith
query that generates streets.
Clicking a line in
Thank you Tom and Daniel. Starting to see some light here.
Mike
On May 28, 1:25 am, Daniel Roseman <roseman.dan...@googlemail.com>
wrote:
> On May 27, 2:59 pm, Tom Evans <tevans...@googlemail.com> wrote:
>
>
>
> > On Wed, 2009-05-27 at 06:27 -0700, adelaide_mike w
Very beginner here.
My model has two classes, Suburb, the parent, and Street, the child:
class Suburb(models.Model):
suburb_name = models.CharField(max_length=72)
postcode = models.CharField(max_length=4)
def __unicode__(self):
Hi
Be gentle with me. I am on my 7th day with Django. I have completed
the tutorial for 1.0.2 and have started building an app that has three
models in a hierarchy, Suburb, Street and Property. All are available
in the basic Admin, working very well.
Now I emulated the tutorial by building a
Spot on. Thanks Karen
On May 24, 11:08 am, Karen Tracey <kmtra...@gmail.com> wrote:
> On Sat, May 23, 2009 at 9:57 PM, adelaide_mike
> <mike.ro...@internode.on.net>wrote:
>
>
>
>
>
> > First, please forgive my post to the Django developers group. I mis-
First, please forgive my post to the Django developers group. I mis-
understood the terminology.
I am a total beginner in Django but have long experience with Omnis.
My data stores addresses in three tables named
Suburb, (columns are id, name)
Street, (columns are id, name, suburb_id)
Property
64 matches
Mail list logo