problems getting the development version running on Leopard

2010-01-19 Thread Rob Slotboom
I followed all instructions regarding the intallation of the development version of Django on Leopard. I’ve created the symbolic links but I keep getting two error messages: The first one trying to rum django-admin.py command not found The seccond trying to import django in the python shell

Unicode question

2007-08-20 Thread Rob Slotboom
After moving to the latest version of Django one of the functions I wrote fails to work. I'll drop the code... def year_cal(sectie, req_year = None, req_month=None): cur_year= str(datetime.datetime.now().year) cur_month= datetime.datetime.now().strftime("%b") all_month_list = ['jan', 'fe

menu application

2007-08-24 Thread Rob Slotboom
For a given django site there are many urls.py's. The system also knows what apps are installed. Wouldn't it be nice to make an app that uses this knowledge and add some extra functionality to manage a website menu? At the moment I have no idea how to implement it but it should be something websi

site/section/app

2007-08-29 Thread Rob Slotboom
I'm trying to implement a kind of model but I'm stuck. Maybe someone outhere can give me some help? This is what I'm thinking about: A site can have sections and a section can have apps. Also a site can have apps. For example: Site: gardening.org app: news sections: garden/kitchen garden apps:

ifchanged

2007-04-03 Thread Rob Slotboom
Within a template I want to use the folowing construction. {% for item in object_list reversed %} {% ifchanged %} {% if not forloop.first %}{% endif %} {{ item.pub_date| date:"F" }} {% endifchanged %} {{ item.title }}

best alternative for subclassing

2007-09-13 Thread Rob Slotboom
For a model I need subclassing which is work on progres. Falling back to a OneToOne approach seems tricky because "the semantics of one-to- one relationships will be changing soon". I'm wondering now what to do. Here's my model in the OneToOne approach. class Cropcat(models.Model): parent = mo

parent child question

2007-09-17 Thread Rob Slotboom
class Category(models.Model): name = models.CharField(maxlength=70) parent = models.ForeignKey('self', blank=True, null=True, limit_choices_to = {'parent__isnull': True}) I dont want to be able to select a parent which is actualy the category currently edited. I tried a custom validator bu

Getting an object's meta value

2007-09-18 Thread Rob Slotboom
For a class method I want to use the value of the Model>Meta>verbose_name. Can someone tell me how to get this value? Thanks, Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Please help with extra validation in admin

2007-10-01 Thread Rob Slotboom
This is my model and I use a custom save to prevent the creation of a category with a parent_id which is the same a the current_id (child of itself) class Category(models.Model): name = models.CharField(maxlength=70, unique=True) slug = models.SlugField(maxlength=50, unique=True, prepopulat

Re: Is there a {% if_less_than %} template tag

2007-10-01 Thread Rob Slotboom
Hi Greg: Just started using it yesterday :-) http://code.google.com/p/django-template-utils/ --~--~-~--~~~---~--~~ 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@

Re: Please help with extra validation in admin

2007-10-03 Thread Rob Slotboom
Addition: > This is my model and I use a custom save to prevent the creation of a > category with a parent_id which is the same a the current_id (child of > itself) When an error occurs an ugly error message apears so I tried to create a custom validator. Custom validator didn't work because of

Re: Custom validation for models in admin

2007-10-03 Thread Rob Slotboom
Hi Mike, I have the same problem with my model. (Link below) Reading your "points to a .validate() on the model" raises the following question. Have you tried it? http://groups.google.com/group/django-users/browse_thread/thread/bd2b2c24f3879690 --~--~-~--~~~---~--~-

pattern question

2007-10-10 Thread Rob Slotboom
I want to create a pattern to get one or more occurences of, let's say, slug. /bla/ /bla/blob/ /bla/blob/blebber/ /bla/blob/blebber/and_a_lot_more etc. I get it working for up to two slugs with ('^([^/]+)/([^/]+)/$', 'page'), def page(request, *slugs): slug_list = [] for slug in slugs:

Re: pattern question

