Re: DB: working with databases

2011-09-25 Thread Xavier Ordoquy

Le 26 sept. 2011 à 01:48, Russell Keith-Magee a écrit :

> On Mon, Sep 26, 2011 at 12:13 AM, Xavier Ordoquy  wrote:
>> Hi,
>> Database will be better designed if you let django orm create them first and
>> you add your tuning after.
>> However, you can still work with non Django generated database.
>> django-extensions application even provides an inspectdb that will guess
>> most of your models from the database schema.
> 
> Erm... *Django* provides inspectdb, not django-extensions. It's part
> of Django's core.
> 
> Yours,
> Russ Magee %-)

My bad, I apologizes for that.
This being said, on the topic:
https://docs.djangoproject.com/en/1.3/howto/legacy-databases/

Regards,
Xavier,
Linovia.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Platform system with Django?

2011-09-25 Thread Ian
I'm new to django, and at this point all I've done is the tutorial.

But my end goal is to create a website that serves as a platform
system.

I want users to go to my site, create an account, edit some settings/
preferences, and a subdomain (can you do this with django?).

Then within each subdomain, other people can register as users to this
particular subdomain, post things, etc.

Is it possible to do this?  I can imagine the structure and how to get
the second part working (having users register on a particular
subdomain site, post things, etc), but I'm having trouble figuring out
where to get started with the first part (creating the subdomain site)

Is there a tutorial or guide to get me started with this platform
concept?  Thanks so much!

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Error in Tutorial?

2011-09-25 Thread Karen Tracey
On Sun, Sep 25, 2011 at 10:42 PM, Grant Humphries  wrote:

> I am referring to Tutorial number 3. When editing the 'polls/
> index.html' file, the tutorial says to input:
>
> {% if latest_poll_list %}
>
>{% for poll in latest_poll_list %}
>{{ poll.question }} li>
>{% endfor %}
>
> {% else %}
>No polls are available.
> {% endif %}
>
> I input exactly this (literally copied and pasted directly from the
> tutorial page).
>
> I got an error saying that {% else%} was an incomplete block!
>
> The only way to correct this was to make it (% else %).
>

What you've done here is turned that string into something the template
parser doesn't recognize as a template tag, so you no longer get an
incomplete block error since you've taken it out of any consideration by the
template parser.


>
> When I finished that, it then gave me an error saying that {% endif %}
> was an incomplete block!
>
> Again, the only way to correct was (% endif %)
>
>
You've done the same thing here, you have not really fixed the problem.



> Which way is correct
> (% else %) OR {% else %}
>
>
{% else %} is correct. The sequence (% or %) means nothing to the template
parser. The problem is somehow with the {% if %} part of the block -- it
does not seem that has been included properly, and therefore the template
engine is reporting and error on any subsequent tag that is expecting that
previous tag to have been included. Alternatively it might be the end of the
{% forr %} that has not been done properly, but I'm not sure offhand if you
would get the error you are describing in that situation.

Karen
-- 
http://tracey.org/kmt/

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Error in Tutorial?

2011-09-25 Thread Grant Humphries
I am referring to Tutorial number 3. When editing the 'polls/
index.html' file, the tutorial says to input:

{% if latest_poll_list %}

{% for poll in latest_poll_list %}
{{ poll.question }}
{% endfor %}

{% else %}
No polls are available.
{% endif %}

I input exactly this (literally copied and pasted directly from the
tutorial page).

I got an error saying that {% else%} was an incomplete block!

The only way to correct this was to make it (% else %).

When I finished that, it then gave me an error saying that {% endif %}
was an incomplete block!

Again, the only way to correct was (% endif %)

Which way is correct
(% else %) OR {% else %}

Cheers
Grant

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Web Designer

