How to Display 2 items of an Object

2007-05-17 Thread robo
Hi everyone, I've set up my code to display a page that shows all categories and projects belonging to each category. Pseudo code like so: for category in category for project in project ifequal project.category_id category.id {{project.title}} endifequal endfor endfor Right no

Re: how to limit foreign key choices by current user?

2007-05-17 Thread Doug B
You can't limit choice like that. The choices specified there are evaluated only when the model is first evaluated (module load time). What you need to do is limit the options displayed to the user via form choices assigned in your view. So you might do something like this (I'm half asleep, but

how to limit foreign key choices by current user?

2007-05-17 Thread jonathan_ou
Suppose I have a model class that has a foreign key field, something like the following: class example_model(models.Model): apple = models.ForeignKey(Apple) owner = models.ForeignKey(User) where Apple is created by authenticated users. So at any given time, there may be mult

Re: rendering files in markdown

2007-05-17 Thread Milan Andric
So these will definitely take care of the backend and rendering. But on the admin frontend all I'm using is the normal builtin stuff. So the child File objects appear below the Pages they're part of when you edit a Page. And you just grab the link from the file object and drag it into the text a

Solution to multiple models on one form?

2007-05-17 Thread David Priest
It occurs to me that were I able to write the following: models_list = ( 'project.app1.models.Claim', 'project.app2.models.Vendor') fields_list = ( 'Claim.vendor', 'Task.title', 'Task.description',

Re: rendering files in markdown

2007-05-17 Thread Milan Andric
On May 17, 5:34 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 5/17/07, Milan Andric <[EMAIL PROTECTED]> wrote: > > > So how would i extend the markdown filter? > > > Would this be better handled in another place, better way or different > > module? > > Shameless self-promotion: I wrote a li

Exending generic view

2007-05-17 Thread [EMAIL PROTECTED]
I want to pass extra info to a generic view. Problem is, I don't want a single chunk of data, I want to append info to the queryset I'm returning (to know which topics are new). I have: def topic_list(request, forum_slug, pagination_id=1): try: forum = Forum.objects.get(fo

Re: rendering files in markdown

2007-05-17 Thread Michael Lake
James Bennett wrote: > On 5/17/07, Milan Andric <[EMAIL PROTECTED]> wrote: > >>So how would i extend the markdown filter? >>Would this be better handled in another place, better way or different >>module? > > Shameless self-promotion: I wrote a little app a while back which is > designed to make

Re: rendering files in markdown

2007-05-17 Thread James Bennett
On 5/17/07, Milan Andric <[EMAIL PROTECTED]> wrote: > So how would i extend the markdown filter? > > Would this be better handled in another place, better way or different > module? Shameless self-promotion: I wrote a little app a while back which is designed to make this sort of thing much easie

Re: rendering files in markdown

2007-05-17 Thread Michael Lake
Milan Andric wrote: > Hello, > > I'm using markdown as an output filter in my templates. > > I'd like to extend it somehow so that it can parse a ![][123] image > reference but the reference number will be a file object id or a > inline reference, etc. So then the object would get rendered > ap

active tray

2007-05-17 Thread Evgeny
Hi, I have a coupon code, allowing everybody of you to register Active Tray with a 10% discount. Active Tray is a must-have shell extension increasing your productivity when working on the pc. Here's it: ATCP-WDL0-TH URL: http://www.activetray.com Evgeny --~--~-~--~~~--

Authenticating w Apache

2007-05-17 Thread cwurld
Hi, I am trying to implement the code in the django docs called: Authenticating against Django's user database from Apache I am not having much luck. The field req.user that is sent to the mod_python module is always empty. Do I need to put an .htaccess file into the dir that I am trying to pro

Re: nested dictionaries in templates

2007-05-17 Thread Aidas Bendoraitis
Hi Sven! To get a value from a dictionary by a variable key, you either need a custom filter like {{ dictionary|dict_value:key }} def dict_value(dict, key): """ returns the value of a dictionary key ... """ try: return dict[key] except: return None register.filte

nested dictionaries in templates

2007-05-17 Thread Sven Herzing
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I'm sorry that I have to ask again for help, but, I couldn't figure it out how to access nested directories in templates. My Problem ist, that I have 3 categories (which I get from the DB), and for every category a queryset. and the structure l

Re: Aggregate function in django

2007-05-17 Thread Brian Beck
On May 17, 7:47 am, Brij <[EMAIL PROTECTED]> wrote: > Please help me getting the django database api for this query which i > can use in the my view and send the object to my template to display > the result Hi, check out this snippet I posted that tries to make similar SQL like this reusable. Un

Django/Python developer at The Atlanta Journal-Constitution

2007-05-17 Thread Chris H.
Our online development team is looking for experienced Python/Django Web developers. We're a small group practicing agile and rapid development. We "Get Real", got Django and Rails, and we're perfectionists with deadlines! This is not a typical, "hand me a spec and I'll build it" shop. We play

Re: extending newforms Field and Form classes

2007-05-17 Thread Malcolm Tredinnick
On Thu, 2007-05-17 at 12:51 -0700, Dannoo wrote: > Malcolm, > > Thanks for the quick understandable response. > > So in order to this I would create two classes: > - one a widget class that overrides render method - to create the > comma delimited string from the value ( a list of string ) sent.

Re: extending newforms Field and Form classes

2007-05-17 Thread Dannoo
Malcolm, Thanks for the quick understandable response. So in order to this I would create two classes: - one a widget class that overrides render method - to create the comma delimited string from the value ( a list of string ) sent. - one a field class that overrides the clean method - to creat

Re: manage.py setting sys.path wrong

2007-05-17 Thread birkin
On May 17, 1:22 pm, Baurzhan Ismagulov <[EMAIL PROTECTED]> wrote: ... > bash-2.05$ PYTHONPATH=/export/home/myusername/django_src python manage.py ... That's it! Thanks *very* much. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: offset without limit: slicing behaviour

2007-05-17 Thread patrick k.
answering myself: it still works, but allow_empty has to be false when using generic views. patrick. Am 17.05.2007 um 21:16 schrieb patrickk: > > before doing a django-update today, this has been working: > > {% for object in object_list|slice:"0::3" %} > ... left column > > {% for object in

offset without limit: slicing behaviour

2007-05-17 Thread patrickk
before doing a django-update today, this has been working: {% for object in object_list|slice:"0::3" %} ... left column {% for object in object_list|slice:"1::3" %} ... middle column {% for object in object_list|slice:"2::3" %} ... right column now, I´m getting: Assertion Error: 'offset' is no

Re: extending newforms Field and Form classes

2007-05-17 Thread Malcolm Tredinnick
On Thu, 2007-05-17 at 11:58 -0700, Dannoo wrote: > I have a few questions about the best ways to extend the Field and > Form classes that are part of django newforms. > > For example, create a Field that is like a charField but gets a list > of strings which should be rendered as a comma delimite

extending newforms Field and Form classes

2007-05-17 Thread Dannoo
I have a few questions about the best ways to extend the Field and Form classes that are part of django newforms. For example, create a Field that is like a charField but gets a list of strings which should be rendered as a comma delimited in the text widget. When that filed is cleaned the comma

Urgent requirements

2007-05-17 Thread delhi job bank
Urgent requirements Pls sends your CV in www.allindiajobbank.com website. It is fast and gives U positive response. Pls pass this message to Ur friend also because vacancies are waiting. IT MANAGER Rishikesh,Uttara Khand Experienced person for smooth functioning of Property Management Sof

Re: Scalability / Traffic-Volume Numbers

2007-05-17 Thread Tim Chase
> > StartServers 2 > MaxClients 50 > MinSpareThreads10 > MaxSpareThreads 25 > ThreadsPerChild 25 > MaxRequestsPerChild 0 > > > It still starts up 29 processes as given by: > # ps -e | grep apache2 | wc > 29 116 928 Well, my first thought is, if you omi

Re: Scalability / Traffic-Volume Numbers

2007-05-17 Thread Caz
(Posting attempt no 3, apologies for duplicates) I run 3 sites on my vps at www.redwoodvirtual.com Here's some stats for a vps with 64meg ram and 64meg swap Here's the output of top: top - 16:31:30 up 53 days, 4:19, 1 user, load average: 0.09, 0.35, 0.79 Tasks: 64 total, 1 running, 57 sle

Re: Tricky context question

2007-05-17 Thread Nicola Larosa
Wolfram Kriesing wrote: > thank you very much. > the important piece here was the "translation.get_language()" i oversaw that > ... You may also want to look at the django-multilingual project: http://code.google.com/p/django-multilingual/ -- Nicola Larosa - http://www.tekNico.net/ Bill suc

Re: Django Book, how did you do that?

2007-05-17 Thread Nicola Larosa
[EMAIL PROTECTED] wrote: > I am interested in the code / project behind the DjangoBook so I can > do something similar. Notice the note at the bottom of the help page: http://www.djangobook.com/comment-help/ It points to Jack Slocum's blog, click on one of the entries to see the same commenting

Re: rendering files in markdown

2007-05-17 Thread Malcolm Tredinnick
On Thu, 2007-05-17 at 17:12 +, Milan Andric wrote: > Hello, > > I'm using markdown as an output filter in my templates. > > I'd like to extend it somehow so that it can parse a ![][123] image > reference but the reference number will be a file object id or a > inline reference, etc. So then

Re: rendering files in markdown

2007-05-17 Thread Jeremy Dunck
On 5/17/07, Milan Andric <[EMAIL PROTECTED]> wrote: ... > So how would i extend the markdown filter? > > Would this be better handled in another place, better way or different > module? Django's filter just uses Python Markdown. Here're tips to extending Markdown and altering Django to use those

Re: rendering files in markdown

2007-05-17 Thread Milan Andric
Thanks! Someone in IRC also recommended writing another template filter and passing it through there before going to markdown. So between all these solutions, I'll come up with something. -- Milan --~--~-~--~~~---~--~~ You received this message because you are

Re: manage.py setting sys.path wrong

2007-05-17 Thread Baurzhan Ismagulov
Hello birkin, On Thu, May 17, 2007 at 09:25:41AM -0700, birkin wrote: > bash-2.05$ python ./manage.py > Traceback (most recent call last): > File "./manage.py", line 2, in ? > from django.core.management import execute_manager > ImportError: No module named django.core.management ... > PYTH

rendering files in markdown

2007-05-17 Thread Milan Andric
Hello, I'm using markdown as an output filter in my templates. I'd like to extend it somehow so that it can parse a ![][123] image reference but the reference number will be a file object id or a inline reference, etc. So then the object would get rendered appropriately and dynamically from the

Re: manage.py setting sys.path wrong

2007-05-17 Thread birkin
Hi all, Lukas' problem was solved thanks to your efforts, but I have the same error message that I can't figure out. Apologies for the long post; I thought the info might be useful. Thanks in advance. -Birkin -> Simple description of problem: bash-2.05$ bash-2.05$ python ./manage.py Traceback

Win cash Rs.5,000.

2007-05-17 Thread jack nicole
Win cash Rs.5,000. SMS BLUFF to 7333 (India Only) Free registration! - http://offr.biz/HLDDT276377ZTPYJEK > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Call or Send SMS to any phone anywhere in the world Free!

2007-05-17 Thread jack nicole
Call or Send SMS to any phone anywhere in the world Free! - http://offr.biz/HLGB7276377ZTPYJEK --~--~-~--~~~---~--~~ 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@go

Make $0.45 - $0.75 per Hour Just For Leaving your Computer On!

2007-05-17 Thread jack nicole
This is an awesome program. Monthly Payouts to e-gold, Stormpay, and PayPal between the 1st and 15th of each month. The autosurf program will go dead every 4 hours or so, but you can log back on right away. Don't wait, start surfing today, I made $50 in a week already. That is with not su

earn $10 atleast everyday!!!no hassles as easy as cliking ur mouse buttons

2007-05-17 Thread jack nicole
*THE NEXT BIG INTERNET WAVE ….. * * * *VERY HOT* Hi everyone! 100% FREE,Get Paid To Surf The Net Ride The Next Big Internet Wave This note is mainly to offer you a chance to help build AGLOCO – it is a Member-owned Internet community. If you haven't yet heard about AGLOCO, you need to listen up

Free cPanel web hosting for your Domain! 100 MB Web Space

2007-05-17 Thread jack nicole
Free cPanel web hosting for your Domain! 100 MB Web Space + Email + MySQL Database + FTP Access & More - http://offr.biz/HLHCM276377ZTPYJEK --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: Aggregate function in django

2007-05-17 Thread Tim Chase
> I have two class models i.e > > class Objective(models.Model): > objName = models.CharField("Name", maxlength=100) > objDescription = models.TextField("Description") > > class ObjectiveSetting(models.Model): > employee = models.IntegerField("Employee Code") > objectives = model

Re: derived fields on a form

2007-05-17 Thread Yaron Buskilla
For Example : Class Student, Class Grade. Define a function to get this student average. Class Student(models.Model): name = models.Integer() def getAvrageGrades( self ): sum = 0 for grade in self.grades_set.all(): sum = sum + grade.grade totalGrades = self.grades_set.count() if(totalGrade

Re: derived fields on a form

2007-05-17 Thread 5264277-ew5264277
Hi, Thanks, could you give me an example ? Andrew > Hi Andrew, > > Calculated fields will not be stored in the database. > If you want to calculate something then create a function inside the > model which will return the expected result. > This function will calculate things about one or mor

Aggregate function in django

2007-05-17 Thread Brij
Hi, I have two class models i.e class Objective(models.Model): objName = models.CharField("Name", maxlength=100) objDescription = models.TextField("Description") class ObjectiveSetting(models.Model): employee = models.IntegerField("Employee Code") objectives = models.ForeignKey(

Re: Many2Many question about Database API

2007-05-17 Thread Ben Jones
> Apparently it's a bug in the version of sqlite that's bundled with the > Windows installer (3.3.4). The Python 2.5 installer, that is. . . -- -Ben --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django use

Re: derived fields on a form

2007-05-17 Thread Yaron Buskilla
Hi Andrew, Calculated fields will not be stored in the database. If you want to calculate something then create a function inside the model which will return the expected result. This function will calculate things about one or more attributes of the model. Well if you do so, then you do not ne

Re: derived fields on a form

2007-05-17 Thread Yaron Buskilla
Hi Andrew, Calculated fields will not be stored in the database. If you want to calculate something then create a function inside the model which will return the expected result. This function will calculate things about one or more attributes of the model. Well if you do so, then you do not

derived fields on a form

2007-05-17 Thread 5264277-ew5264277
Hi All, Is it possible to have a value in a model class that is displayed as either a data entry box, or just plain text that does not have a corresponding entry in the database ? Lets say I have a list of numbers that I want to perform a calculations on (say the sum or average etc) how would I

Re: Constraints to a model

2007-05-17 Thread Nathan Harmston
Is it easy to then enforce this in admin, so if an attempt is made to save a post with no article or gallery then the admin page stages whoops and does the highlighting of fields like it would do normally? Many Thanks Nathan On 16/05/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > The simp