2007-10-10 Thread Rob Slotboom
Hi Malcolm, SMART Thanks Rob --~--~-~--~~~---~--~~ 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 [

object and related object on one form (newforms)

2007-10-28 Thread Rob Slotboom
Can someone please explain to me how to create a form which provides not only the fields for the object but also the fiels for a related object (foreign key) and the best method to validate and save the data? Thanks in advance, Rob --~--~-~--~~~---~--~~ You rece

Re: object and related object on one form (newforms)

2007-10-29 Thread Rob Slotboom
Hi Thomas, Thank you. I managed to get 2 forms in a view but I dont know how to provide some 'default' data to some fields in the related form. I'll give you some code: class Infocard(models.Model): from django.conf import settings content_type = models.ForeignKey(ContentType, limit_choic

include tag and urls

2006-10-27 Thread Rob Slotboom
Using an inlude tag on my homepage to get a list of current polls requires a template. This template lists the polls and provides a link for the details. I need to give an url including the modulename: (a href="/polls/5") I don't like this approach so I want to ask if it is possible to use an obj

Re: include tag and urls

2006-10-29 Thread Rob Slotboom
> Can you give some more details, please? I cannot puzzle out what you are > currently doing here. Hello Malcolm, It's about in the template. Here come the details... ### mysite/polls/templatetags/poll_tags.py from django import template from mysite.polls.models import Poll register = templat

custom or build in register/login/logout

2006-10-29 Thread Rob Slotboom
For a project I need to record customer information such as name, address etc. I doubt about the best approach to create this functionality. Shall I use the user class in contrib.auth and extend it or shall I create an independent customer class/app? The first approach serves me the default authe

Re: custom or build in register/login/logout

2006-10-29 Thread Rob Slotboom
Sorry, I should have searched smarter before posting. Found the anwers at http://www.b-list.org/weblog/2006/09/02/django-tips-user-registration --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

setting and using an object variable without using a field

2006-11-03 Thread Rob Slotboom
To be able to control a template output based on a current remote address, I created this model. class Poll(models.Model): question = models.CharField('vraag', maxlength=200) pub_date = models.DateTimeField('publicatie datum') voted_by_remote_addr = False def set_voted_by_remote_addr

Re: What's the best way to make a custom publishing workflow?

2006-11-04 Thread Rob Slotboom
Hi Kevn, May be of interest: http://www.b-list.org/weblog/2006/09/02/django-tips-user-registration http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

model question

2006-11-09 Thread Rob Slotboom
I'm trying to get a very simple relationship to work but I can't figure ou how to do this in Django. This is what I want. Poll ---<< question Poll ---<< vote A user can vote a poll just once. I check this using a function which gets the remote ip. This is the models.py snippet class Poll(mode

Re: model question

2006-11-09 Thread Rob Slotboom
Rob Hudson schreef: > I'd kind of think that in Vote you don't need the poll FK, just the > choice since the choice then maps to a particular poll. But how do I prevent a voter to vote more than once on a poll? --~--~-~--~~~---~--~~ You received this message be

Re: model question

2006-11-10 Thread Rob Slotboom
Thank you guys. Without a poll_id in vote it isn't possible to check integrity in the database so I keep it :-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send emai

cursor.fetchall() attribute error

2006-11-11 Thread Rob Slotboom
In a models.py I have created the folowing function. Top level, not in a class. def get_unvoted_polls_for_voter_ip(ip): from django.db import connection cursor = connection.cursor() sql = """SELECT polls_poll.* FROM polls_poll LEFT OUTER JOIN polls_vote ON polls_poll.id = polls_vot

cursor.fetchall() attribute error

2006-11-11 Thread Rob Slotboom
In a models.py I have created the folowing function. Top level, not in a class. def get_unvoted_polls_for_voter_ip(ip): from django.db import connection cursor = connection.cursor() sql = """SELECT polls_poll.* FROM polls_poll LEFT OUTER JOIN polls_vote ON polls_poll.id = polls_vot

model field question

2006-12-07 Thread Rob Slotboom
For a model I have defined two table fields. To fill those fields in admin I want to provide an extra dropdown field. Is it possible to add an extra field to the model without creating a corresponding database field? The use: field1 = content_type_id field2 = content_item_id Extra dropdown fi

Cannot resolve keyword 'caption' into field

2006-12-08 Thread Rob Slotboom
I get this error in admin when saving a new article. Can someone please help me? Complete model... from django.db import models from django.core import validators class Article(models.Model): pub_date = models.DateTimeField('date published') published = models.BooleanField() headlin

Re: Cannot resolve keyword 'caption' into field

2006-12-09 Thread Rob Slotboom
After many many trail and error I maybe found a 'bug'. I simplefied the above model till it worked again. Then I added the next field option and the error arose. "unique=True" in MenuItem > name Complete simplefied model with error: ### from django.db import models cla

model problem "matching query does not exist"

2006-12-09 Thread Rob Slotboom
After solving a problem described at: http://groups-beta.google.com/group/django-users/browse_frm/thread/b453f0c91e29cc04?hl=nl I continued developping my model. Unfortunately a new problem arose. Given the following model, I get an error message in admin after successfully saving an article and

Re: Cannot resolve keyword 'caption' into field

2006-12-11 Thread Rob Slotboom
On 10 dec, 17:42, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > What is the error you are getting? It's the 'subject' Cannot resolve keyword 'caption' into field --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

changing values just before saving

2006-12-12 Thread Rob Slotboom
In a model I feed a contenttype form field some initial data to choose from. class MenuItem(models.Model): CONTENT_TYPE_CHOICES = tuple(get_available_content()) content_type = models.ForeignKey(ContentType, choices=CONTENT_TYPE_CHOICES) The data is provided using the folowing function whic

Re: changing values just before saving

2006-12-12 Thread Rob Slotboom
> Your solution seems to be some misunderstanding :) > If you set a foreign key to ContentType, then it already gets the > choices from the relation. Dear Aidas, I know, I know. The point is that I want to be able to use the damn generic relation in admin. I abuse the given field to collect real

help with tagging app

2006-12-12 Thread Rob Slotboom
I installed Luke Plant's Tagging App and started reading the README file and the comments provided in the source. Compared to the marvelous Django Book and -tutorial this reading isn't very funny :-) Has someone a simple example for how to include a tag in another model, say Poll or Article? And