2011-09-25 Thread christian.posta
I do most of the html code for my django templates in PyCharm and just
write the code by hand. I've been evaluating WYSIWYG html/web
designers recently (Dreamweaver). But, I find myself using the 'split'
mode of Dreamweaver where I write the code and watch the auto-updating
visual editor. But i don't want to switch to a different code editor
since i'm very comfortable with the keyboard shortcuts and
autocompletion I get in PyCharm.

Do most people who write the templates/html code for django apps
primarily write some code, jump to a browser and refresh? Or write the
static content using a full-blown designer and then break it up into
django templates? I would be grateful for any ideas
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DB: working with databases

2011-09-25 Thread Russell Keith-Magee
On Mon, Sep 26, 2011 at 12:13 AM, Xavier Ordoquy  wrote:
> Hi,
> Database will be better designed if you let django orm create them first and
> you add your tuning after.
> However, you can still work with non Django generated database.
> django-extensions application even provides an inspectdb that will guess
> most of your models from the database schema.

Erm... *Django* provides inspectdb, not django-extensions. It's part
of Django's core.

Yours,
Russ Magee %-)

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to make a query form depend on a field?

2011-09-25 Thread Russell Keith-Magee
On Sun, Sep 25, 2011 at 9:00 PM, David  wrote:
> I'm new to Django, gone through the django book and some
> documentation, but I can't find how to do this or if it's possible.
>
> I have a model that lists documents with title and edition.  It also
> has a foreign key to an organization table.
>
> I'm trying to create a query form that first takes the name of the
> organization in one field, and they lets the user search by document
> title.  The idea is to only show results in the document search that
> are from the organization.  I'm not sure if this is something for the
> forms.py or if it's done in the view for the form.

It sounds like you're getting a little tangled over what processing
should be handled where.

A form retrieves inputs from the user. A query retrieves data from the
database. The view is a function that takes a request, from the user
and turns it into a response that can be rendered back to the user.

So - for your purposes, you need a form to retrieve from the user the
organization they want to search, and the title of the document to
search for:

class SearchForm(forms.Form):
organization = forms.ModelField(Organization)
search_term = forms.CharField(max_length=100)

i.e., a form that lets you select an organization, and provide a block
of text for searching.

Then, in your view, use the data from that form to issue a query:

def my_view(request):
...
form = SearchForm(data=request.GET)
if form.is_valid():
organzation = form.cleaned_data['organization']
search_term = form.cleaned_data]['search_term']
results = Document.objects.filter(organization=organization,
title__icontains=search_term)


At this point, results will contain the list of documents that are
from the selected organization, and has a title that is a
case-insensitive partial match for the search term. If you want
different matching criteria, alter the __icontains query term.

The view requires a little more fleshing out, tool. Obviously, you'll
need to render `results` into a HTTPResponse. I've also assumed that
the query is being issued as a GET query -- which is possible, because
a search should be idempotent, but you *could* issue the search as a
POST, in which case the view handling will be slightly different. If
you're using the same view to present the original form *and* present
the results, you'll need to handle that case; you'll also need to
handle the case where the user doesn't provide a search term.

Filling in these extra bits is left as an exercise for the reader :-)
Hopefully with the form/query/view thing clarified, the rest will fall
into place. If it doesn't, feel free to ask.

Yours,
Russ Magee %-)

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: can't get STATICFILES to work (Django dev version)

2011-09-25 Thread Xavier Ordoquy
Hi,


> I have read and followed the docs on static files.
> django.contrib.staticfiles is in INSTALLED_APPS
> (by default), and I have set STATICFILES_DIRS to where my static files
> are (/home/nara/media). (I have
> tried with and without a slash at the end of this absolute file path).

Static files aren't media. You should keep them separated.

> I am confused about whether ./manage.py collectstatic is a necessary
> step for static files to work, I didn't think so, and have not done
> that.

It isn't if you aren't on production stage (ie, DEBUG=False).

I have started a post on how to setup static files. It isn't finished yet but 
might help you to set it up:
http://www.linovia.com/blog/django-staticfiles-howto/

Regards,
Xavier.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



