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
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
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
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
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',
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
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
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
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
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
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
--~--~-~--~~~--
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
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
-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
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
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
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.
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
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
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
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
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
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
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
>
> 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
(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
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
[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
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
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
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
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
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
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. 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! -
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
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
*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 + 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
> 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
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
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
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(
> 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
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
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
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
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
48 matches
Mail list logo