Re: alternatives to edit_inline

2006-12-12 Thread Rob Slotboom
Maybe this may be of any help. In the model you can add adminlinks like this: class Admin: fields = ( ) list_display = ('name', 'admin_links') def admin_links(self): return 'edit | view | delete' % (self.id, self.get_absolute_url(), self.id)

Re: alternatives to edit_inline

2006-12-13 Thread Rob Slotboom
Hi Milan, > Is there a workaround for that? Sorry I don't know. >I'll write my own views. Maybe you can expand the admin using your own views. Take a look at the next app for some ideas: http://trac.dedhost-sil-076.sil.at/trac/filebrowser/wiki Success. Rob --~--~-~--~~-

Re: alternatives to edit_inline

2006-12-13 Thread Rob Slotboom
Hi Milan, > Is there a workaround for that? Sorry I don't know. >I'll write my own views. Maybe you can expand the admin using your own views. Take a look at the next app for some ideas: http://trac.dedhost-sil-076.sil.at/trac/filebrowser/wiki Success. Rob --~--~-~--~~-

Re: help with tagging app

2006-12-14 Thread Rob Slotboom
> >That's easy. Hi Timm, Okay, this is a very simple example :-) But Luke Plant's Tagging App modell is realy a bit more comple. See>> http://groups-beta.google.com/group/django-users/browse_frm/thread/a7cbd4fd843583be/5ef4a59b78dbb2e1?lnk=gst&rnum=1&hl=nl#5ef4a59b78dbb2e1 --~--~-~--

Re: GenericForeignKey

2006-12-15 Thread Rob Slotboom
> paulh, take a look at > thishttp://net-x.org/weblog/2006/nov/29/django-generic-relations-made-eas... Hi Antoni, Seems interesting but the code isn't yet available I suppose... Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: help with tagging app

2006-12-15 Thread Rob Slotboom
> tagging app from Luke Plant > zyons > the tagging app that jay parlar developed It seems that more and more tagging apps appear while using generic relations in admin will be available in a future Django. The last few days I've been strugling to create a menusystem. A kind of tag system but usi

HttpResponseRedirect