can't get STATICFILES to work (Django dev version)

2011-09-25 Thread nara
I am having trouble getting static files to work, and have to resort
to putting all my css inline (ugly!).

I have read and followed the docs on static files.
django.contrib.staticfiles is in INSTALLED_APPS
(by default), and I have set STATICFILES_DIRS to where my static files
are (/home/nara/media). (I have
tried with and without a slash at the end of this absolute file path).

Running the dev server, looks like none of my css files are getting
pulled in, the logs always show an HTTP response of 200, and looking
at the results in firebug on firefox 6.0.2, both screen.css and
print.css, my static files, are empty.

I am confused about whether ./manage.py collectstatic is a necessary
step for static files to work, I didn't think so, and have not done
that.

Thanks
Nara

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: retrieving data from list of dictionaries

2011-09-25 Thread Shawn Milochik
This is a Python question. Please subscribe to this list:

http://mail.python.org/mailman/listinfo/python-list

Look up the built-in command "zip" and the keys method of dict to
solve your issue.

Shawn

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



retrieving data from list of dictionaries

2011-09-25 Thread sakthi
Hi all. i have a list of dictionaries
d=[{'name':'ram','age':'23','place':'chennai'},{'name':'sakthi','age':
20','palce':pune'}]

i want to display the name and palce of the two dict in a table.

i tried for long but couldn't get.

please suggest me how to use the for loop in the html file and context
dict.

thank you.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DB: working with databases

2011-09-25 Thread Xavier Ordoquy
Hi,

Database will be better designed if you let django orm create them first and 
you add your tuning after.

However, you can still work with non Django generated database. 
django-extensions application even provides an inspectdb that will guess most 
of your models from the database schema.

Regards,
Xavier,
Linovia.


Le 25 sept. 2011 à 18:02, Tanuja a écrit :

> Is it possible to work with databases in the "traditional" way? I mean:
> Design, create, manage the database natively
> Have batch processes to insert and mange data
> Connect this data to a django-based website
> What tools are there to do this? Is this an inefficient approach in the 
> django world?
> 
> Alternatively, if I create the database using model.py:
> Then need to make changes to the database as we go along, without deleting 
> data, how can this be done?
> How do I define triggers, indexes, etc in model.py?
> 
> Thanks much. I am a newbie. Clearly.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/AvAVd3SH0JsJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Accessing attributes on ManyToManyField table

2011-09-25 Thread Xavier Ordoquy
Hi,

You'll need to acces it through the membership_set:

person_instance.membership_set.date_joined

Regards,
Xavier,
Linovia.


Le 25 sept. 2011 à 17:22, mcjffld a écrit :

> 
> In the documentation (which really is great) there is this example
> 
> class Membership(models.Model):
>person = models.ForeignKey(Person)
>group = models.ForeignKey(Group)
>date_joined = models.DateField()
>invite_reason = models.CharField(max_length=64)
> 
> 
> My question is, is there a way to get the these attributes through the
> Group or Person data?
> 
> I want to render
> 
> "The Beatles", "Ringo Starr", "Needed a new drummer."
> "The Beatles", "Paul McCartney", "Wanted to form a band."
> 
> 
> I get get from the group to the person, from the person to the group,
> but I don't see how to get to the data in the intermediate table.
> 
> Is that data only available in querying?
> 
> 
> thanks,
> 
> Michael
> 
> -- 
> 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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



DB: working with databases

2011-09-25 Thread Tanuja
Is it possible to work with databases in the "traditional" way? I mean:

   - Design, create, manage the database natively
   - Have batch processes to insert and mange data
   - Connect this data to a django-based website

What tools are there to do this? Is this an inefficient approach in the 
django world?

Alternatively, if I create the database using model.py:

   - Then need to make changes to the database as we go along, without 
   deleting data, how can this be done?
   - How do I define triggers, indexes, etc in model.py?
   

Thanks much. I am a newbie. Clearly.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/AvAVd3SH0JsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Accessing attributes on ManyToManyField table

2011-09-25 Thread mcjffld

In the documentation (which really is great) there is this example

class Membership(models.Model):
person = models.ForeignKey(Person)
group = models.ForeignKey(Group)
date_joined = models.DateField()
invite_reason = models.CharField(max_length=64)


My question is, is there a way to get the these attributes through the
Group or Person data?

I want to render

"The Beatles", "Ringo Starr", "Needed a new drummer."
"The Beatles", "Paul McCartney", "Wanted to form a band."


I get get from the group to the person, from the person to the group,
but I don't see how to get to the data in the intermediate table.

Is that data only available in querying?


thanks,

Michael

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Parellel request from the same user in very short time

2011-09-25 Thread Leo
Did you declare the appropriate unique_together metadata on your
construction_queue model?  It says it's enforced at the database
level so it seems like that would cause a failure on the second
INSERT (and that's consistent with my experience).  I'm not positive
about your model but something like

class construction_queue:
...
class Meta:
unique_together = (
( 'user', 'order', ),
( 'user', 'name', 'building_level', ),
)


Of course, once the second INSERT throws an error, you'll still want
to
figure out why your client is doing this in the first place.

Leo



On Sep 25, 7:24 pm, Martin Tiršel  wrote:
> On Sun, 25 Sep 2011 02:09:46 +0200, Russell Keith-Magee  
>
>
>
>
>
>
>
>
>
>  wrote:
> > On Sat, Sep 24, 2011 at 10:08 PM, Martin Tiršel   
> > wrote:
> >> Hello,
>
> >> I am using Apache with mod_wsgi and following setting:
>
> >> WSGIDaemonProcess dev.xyz.com processes=1 threads=5 user=xyz group=xyz
> >> display-name=dev.xyz.com
>
> >> I am observing some situations where a user sends the same request  
> >> multiple
> >> times (double click?) where the time between these requests is very low  
> >> -
> >> 80-100ms. Then I got these situations (bot request from the same user):
>
> >> 1. request A - SELECT ...
> >> 2. request B - SELECT ...
> >> 3. request A - INSERT ... (insert is based on select result from step 1)
> >> 4. request B - INSERT ... (insert is based on select result from step 2)
>
> >> Because 1. and 2. gets the same data, I end with doubled (or sometimes
> >> trippled) inserts what breaks my application. How do you prevent such
> >> behaviour? I am using Django 1.2.x
>
> > I might be missing something obvious here, but isn't this *exactly*
> > what database transactions are designed to fix? Admittedly, you've got
> > an unusual presentation born out of weird browser behavior, but making
> > sure that two overlapping operations don't violate data integrity
> > sounds like the textbook case for using transactions.
>
> > Yours,
> > Russ Magee %-)
>
> In my case, I have a construction_queue which has an order,  
> building_level, game_base_id and some other fields. Order field is for  
> sorting the queue. When I am inserting new item, i need to determine  
> values for order and building_level. Order field is from SELECT COUNT...  
> and building_level from built_buildings plus number of buildings of the  
> same name in construction_queue. So when double request load the same  
> data, the same inserts are created. Transaction would be usable when I add  
> unique index on game_base_id with order. In that case when double request  
> comes, I got an exception and I can rollback the second request. You mean  
> it this way?
>
> Martin

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to make a query form depend on a field?

2011-09-25 Thread David
I'm new to Django, gone through the django book and some
documentation, but I can't find how to do this or if it's possible.

I have a model that lists documents with title and edition.  It also
has a foreign key to an organization table.

I'm trying to create a query form that first takes the name of the
organization in one field, and they lets the user search by document
title.  The idea is to only show results in the document search that
are from the organization.  I'm not sure if this is something for the
forms.py or if it's done in the view for the form.

The issue I seem to be stuck on is in the tutorials the queries (gets)
are single valued and relatively simple.  There are hints of things
like querysets and Q that seem like they might do this, but I can't
figure out how to tie the form to these functions?