2006-12-15 Thread Rob Slotboom
For my project I created a templatetag which handles login, logout, get profile etc. This way I can show a login/out box on every page by including the tag in the main template. There is one problem. After logging out I want to redirect the user so the cookies etc, are gone. This is what I did (

Re: OneToOneField and edit_inline

2006-12-16 Thread Rob Slotboom
Hi Dirk, I think it's the other way around, try this class Content(models.Model): title = models.CharField('Title', maxlength=255, core=True) body = models.TextField('Body text') class Admin: fields = ( (None, {'fields': ('title','body',)}), ) list_disp

Re: Why does Django think my browser isn't accepting cookies?

2006-12-16 Thread Rob Slotboom
Try to delete your cookies. --~--~-~--~~~---~--~~ 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 [EM

Re: Would Django be a good framework for developing and engineering/science application

2006-12-16 Thread Rob Slotboom
> I guess the next thing for me to do is to spend alot of > time with the documentation and built a couple of simple apps/tutorials > to flush out my understanding of how Django will work. > Hi Thomas, And don't forget to look at the http://www.djangobook.com/ Rob --~--~-~--~~

urls question django_website

2006-12-18 Thread Rob Slotboom
When I look at the urls.py file belonging to django_website I can't figure out how the website handles the pattern for www.djangoproject.com/ The only option seems to be the included flatpages.urls but this one needs a pattern for an url. Does anybody have a clue? Here is the code: urlpatterns

Re: OneToOneField and edit_inline

2006-12-18 Thread Rob Slotboom
> I'd like to be able to edit Project and News separately with Content inline > instead. Do you know what i mean? Hi Dirk, I get the point though I think this will not work. I've tried similar things when creating a menu, where a menu "one to oned" to a poll item or blog entry. I gave up. In th

Re: urls question django_website

2006-12-18 Thread Rob Slotboom
> The 'homepage' is a flatpage with an address of '/'. Hi Kwe, Great help!!! I still can't figure out however how the flatfiles are loaded? For example: http://code.djangoproject.com/browser/djangoproject.com/django_website/templates/flatfiles/homepage.html --~--~-~--~~

Re: urls question django_website

2006-12-18 Thread Rob Slotboom
> I still can't figure out however how the flatfiles are loaded? Or maybe the homepage template from flatfiles is used, without using the content for the flatpage at all. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gr

Re: OneToOneField and edit_inline

2006-12-18 Thread Rob Slotboom
Maybe we should create some kind of pressure group for this :-) I don't have any idea who can be consulted for this subject, do you? Cheers, Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

extra field in edit_inline

2006-12-19 Thread Rob Slotboom
This is my model and it works in Admin due to the efforts of Antoni. (see link at the bottom) What I want to do is to add a collumn to the inline editing list representing some field from the related content_object. Is there an easy way to do this? class Category(models.Model): name = models.

Re: generic relation | contenttypes issue

2006-12-19 Thread Rob Slotboom
Please provide your model. Something is wrong with the tags attribute. Rob --~--~-~--~~~---~--~~ 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

Re: Reverse ForeignKey lookups

2006-12-19 Thread Rob Slotboom
Hi Cathy, Chris is right. User in entrystatus is a relation to User. This isnt't the same as a 'normal' field like Name or Title. Look at these: Entry.objects.filter(blog__id__exact=3) # Explicit form Entry.objects.filter(blog__id=3) # __exact is implied Entry.objects.filter(blog__pk=3) # __pk i

custom manipulator in admin

2006-12-19 Thread Rob Slotboom
For a model I want to add a custom manipulator which can be used in the admin. With this manipulator I want to be able to add an extra formfield for displaying some additional data from a related object. There is no need for database storage. In this group I red that it isn't possible to extend

Re: custom manipulator in admin

2006-12-20 Thread Rob Slotboom
On 20 dec, 10:54, "patrick k." <[EMAIL PROTECTED]> wrote: do it like in any other application: custom view, custom template, change urls Hi Patrick, That's exactely what I wanted to know for one exception. How to call the custom view when using admin.? By overriding the 'default' call: (r'^a

Re: custom manipulator in admin

2006-12-20 Thread Rob Slotboom
Hello Aidas, Exactly. You answered your question yourself. Seems I'm on the right way then :-) Thanks for anwering, I'll give it a try. Regards, Rob --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django us

including a template in itself

2006-12-30 Thread Rob Slotboom
I've a template which will be included. Within the template I want to include it again if needed. child_list.html {% if categorie %} {{ categorie.title }} {% if categorie.child_set.all %} {% for categorie in categorie.child_set.all %} {% include "child_list.html" %}

special characters in model

2006-12-31 Thread Rob Slotboom
In my model I need a special character for the verbose_name_plural. I need an ë but admin gives a questionmark. What do I need to do? The folowing things don't work. verbose_name_plural = 'categoriën' verbose_name_plural = 'categoriën' verbose_name_plural = 'categori%sn' % chr(235) --~--~---

admin > custom error message

2007-01-08 Thread Rob Slotboom
Given this save function in one of my models, I want to display an error message in admin instead of a errorpage. def save(self): try: cur_id = int(self.id) except: cur_id = 0 p_list = self._recurse_for_parents(self) cats = Category.objects.filter(folder__ex

Re: admin > custom error message

2007-01-09 Thread Rob Slotboom
Hi James, When I write a custom validator like: isValidCategory() I need a manipulator, validator and a form. Is there a way to use the 'current' ones and to expand these or do I need to create them from scratch? --~--~-~--~~~---~--~~ You received this message b

Re: admin > custom error message

2007-01-09 Thread Rob Slotboom
Thanks James, I'll try this one def IsUniqueForPath(): ... class Category(models.Model): ... parent = models.ForeignKey('self', blank=True, null=True, related_name='child_set', validator_list=[IsUniqueForPath]) --~--~-~--~~~---~--~~ You received this message

Re: admin > custom error message

2007-01-09 Thread Rob Slotboom
Hmm, I wrote this in my models.py. Errors rased are just for debugging. class HasUniquePath(object): def __init__(self, cat_obj, error_message=gettext_lazy("No unique path!")): self.cur_cat = cat_obj self.error_message = error_message self.always_test = True def __call__

sorting the results of a queryset

2007-01-09 Thread Rob Slotboom
My model uses a single table parent-child relationship. I got the parent representation working but I isn't sorted right. So I tried to sort the list of objects, returned by objects.all() in the model class: def __cmp__(self, other): return cmp(self.get_absolute_url, other.get_absolute_

Re: sorting the results of a queryset

2007-01-10 Thread Rob Slotboom
Sorted works great but I have problems using it im my custom manager. I'm trying and trying but I can't figure out how to handle the following situation. class SortedTestcatManager(models.Manager): def get_query_set(self): QS = super(SortedTestcatManager, self).get_query_set() SQS

Re: sorting the results of a queryset

2007-01-11 Thread Rob Slotboom
And of course a new kind of sorting function. Thank's to 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 unsubscri

Re: admin > custom error message

2007-01-11 Thread Rob Slotboom
Hi James et all, Because of what I want it isn't possible to just rely on a validator, I need a manipulator to get a request object. The manipulator only has to add an extra validator to one field. This validator validates using the database. No custom form is needed. The manipulator will be use

Custom manipulator, default form?

2007-01-16 Thread Rob Slotboom
For one of my models I need to do some extra validation. Because of what I want it isn't possible to just rely on a validator, I need a manipulator to get a request object. The manipulator only has to add an extra validator to one field. This validator validates using the database. No custom for

ImageField Question

2007-01-22 Thread Rob Slotboom
"Like FileField, but validates that the uploaded object is a valid image. Has two extra optional arguments, height_field and width_field, which, if set, will be auto-populated with the height and width of the image each time a model instance is saved." So I made this model: class Foto(models.Mod

slicing an loops

2007-01-24 Thread Rob Slotboom
Kamil Wdowicz wrote regarding to handling loops: {% for a in list|slice:"1" %} {{ something }} {% endfor %} {% for a in list|slice:"1:3" %} {{ something }} {% endfor %} {% for a in list|slice:"3:" %} {{ something }} {% endfor %} What can be done to fill a table with a given list? --~--

define odd, even in a loop

2007-01-26 Thread Rob Slotboom
{% ifequal forloop.counter 1 %}odd{% endifequal %} {% ifequal forloop.counter 3 %}odd{% endifequal %} {% ifequal forloop.counter 5 %}odd{% endifequal %} Is there a way to calculate this kind of thing, something like: {% ifodd forloop.counter %}I am very odd{% endifodd %} --~--~-~--~

Re: define odd, even in a loop

2007-01-27 Thread Rob Slotboom
This is working great, thanks!! While on it, there are more filter like solutions for instance ADD. Is there also something like DIVIDE, MULTIPLY etc? Or can these be custom made? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Go

block.super

2007-01-29 Thread Rob Slotboom
On my base template I have a block, say X One level down there is a section template (extending base) overwriting block X Further down there are templates (extending section). On these templates I want to be able to get the original value of X. I tried {{ block.super }} {{ block.super.super

fiter for week

2007-01-30 Thread Rob Slotboom
Before re-inventing, I want to ask if there is some build-in for getting objects for [a || this] week. Something like: objects.filter(pubdate__week=now.week) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djang

Filtering foreign items in admin

2007-02-09 Thread Rob Slotboom
For a several models I use a FK to photos. The drop down in admin to choose from lists all photos. Can this list be filtered so I can restrict the available photos for some models? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the G

Re: block.super

2007-02-12 Thread Rob Slotboom
Sorry that isn't working (at least not in my template ) --~--~-~--~~~---~--~~ 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 t

Re: fiter for week

2007-02-12 Thread Rob Slotboom
For those interested: ### INIT ### import datetime, time from django.http import Http404 def trans_month(month): """Vertaald de locale maandweergave naar globale""" if month == "maa": month = "mar" elif month == "mei": month = "may" elif month == "okt": month = "oct" return mont

When to restart Apache?

2007-02-12 Thread Rob Slotboom
When running Django using mod_python you have to restart Apache whenever you make changes to your code. Some changes don't require a restart so I wonder which changes trigger mod_python to reload and which don't. --~--~-~--~~~---~--~~ You received this message bec

Re: Installation Question

2007-02-12 Thread Rob Slotboom
Also beware that mod_php can give you session troubles on some systems. --~--~-~--~~~---~--~~ 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 uns

admin > site

2006-03-03 Thread Rob Slotboom
Hi guys, Can someone please tell me what can be done with the site feature in admin? And now I'm on it: from the ducumentation I understand that it is possible to use admin interface parts in your own apps by calling classes. Am I correct? --~--~-~--~~~---~--~~ Y

Re: Creating a menu structure

2006-03-03 Thread Rob Slotboom
To create hierarchical menu's, the first thing I thought about was some kind of parent child relation on just one table but then you have to submit many queries. A better approach wil be the Modified Preorder Tree Traversal. See: http://www.sitepoint.com/print/hierarchical-data-database On the Dj

getting a model's content_type_id

2006-03-06 Thread Rob Slotboom
Is there a way to get a model's content_type_id? I need it to store an object's id and content_type_id in another table. Currently I solved this by using an sql-statement but maybe there is some 'hidden' property or function like: self.content_type or self.get_content_type --~--~-~--~--

stringformat in template

2006-03-08 Thread Rob Slotboom
I tried to use stringformat within a template but without success. This is what I want in 'normal' syntax': return "%.2f" % total_amount It returns a two decimal value. But how to use it in the template??? --~--~-~--~~~---~--~~ You received this message because

Getting an object' content_type_id

2006-03-09 Thread Rob Slotboom
Is there a way to get an object's content_type_id? I need it to store an object's id and content_type_id in another table. Currently I solved this by using an sql-statement but maybe there is some 'hidden' property or function like: self.content_type or self.get_content_type --~--~-~--

Re: stringformat in template

2006-03-09 Thread Rob Slotboom
Dear Geert, I entered {{ total_amount|stringformat:".2f" }} and it realy worked :-) Actualy I red the STRINGFORMAT docu but I didn't get the clue. Now I do... Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

Template question

2006-03-10 Thread Rob Slotboom
Is it possible to add some initial value to a forloop.counter? This would be handy when using limit and offset. More general, is is possible to use template vars as values for calculations: {{ var1 }} + {{ var 2 }} --~--~-~--~~~---~--~~ You received this message

Breaking up long lists

2006-03-10 Thread Rob Slotboom
I've added an example view and template at: http://code.djangoproject.com/wiki/CookBookViews Good luck. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Re: Breaking up long lists

2006-03-11 Thread Rob Slotboom
I don't know. I'll have a look. --~--~-~--~~~---~--~~ 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

Re: Template question

2006-03-12 Thread Rob Slotboom
Hi Malcolm, {{forloop.counter|add:offset}} works fine. Thanks, Rob --~--~-~--~~~---~--~~ 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 unsubs

Re: Template question

2006-03-12 Thread Rob Slotboom
Thank you, I'll have a look. --~--~-~--~~~---~--~~ 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 [EM

Q about wizard.form.forms

2013-02-22 Thread Rob Slotboom
Hi, Django’s documentation shows a sample form wizard template. In that template there is a conditional tag: {% if wizard.form.forms %}{% else %} I can’t figure out when this condition will ever by met. Does sombody have a clue? Cheers and happy coding, Rob -- You received this message b

Re: Q about wizard.form.forms

2013-02-24 Thread Rob Slotboom
Babatunde wrote: It is satisfied when the step contains a formset -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. T