Any pointers to documentation or hints or snippets would be greatly
appreciated.

Thanks very much.

--David

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Parellel request from the same user in very short time

2011-09-25 Thread Torsten Bronger
Hallöchen!

Russell Keith-Magee writes:

> [...]
>
> I might be missing something obvious here, but isn't this
> *exactly* what database transactions are designed to fix?
> Admittedly, you've got an unusual presentation born out of weird
> browser behavior, but making sure that two overlapping operations
> don't violate data integrity sounds like the textbook case for
> using transactions.

I agree that if the constraint can be expressed by an RDBMS
conditions, it should be expressed this way.  However, this is not
always possible.

By the way, in our project, we considered database integrity errors
as internal errors that we never caught.  Instead, we avoided them
by pre-checking the input data.  Is this a bad approach?

Tschö,
Torsten.

-- 
Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Parellel request from the same user in very short time

2011-09-25 Thread Martin Tiršel
On Sun, 25 Sep 2011 02:09:46 +0200, Russell Keith-Magee  
 wrote:


On Sat, Sep 24, 2011 at 10:08 PM, Martin Tiršel   
wrote:

Hello,

I am using Apache with mod_wsgi and following setting:

WSGIDaemonProcess dev.xyz.com processes=1 threads=5 user=xyz group=xyz
display-name=dev.xyz.com

I am observing some situations where a user sends the same request  
multiple
times (double click?) where the time between these requests is very low  
-

80-100ms. Then I got these situations (bot request from the same user):

1. request A - SELECT ...
2. request B - SELECT ...
3. request A - INSERT ... (insert is based on select result from step 1)
4. request B - INSERT ... (insert is based on select result from step 2)

Because 1. and 2. gets the same data, I end with doubled (or sometimes
trippled) inserts what breaks my application. How do you prevent such
behaviour? I am using Django 1.2.x


I might be missing something obvious here, but isn't this *exactly*
what database transactions are designed to fix? Admittedly, you've got
an unusual presentation born out of weird browser behavior, but making
sure that two overlapping operations don't violate data integrity
sounds like the textbook case for using transactions.

Yours,
Russ Magee %-)



In my case, I have a construction_queue which has an order,  
building_level, game_base_id and some other fields. Order field is for  
sorting the queue. When I am inserting new item, i need to determine  
values for order and building_level. Order field is from SELECT COUNT...  
and building_level from built_buildings plus number of buildings of the  
same name in construction_queue. So when double request load the same  
data, the same inserts are created. Transaction would be usable when I add  
unique index on game_base_id with order. In that case when double request  
comes, I got an exception and I can rollback the second request. You mean  
it this way?


Martin

--
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Model Validation

2011-09-25 Thread Kurtis Mullins
Looks like you want to use this field:
https://docs.djangoproject.com/en/dev/ref/models/fields/#positiveintegerfield

On Sat, Sep 24, 2011 at 11:54 PM, jenia ivlev  wrote:

> I have a model M that has a field num=models.IntegerField()
> I have a modelform called 'F' for model 'M'.
> I want to ensure that num is never negative.
>
> If I do validation in my form class, 'F', then i can do clean_num():
> if negative than throw ValidationError('Num can never be negative').
> This validationerror will be automatically redisplayed to the user by
> redirecting him to back to the form that he submitted and displaying
> the 'Num can never be negative' message on top of the num field.
> Thats all done automatically by django as soon as I throw the
> validationerror from the clean_fieldname method.
>
> I would like to be able to do all that, but in the model class.
>
> So F, that has a FormField for the ModelField 'num' , will fail and
> display the error message defined in the model class that its
> representing.
> Also F2 and Fxxx will do the same if they all represent 'M' and have a
> FormField for ModelField num.
>
> How can I achieve this?
>
> Thank you for your time and kind concern.
> jenia
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.