Re: getting objects unique in several ways (annotate?)

2011-07-04 Thread elliot
Michal's answer does not work.   For each book, I want fields from one
of its Transactions.  .values('pk') gives the book's pk (no
relationship to Transaction) and .values('transaction__recipient')
does not work either.

I dont know squat about writing queries in sql, so extra doesn't help
me.  When coming at it from the other side of the relationship, I
can't see how to get just one transaction for each book.  Doing it the
above way, the database finds the one transaction per book, but wont
tell me the pk or any other information about that transaction.
Coming from the other side, it would be easy to order the transactions
by book__pk and then date, and then use a foor loop to grab the most
recent transaction for each book.

Using the for loop, I'll need to make sure to not hit the db for every
iteration.  Otherwise, I dont think this would be intolerably slow.

-- 
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 on django-admin.py startproject

2011-07-04 Thread bruno desthuilliers
On Jul 3, 10:39 pm, ravinder singh  wrote:
> plz upgrade ur system than try to run

Please stop giving clueless advices (and quit that l33t speak too, it
doesn't make you look 'kewl').

-- 
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 on django-admin.py startproject

2011-07-04 Thread bruno desthuilliers
On Jul 3, 5:46 pm, Phil  wrote:
> Thanks for all the comments everyone, it's a great help.
>
> Yes I have more than one python installed, when I got the server it
> had python2.4 and I read the latest django stopped supporting 2.4 so I
> installed python2.7 after reading this(also it said not to delete
> python2.4 because 'yum' needs it to survive).

Yeps, uninstalling your system's Python is usually a *very* bad idea
(unless you want a broken system, of course).

> But I had already
> installed django when I just had 2.4. So I reinstalled django after
> installing python2.7, but it is still obviously pointing to wrong
> python version.

> Is it now just a matter of me changing the top line in my 'django-
> admin.py' file to point to correct python version, something like?...
>
> #! /path/to/python2.7/env python2.7
>
> If yes, how do I find correct path to python2.7

how did you install python 2.7 ?


Also and FWIW, this has nothing to do with django so this discussion
would be better on comp.lang.python

HTH

-- 
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: Sidebars

2011-07-04 Thread Venkatraman S
Hi Cal,

Basically, i had to show some links by the side of the page(not the "MAIN"
content) and was wondering whether there was some consistent and elegant way
of doing this. I could change the styling of the sidebar and this could
potentially break in some pages and it was a pain to make the edits in all
pages.

I used a variant of your solution : i put the sidebar html in a separate
file(say sidebar.html) , and included it from each of the pages, passing the
active tab. Check for the tab in sidebar.html and suitably render the links
or content based on this.

Thanks.

-V

On Mon, Jun 27, 2011 at 5:24 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> Can I just clarify what you mean by sidebar?
>
> I assume you are talking about a html element with some options inside it,
> to allow you to navigate through the site?
>
> This is (personally) how I'd do it, although others may prefer a different
> style (you could probably go as far to make this whole thing "classy").
>
> (hand typed code, may need re-writing)
>
> --- views.py ---
> page = "dashboard/help/users"
>
> RequestContext(request, {
> 'section' : page.split("/")
> }
>
> --- layout.html ---
> {% if section.0 = 'dashboard' %}
> display stuff relating to dashboard only
> {% if section.1 = 'help' %}
> display stuff relating to dashboard/help only
> {% endif %}
> {% endif %}
>
> On Mon, Jun 27, 2011 at 6:27 AM, Venkatraman S  wrote:
>
>> Hi,
>>
>> I was looking for possible suggestions in implementing sidebars - i have a
>> truck load of screens and need the sidebar to change dynamically base don
>> the view. Most of the siderbar-conten is just links.
>>
>> I was thiking of including the various sidebar options in the base.html
>> and then include a flag to check whether it has to be rendered or not; and
>> in the view pass the relevant flag.
>>
>> Any other ideas?
>>
>> -venkat
>>
>> --
>> 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.
>

-- 
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 on django-admin.py startproject

2011-07-04 Thread Tim Diggins
I think it helps you to use virtualenv when using django on a machine
with multiple pythons (it's a great tool anyway, but this is an extra
reason).

the trick is to use virtualenv's -p argument when creating the
environment, to specify the path to the python executable.
so, in summary:

1) install virtualenv[1] (in any python - whatever one works on the
command line - maybe by installing the python-virtualenv package on
your packaging system. Depending on your packaging system, you may
need to then upgrade it (using pip, which virtualenv automatically
installs: pip install --upgrade virtualenv)
2) create a virtualenv
virtualenv -p /path/to/python2.7 /some/new/path/for/env
3) activate the virtualenv in your shell
/some/new/path/for/env/bin/activate
4) install django using that environment
(it will pick up the python in the shell - you can also I think use
pip with a subversion repos[2], but I haven't done that).
[1]http://pypi.python.org/pypi/virtualenv
[2]http://www.pip-installer.org/en/latest/requirement-format.html


On Jul 4, 9:26 am, bruno desthuilliers 
wrote:
> On Jul 3, 5:46 pm, Phil  wrote:
>
> > Thanks for all the comments everyone, it's a great help.
>
> > Yes I have more than one python installed, when I got the server it
> > had python2.4 and I read the latest django stopped supporting 2.4 so I
> > installed python2.7 after reading this(also it said not to delete
> > python2.4 because 'yum' needs it to survive).
>
> Yeps, uninstalling your system's Python is usually a *very* bad idea
> (unless you want a broken system, of course).
>
> > But I had already
> > installed django when I just had 2.4. So I reinstalled django after
> > installing python2.7, but it is still obviously pointing to wrong
> > python version.
> > Is it now just a matter of me changing the top line in my 'django-
> > admin.py' file to point to correct python version, something like?...
>
> > #! /path/to/python2.7/env python2.7
>
> > If yes, how do I find correct path to python2.7
>
> how did you install python 2.7 ?
>
> Also and FWIW, this has nothing to do with django so this discussion
> would be better on comp.lang.python
>
> HTH

-- 
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.



unique_together doesn't work

2011-07-04 Thread Szabo, Patrick (LNG-VIE)
Hi, 

 

I have the following model: 

 

class Produkte(models.Model):

Kategorie = models.ForeignKey(Kategorien)

Titel = models.CharField(max_length=100)

Auflage = models.IntegerField(max_length=2, blank=True)

Bestell_Nr = models.CharField(max_length=30, blank=True)

ISBN = models.CharField(max_length=30, blank=True)

Autor = models.CharField(max_length=50, blank=True)

Status = models.IntegerField(max_length=1, blank=False, default=1)



def __unicode__(self):

if self.Auflage:

return "%s %s" % (self.Titel, self.Auflage)

else:

return self.Titel



class Meta:

db_table = 'tb_Produkte'

verbose_name_plural = "Produkte"

verbose_name = "Produkt"

unique_together = ("Kategorie", "Titel", "Auflage", "Status")

 

but somehow the unique_together doesn't seem to work. I can store
entries with the same titel without a problem. 

 

Am I doing something wrong ?!

 

greets


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: 00431 534521573 
Fax: +43 (1) 534 52 - 146 





-- 
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: unique_together doesn't work

2011-07-04 Thread Tom Evans
On Mon, Jul 4, 2011 at 10:33 AM, Szabo, Patrick (LNG-VIE)
 wrote:
> Hi,
> ...
> class Meta:
>     unique_together = ("Kategorie", "Titel", "Auflage", "Status")
>
> but somehow the unique_together doesn’t seem to work. I can store entries
> with the same titel without a problem.
>
>
>
> Am I doing something wrong ?!
>

That's not what unique_*together* means - you can't have two entries
with the same category, title, condition and status. Eg you can have
two entries with the same title, as long as they have different
category, condition or status.

Cheers

Tom

-- 
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: unique_together doesn't work

2011-07-04 Thread Kenneth Gonsalves
On Mon, 2011-07-04 at 11:33 +0200, Szabo, Patrick (LNG-VIE) wrote:
> but somehow the unique_together doesn't seem to work.

what does 'doesn't seem to work' mean?
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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.



AW: unique_together doesn't work

2011-07-04 Thread Szabo, Patrick (LNG-VIE)
Hi, 

Sry, i was a little bit unclear. 
Of course i tried to store identical entries (all fields have the same values) 
and i had no problem doing so.  Since most of the files i want to check for can 
be null i only inputet a titel.


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: 00431 534521573 
Fax: +43 (1) 534 52 - 146 


-Ursprüngliche Nachricht-

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Tom Evans
Gesendet: Montag, 04. Juli 2011 11:38
An: django-users@googlegroups.com
Betreff: Re: unique_together doesn't work

On Mon, Jul 4, 2011 at 10:33 AM, Szabo, Patrick (LNG-VIE)
 wrote:
> Hi,
> ...
> class Meta:
> unique_together = ("Kategorie", "Titel", "Auflage", "Status")
>
> but somehow the unique_together doesn't seem to work. I can store entries
> with the same titel without a problem.
>
>
>
> Am I doing something wrong ?!
>

That's not what unique_*together* means - you can't have two entries
with the same category, title, condition and status. Eg you can have
two entries with the same title, as long as they have different
category, condition or status.

Cheers

Tom

-- 
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.



AW: unique_together doesn't work

2011-07-04 Thread Szabo, Patrick (LNG-VIE)
Well like i sad (i guess i did) i can still storey entries that are not unique


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: 00431 534521573 
Fax: +43 (1) 534 52 - 146 


-Ursprüngliche Nachricht-

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Kenneth Gonsalves
Gesendet: Montag, 04. Juli 2011 11:40
An: django-users@googlegroups.com
Betreff: Re: unique_together doesn't work

On Mon, 2011-07-04 at 11:33 +0200, Szabo, Patrick (LNG-VIE) wrote:
> but somehow the unique_together doesn't seem to work.

what does 'doesn't seem to work' mean?
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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.



Re: AW: unique_together doesn't work

2011-07-04 Thread Kenneth Gonsalves
On Mon, 2011-07-04 at 11:43 +0200, Szabo, Patrick (LNG-VIE) wrote:
> Sry, i was a little bit unclear. 
> Of course i tried to store identical entries (all fields have the same
> values) and i had no problem doing so.  Since most of the files i want
> to check for can be null i only inputet a titel. 

are you using mysql?
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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.



AW: AW: unique_together doesn't work

2011-07-04 Thread Szabo, Patrick (LNG-VIE)
Yes i am. 
It seems that in the fieldset there can not be a field that is allowed to be 
null. 
If i remove that field it works.

Is there a workaround for that ?!


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: 00431 534521573 
Fax: +43 (1) 534 52 - 146 


-Ursprüngliche Nachricht-

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Kenneth Gonsalves
Gesendet: Montag, 04. Juli 2011 11:48
An: django-users@googlegroups.com
Betreff: Re: AW: unique_together doesn't work

On Mon, 2011-07-04 at 11:43 +0200, Szabo, Patrick (LNG-VIE) wrote:
> Sry, i was a little bit unclear. 
> Of course i tried to store identical entries (all fields have the same
> values) and i had no problem doing so.  Since most of the files i want
> to check for can be null i only inputet a titel. 

are you using mysql?
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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.



Re: unique_together doesn't work

2011-07-04 Thread Tom Evans
On Mon, Jul 4, 2011 at 10:43 AM, Szabo, Patrick (LNG-VIE)
 wrote:
> Hi,
>
> Sry, i was a little bit unclear.
> Of course i tried to store identical entries (all fields have the same 
> values) and i had no problem doing so.  Since most of the files i want to 
> check for can be null i only inputet a titel.
>
>

It might have been nice for you to give this example straight up
(although you haven't actually specified the case clearly, I'm still
just guessing).

So you are creating objects, and 3 of the fields that you have said
are unique_together are undefined, and have Null=True in their field
definition? In databases, NULL is not equal to anything, even NULL.
Eg, NULL == NULL is false.

Therefore, 2 rows in the database with the same title, but with NULL
for the other 3 fields in the unique index, would not be considered as
the same row.

Tom

-- 
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.



AW: unique_together doesn't work

2011-07-04 Thread Szabo, Patrick (LNG-VIE)
Thank you all for your help. 
For now i just removed the "ALLOW NULL" on the fields and placed default values.

I have another question but ill post this in a new "thread" because it's not 
related.


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: 00431 534521573 
Fax: +43 (1) 534 52 - 146 


-Ursprüngliche Nachricht-

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Tom Evans
Gesendet: Montag, 04. Juli 2011 11:53
An: django-users@googlegroups.com
Betreff: Re: unique_together doesn't work

On Mon, Jul 4, 2011 at 10:43 AM, Szabo, Patrick (LNG-VIE)
 wrote:
> Hi,
>
> Sry, i was a little bit unclear.
> Of course i tried to store identical entries (all fields have the same 
> values) and i had no problem doing so.  Since most of the files i want to 
> check for can be null i only inputet a titel.
>
>

It might have been nice for you to give this example straight up
(although you haven't actually specified the case clearly, I'm still
just guessing).

So you are creating objects, and 3 of the fields that you have said
are unique_together are undefined, and have Null=True in their field
definition? In databases, NULL is not equal to anything, even NULL.
Eg, NULL == NULL is false.

Therefore, 2 rows in the database with the same title, but with NULL
for the other 3 fields in the unique index, would not be considered as
the same row.

Tom

-- 
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.



Re: AW: AW: unique_together doesn't work

2011-07-04 Thread Kenneth Gonsalves
On Mon, 2011-07-04 at 11:51 +0200, Szabo, Patrick (LNG-VIE) wrote:
> Yes i am. 
> It seems that in the fieldset there can not be a field that is allowed
> to be null. 
> If i remove that field it works.
> 
> Is there a workaround for that ?! 

my observation (subject to correction) is that if there more than two
fields, django leaves it to the database to do the validation. Postgres
throws an exception in case of violation - I do not know about mysql.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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.



change values in "select list"

2011-07-04 Thread Szabo, Patrick (LNG-VIE)
Hi, 

 

I have a forum that looks like this:

 

class ReportingForm_Produkt(ModelForm):

class Meta:

model = Buchung

 

Where Buchung and Produkt looks like this:

 

class Buchung(models.Model):

Mitarbeiter = models.IntegerField(max_length=3)

Produkt = models.ForeignKey(Produkte)

Datum = models.DateField()

Aktivitaet = models.ForeignKey(Aktivitaeten, blank=True)

Minuten = models.PositiveIntegerField(max_length=2)

 

def __unicode__(self):

return str(self.Mitarbeiter) + ' ' + str(self.Datum)



class Meta:

db_table = 'tb_Times'

verbose_name_plural = "Buchungen"

verbose_name = "Buchung"

 

class Produkte(models.Model):

Kategorie = models.ForeignKey(Kategorien)

Titel = models.CharField(max_length=100)

Auflage = models.IntegerField(max_length=2, default=0)

Bestell_Nr = models.CharField(max_length=30, blank=True)

ISBN = models.CharField(max_length=30, blank=True)

Autor = models.CharField(max_length=50, blank=True)

Status = models.IntegerField(max_length=1, blank=False, default=1)



def __unicode__(self):

if self.Auflage:

return "%s %s" % (self.Titel, self.Auflage)

else:

return self.Titel



class Meta:

db_table = 'tb_Produkte'

verbose_name_plural = "Produkte"

verbose_name = "Produkt"

unique_together = ("Kategorie", "Titel", "Auflage", "Status")

 

Now if i include that form into a template, the dropdown only shows the
"Titel" of each objects from "Produkte".  I also want the "Auflage" -
Info to be visible in the drop down.

 

How do i do that ?!

 

greetings


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: 00431 534521573 
Fax: +43 (1) 534 52 - 146 





-- 
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: change values in "select list"

2011-07-04 Thread Tom Evans
On Mon, Jul 4, 2011 at 11:12 AM, Szabo, Patrick (LNG-VIE)
 wrote:
> Hi,
>
>
>
> I have a forum that looks like this:
>
>
>
> class ReportingForm_Produkt(ModelForm):
>
>     class Meta:
>
>     model = Buchung
>
>
>
> Where Buchung and Produkt looks like this:
>
>
>
> class Buchung(models.Model):
>
>     Mitarbeiter = models.IntegerField(max_length=3)
>
>     Produkt = models.ForeignKey(Produkte)
>
>     Datum = models.DateField()
>
>     Aktivitaet = models.ForeignKey(Aktivitaeten, blank=True)
>
>     Minuten = models.PositiveIntegerField(max_length=2)
>
>
>
>     def __unicode__(self):
>
>     return str(self.Mitarbeiter) + ' ' + str(self.Datum)
>
>
>
> class Meta:
>
>     db_table = 'tb_Times'
>
>     verbose_name_plural = "Buchungen"
>
>     verbose_name = "Buchung"
>
>
>
> class Produkte(models.Model):
>
>     Kategorie = models.ForeignKey(Kategorien)
>
>     Titel = models.CharField(max_length=100)
>
>     Auflage = models.IntegerField(max_length=2, default=0)
>
>     Bestell_Nr = models.CharField(max_length=30, blank=True)
>
>     ISBN = models.CharField(max_length=30, blank=True)
>
> Autor = models.CharField(max_length=50, blank=True)
>
>     Status = models.IntegerField(max_length=1, blank=False, default=1)
>
>
>
> def __unicode__(self):
>
>     if self.Auflage:
>
>     return "%s %s" % (self.Titel, self.Auflage)
>
>     else:
>
>     return self.Titel
>
>
>
> class Meta:
>
>     db_table = 'tb_Produkte'
>
>     verbose_name_plural = "Produkte"
>
>     verbose_name = "Produkt"
>
>     unique_together = ("Kategorie", "Titel", "Auflage", "Status")
>
>
>
> Now if i include that form into a template, the dropdown only shows the
> „Titel“ of each objects from „Produkte“.  I also want the „Auflage“ – Info
> to be visible in the drop down.
>
>
>
> How do i do that ?!
>
>
>
> greetings
>


https://docs.djangoproject.com/en/1.3/ref/forms/fields/#modelchoicefield

"""
The __unicode__ method of the model will be called to generate string
representations of the objects for use in the field's choices; to
provide customized representations, subclass ModelChoiceField and
override label_from_instance.
"""

Cheers

Tom

-- 
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.



AW: change values in "select list"

2011-07-04 Thread Szabo, Patrick (LNG-VIE)
Okay my Model now looks like this:

class Produkte(models.Model):
Kategorie = models.ForeignKey(Kategorien)
Titel = models.CharField(max_length=100)
Auflage = models.IntegerField(max_length=2, default=0)
Bestell_Nr = models.CharField(max_length=30, blank=True)
ISBN = models.CharField(max_length=30, blank=True)
Autor = models.CharField(max_length=50, blank=True)
Status = models.IntegerField(max_length=1, blank=False, default=1)

def __unicode__(self):
if self.Auflage:
return "%s %s" % (self.Titel, self.Auflage)
else:
return self.Titel

class Meta:
db_table = 'tb_Produkte'
verbose_name_plural = "Produkte"
verbose_name = "Produkt"
unique_together = ("Kategorie", "Titel", "Auflage", "Status")

class ModelChoiceField(ModelChoiceField):
def label_from_instance(self, obj):
return "%s%i" % obj.Titel, obj.Auflage

but that didn't really change anything :-(


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: 00431 534521573 
Fax: +43 (1) 534 52 - 146 


-Ursprüngliche Nachricht-

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Tom Evans
Gesendet: Montag, 04. Juli 2011 12:19
An: django-users@googlegroups.com
Betreff: Re: change values in "select list"

On Mon, Jul 4, 2011 at 11:12 AM, Szabo, Patrick (LNG-VIE)
 wrote:
> Hi,
>
>
>
> I have a forum that looks like this:
>
>
>
> class ReportingForm_Produkt(ModelForm):
>
> class Meta:
>
> model = Buchung
>
>
>
> Where Buchung and Produkt looks like this:
>
>
>
> class Buchung(models.Model):
>
> Mitarbeiter = models.IntegerField(max_length=3)
>
> Produkt = models.ForeignKey(Produkte)
>
> Datum = models.DateField()
>
> Aktivitaet = models.ForeignKey(Aktivitaeten, blank=True)
>
> Minuten = models.PositiveIntegerField(max_length=2)
>
>
>
> def __unicode__(self):
>
> return str(self.Mitarbeiter) + ' ' + str(self.Datum)
>
>
>
> class Meta:
>
> db_table = 'tb_Times'
>
> verbose_name_plural = "Buchungen"
>
> verbose_name = "Buchung"
>
>
>
> class Produkte(models.Model):
>
> Kategorie = models.ForeignKey(Kategorien)
>
> Titel = models.CharField(max_length=100)
>
> Auflage = models.IntegerField(max_length=2, default=0)
>
> Bestell_Nr = models.CharField(max_length=30, blank=True)
>
> ISBN = models.CharField(max_length=30, blank=True)
>
> Autor = models.CharField(max_length=50, blank=True)
>
> Status = models.IntegerField(max_length=1, blank=False, default=1)
>
>
>
> def __unicode__(self):
>
> if self.Auflage:
>
> return "%s %s" % (self.Titel, self.Auflage)
>
> else:
>
> return self.Titel
>
>
>
> class Meta:
>
> db_table = 'tb_Produkte'
>
> verbose_name_plural = "Produkte"
>
> verbose_name = "Produkt"
>
> unique_together = ("Kategorie", "Titel", "Auflage", "Status")
>
>
>
> Now if i include that form into a template, the dropdown only shows the
> "Titel" of each objects from "Produkte".  I also want the "Auflage" - Info
> to be visible in the drop down.
>
>
>
> How do i do that ?!
>
>
>
> greetings
>


https://docs.djangoproject.com/en/1.3/ref/forms/fields/#modelchoicefield

"""
The __unicode__ method of the model will be called to generate string
representations of the objects for use in the field's choices; to
provide customized representations, subclass ModelChoiceField and
override label_from_instance.
"""

Cheers

Tom

-- 
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.



Re: change values in "select list"

2011-07-04 Thread Tom Evans
On Mon, Jul 4, 2011 at 11:34 AM, Szabo, Patrick (LNG-VIE)
 wrote:
> Okay my Model now looks like this:
>
> ...
>
> but that didn't really change anything :-(
>

That is because you didn't read the documentation I linked you to, and
just tried copy/pasting some code into arbitrary places and then
complain.

Cargo cult programming never ends well. Re-read the documentation, try
to understand what it is telling you, and try again.

Cheers

Tom

-- 
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.



AW: change values in "select list"

2011-07-04 Thread Szabo, Patrick (LNG-VIE)
I was afraid somethig like that would come. 
I did read the doc but i don't really understand it :-(
Could you plz make it a little clearer for me  ?!


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: 00431 534521573 
Fax: +43 (1) 534 52 - 146 


-Ursprüngliche Nachricht-

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Tom Evans
Gesendet: Montag, 04. Juli 2011 12:43
An: django-users@googlegroups.com
Betreff: Re: change values in "select list"

On Mon, Jul 4, 2011 at 11:34 AM, Szabo, Patrick (LNG-VIE)
 wrote:
> Okay my Model now looks like this:
>
> ...
>
> but that didn't really change anything :-(
>

That is because you didn't read the documentation I linked you to, and
just tried copy/pasting some code into arbitrary places and then
complain.

Cargo cult programming never ends well. Re-read the documentation, try
to understand what it is telling you, and try again.

Cheers

Tom

-- 
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.



Re: change values in "select list"

2011-07-04 Thread Tom Evans
On Mon, Jul 4, 2011 at 11:46 AM, Szabo, Patrick (LNG-VIE)
 wrote:
> I was afraid somethig like that would come.
> I did read the doc but i don't really understand it :-(
> Could you plz make it a little clearer for me  ?!
>

You are using a model form. The model form has a model selection in
it. You want the select to have different labels.

Labels on a model selection field come from the __unicode__ method of
the model, or from the label_from_instance of the model field class.

Model forms allow you to specify the classes to use for each model attribute.

Hence:

Define a new class derived from ModelChoiceField (not called ModelChoiceField).
Add a label_from_instance method to the new class
Configure your ModelForm to use this new field instead of ModelChoiceField

All of this is explained in the docs. Read the docs.

Tom

-- 
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.



AW: change values in "select list"

2011-07-04 Thread Szabo, Patrick (LNG-VIE)
Okay I'll try do tot hat...thank's a lot.
I already have this in my model for "Produkte" which holds the FK for that drop 
down:

def __unicode__(self):
if self.Auflage:
return "%s %s" % (self.Titel, self.Auflage)
else:
return self.Titel

So shouldn't this alreay be enough ?!


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: 00431 534521573 
Fax: +43 (1) 534 52 - 146 


-Ursprüngliche Nachricht-

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Tom Evans
Gesendet: Montag, 04. Juli 2011 13:10
An: django-users@googlegroups.com
Betreff: Re: change values in "select list"

On Mon, Jul 4, 2011 at 11:46 AM, Szabo, Patrick (LNG-VIE)
 wrote:
> I was afraid somethig like that would come.
> I did read the doc but i don't really understand it :-(
> Could you plz make it a little clearer for me  ?!
>

You are using a model form. The model form has a model selection in
it. You want the select to have different labels.

Labels on a model selection field come from the __unicode__ method of
the model, or from the label_from_instance of the model field class.

Model forms allow you to specify the classes to use for each model attribute.

Hence:

Define a new class derived from ModelChoiceField (not called ModelChoiceField).
Add a label_from_instance method to the new class
Configure your ModelForm to use this new field instead of ModelChoiceField

All of this is explained in the docs. Read the docs.

Tom

-- 
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.



Re: complex query

2011-07-04 Thread Andre Terra
Hello

First, I must recommend that you use django-taggit, simpletag or any
other tagging app, otherwise you'll just be reinventing the wheel.

As for your question, you should read the aggregation docs. I don't
have the link handy, but this should be correct:
http://django.me/aggregation

Sincerely,
Andre Terra

On 7/3/11, Jonas Geiregat  wrote:
> Hello,
>
> I have the following models
>
> class Book(models.Model):
>   author = models.ManyToManyField(Author)
>   pub_date = models.DateTimeField()
>   ...
>
> class Author(models.Model):
>   tag = models.ManyToManyField(Tag)
>
> class Tag(models.Model):
>   name = models.CharField(max_length=20)
>
> What I want to query for is:
>
> The most used Tags (and their count) for all books who's pub_date is greater
> then today.
>
> I can solve the last part
> Book.objects.filter(pub_date__gt=datetime.date.today())
>
> But how do I count all the tags for all these books ?
>
> Jonas Geiregat
> jo...@geiregat.org
>
>
>
>
>
> --
> 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.
>
>

-- 
Sent from my mobile device

-- 
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: Django {% regroup %} produces duplicate groups

2011-07-04 Thread bruno desthuilliers
On Jul 4, 12:49 am, Federico Maggi  wrote:
> {% block content %}
>   {% regroup object_list|dictsort:"topic" by topic as topic_list %}
>

Remove the dictsort, it's for list of dicts, not model querysets

https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#dictsort

-- 
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: Sidebars

2011-07-04 Thread Cal Leeming [Simplicity Media Ltd]
Ah okay.

On a side note, you could have also used fixed/absolute positioning of
the element, then used jQuery show() and hide() to show the menu bar
if someone clicks on the pull out tab.

Some examples of this on omgpop.com.

Cal

On Mon, Jul 4, 2011 at 9:40 AM, Venkatraman S  wrote:
> Hi Cal,
>
> Basically, i had to show some links by the side of the page(not the "MAIN"
> content) and was wondering whether there was some consistent and elegant way
> of doing this. I could change the styling of the sidebar and this could
> potentially break in some pages and it was a pain to make the edits in all
> pages.
>
> I used a variant of your solution : i put the sidebar html in a separate
> file(say sidebar.html) , and included it from each of the pages, passing the
> active tab. Check for the tab in sidebar.html and suitably render the links
> or content based on this.
>
> Thanks.
>
> -V
>
> On Mon, Jun 27, 2011 at 5:24 PM, Cal Leeming [Simplicity Media Ltd]
>  wrote:
>>
>> Can I just clarify what you mean by sidebar?
>> I assume you are talking about a html element with some options inside it,
>> to allow you to navigate through the site?
>> This is (personally) how I'd do it, although others may prefer a different
>> style (you could probably go as far to make this whole thing "classy").
>> (hand typed code, may need re-writing)
>> --- views.py ---
>> page = "dashboard/help/users"
>> RequestContext(request, {
>>     'section' : page.split("/")
>> }
>> --- layout.html ---
>> {% if section.0 = 'dashboard' %}
>>     display stuff relating to dashboard only
>>     {% if section.1 = 'help' %}
>>         display stuff relating to dashboard/help only
>>     {% endif %}
>> {% endif %}
>>
>> On Mon, Jun 27, 2011 at 6:27 AM, Venkatraman S  wrote:
>>>
>>> Hi,
>>>
>>> I was looking for possible suggestions in implementing sidebars - i have
>>> a truck load of screens and need the sidebar to change dynamically base don
>>> the view. Most of the siderbar-conten is just links.
>>>
>>> I was thiking of including the various sidebar options in the base.html
>>> and then include a flag to check whether it has to be rendered or not; and
>>> in the view pass the relevant flag.
>>>
>>> Any other ideas?
>>>
>>> -venkat
>>>
>>> --
>>> 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.
>
> --
> 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.



AW: change values in "select list"

2011-07-04 Thread Szabo, Patrick (LNG-VIE)
Okay i think i'm close but i can't figure it out.
I did this:

class ReportingForm_ProduktField(ModelChoiceField):
def label_from_instance(self, obj):
return "My Object #%i" % obj.id   


class ReportingForm_Produkt(ModelForm):
Produkt = ReportingForm_ProduktField(Produkte.objects.all())
class Meta:
model = Buchung

I've also tried this:

class ReportingForm_Produkt(ModelForm):
Produkt = forms.ModelChoiceField(ReportingForm_ProduktField, 
Produkte.objects.all())
class Meta:
model = Buchung

Could you plz tell me if i'm even close to the solution or maybe even give me a 
hint on what I'm doing wrong

Sry but this is rly urgent


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: 00431 534521573 
Fax: +43 (1) 534 52 - 146 


-Ursprüngliche Nachricht-

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Tom Evans
Gesendet: Montag, 04. Juli 2011 13:10
An: django-users@googlegroups.com
Betreff: Re: change values in "select list"

On Mon, Jul 4, 2011 at 11:46 AM, Szabo, Patrick (LNG-VIE)
 wrote:
> I was afraid somethig like that would come.
> I did read the doc but i don't really understand it :-(
> Could you plz make it a little clearer for me  ?!
>

You are using a model form. The model form has a model selection in
it. You want the select to have different labels.

Labels on a model selection field come from the __unicode__ method of
the model, or from the label_from_instance of the model field class.

Model forms allow you to specify the classes to use for each model attribute.

Hence:

Define a new class derived from ModelChoiceField (not called ModelChoiceField).
Add a label_from_instance method to the new class
Configure your ModelForm to use this new field instead of ModelChoiceField

All of this is explained in the docs. Read the docs.

Tom

-- 
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.



i save text with html in djanfo admin and when out its ilegible

2011-07-04 Thread Kase
...

example.. y sabe this in django admin in a thextfield

bla bla bla bla bla
more bla bla bla

and in my  page...  show

bla bla bla bla
more bla bla bla bla

is very annoying... and i dont know who to fix it... -- 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: i save text with html in djanfo admin and when out its ilegible

2011-07-04 Thread Kenneth Gonsalves
On Mon, 2011-07-04 at 04:02 -0700, Kase wrote:
> and i dont know who to fix it...

search in the docs for autoescape.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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: i save text with html in djanfo admin and when out its ilegible

2011-07-04 Thread Kase
no... autoescape on dont work
forceescape dont work =/
autoescape off dont work =/

example
{% autoescape on %}
{{grup.grupo}}
{% endautoescape %}

On 4 jul, 06:47, Kenneth Gonsalves  wrote:
> On Mon, 2011-07-04 at 04:02 -0700, Kase wrote:
> > and i dont know who to fix it...
>
> search in the docs for autoescape.
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
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: i save text with html in djanfo admin and when out its ilegible

2011-07-04 Thread Kenneth Gonsalves
On Mon, 2011-07-04 at 05:06 -0700, Kase wrote:
> example
> {% autoescape on %}
> {{grup.grupo}}
> {% endautoescape %} 

{% autoescape off %}
{{grup.grupo}}
{% endautoescape %}
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

-- 
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.



Better documentation on "manage.py validate"

2011-07-04 Thread Thomas Larsen Wessel
From:
https://docs.djangoproject.com/en/1.3/ref/django-admin/#django-admin-validate

it says: django-admin.py validate, Validates all installed models (according
to the INSTALLED_APPS setting) and prints validation errors to standard
output.

Newcomers would expect it to tell of incongruences between the models and
the database schema of those. But it does not.

I think it should be specified, what kind of errors it finds, and in
particular that it does not report these differences.


Thomas

-- 
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: Django {% regroup %} produces duplicate groups

2011-07-04 Thread Federico Maggi
On Mon, Jul 4, 2011 at 13:32, bruno desthuilliers
 wrote:
> On Jul 4, 12:49 am, Federico Maggi  wrote:
>> {% block content %}
>>   {% regroup object_list|dictsort:"topic" by topic as topic_list %}
>>
>
> Remove the dictsort, it's for list of dicts, not model querysets
>
> https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#dictsort

thanks Bruno. It solved the issue.

-F

-- 
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: i save text with html in djanfo admin and when out its ilegible

2011-07-04 Thread Kase
Works!!  thx

but i dont like  put ever
  {% autoescape off %}

On 4 jul, 07:08, Kenneth Gonsalves  wrote:
> On Mon, 2011-07-04 at 05:06 -0700, Kase wrote:
> > example
> >     {% autoescape on %}
> >             {{grup.grupo}}
> >             {% endautoescape %}
>
>     {% autoescape off %}
>             {{grup.grupo}}
>             {% endautoescape %}
> --
> regards
> KGhttp://lawgon.livejournal.com
> Coimbatore LUG roxhttp://ilugcbe.techstud.org/

-- 
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: i save text with html in djanfo admin and when out its ilegible

2011-07-04 Thread Andres Pardini
2011/7/4 Kase 

> Works!!  thx
>
> but i dont like  put ever
> 
>

i dont think its right save html tag in database unless its a blog like
webpage,,,

my opinion

-- 
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: i save text with html in djanfo admin and when out its ilegible

2011-07-04 Thread Kase
me too.. but i dont know other options for format text  in  i
need  deliver in 30 minuts! an i finish!

what do you do for a sistem like a blog?

PD:  i put  tiny_mce  (not the app) the js  and edit the admin
template...  but the format of tinymce dont work too =/

On 4 jul, 07:41, Andres Pardini  wrote:
> 2011/7/4 Kase 
>
> > Works!!  thx
>
> > but i dont like  put ever
> > 
>
> i dont think its right save html tag in database unless its a blog like
> webpage,,,
>
> my opinion

-- 
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.



ANN: django-iadmin

2011-07-04 Thread Stefano Apostolico
Hi all,

I would like some feedback on
https://github.com/saxix/djangoscreenshots-home-page-iadmin
.

Documentation in progress,  but demo application included.

Suggestions and comments are welcome, any help will be appreciated


sax

-- 
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: ANN: django-iadmin

2011-07-04 Thread Thomas Weholt
Did you have any screenshots? Didn't see any.

Thomas

On Mon, Jul 4, 2011 at 2:55 PM, Stefano Apostolico  wrote:
> Hi all,
>
> I would like some feedback on
> https://github.com/saxix/djangoscreenshots-home-page-iadmin.
>
> Documentation in progress,  but demo application included.
>
> Suggestions and comments are welcome, any help will be appreciated
>
>
> sax
>
>
> --
> 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.
>



-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

-- 
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.



Aw: Re: Setting up EC2 for Django

2011-07-04 Thread Juergen Schackmann
maybe http://www.turnkeylinux.org/ and especially 
http://www.turnkeylinux.org/django will do the heavy lifting for you

although I fully agree with the other replies, and I am not sure if you do 
yourself a favour using turnkeylinux just as a blackbox :-)

-- 
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/-/MAWiQzkLK1sJ.
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: change values in "select list"

2011-07-04 Thread Andre Terra
Hi, Patrick.

Here are a couple of hints that will hopefully guide you in the right direction.

It seems you are calling return from your class definition, when it is
actually supposed to be used in a function.

What happened to the label_from_instance function? Where it is supposed to go?

I'll leave it to you to put two and two together. Consider it homework =)


Cheers,
André Terra

On 7/4/11, Szabo, Patrick (LNG-VIE)  wrote:
> Okay i think i'm close but i can't figure it out.
> I did this:
>
> class ReportingForm_ProduktField(ModelChoiceField):
> def label_from_instance(self, obj):
> return "My Object #%i" % obj.id
>
>
> class ReportingForm_Produkt(ModelForm):
> Produkt = ReportingForm_ProduktField(Produkte.objects.all())
> class Meta:
> model = Buchung
>
> I've also tried this:
>
> class ReportingForm_Produkt(ModelForm):
> Produkt = forms.ModelChoiceField(ReportingForm_ProduktField,
> Produkte.objects.all())
> class Meta:
> model = Buchung
>
> Could you plz tell me if i'm even close to the solution or maybe even give
> me a hint on what I'm doing wrong
>
> Sry but this is rly urgent
>
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Patrick Szabo
>  XSLT Developer
> LexisNexis
> Marxergasse 25, 1030 Wien
>
> mailto:patrick.sz...@lexisnexis.at
> Tel.: 00431 534521573
> Fax: +43 (1) 534 52 - 146
>
>
> -Ursprüngliche Nachricht-
>
> Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im
> Auftrag von Tom Evans
> Gesendet: Montag, 04. Juli 2011 13:10
> An: django-users@googlegroups.com
> Betreff: Re: change values in "select list"
>
> On Mon, Jul 4, 2011 at 11:46 AM, Szabo, Patrick (LNG-VIE)
>  wrote:
>> I was afraid somethig like that would come.
>> I did read the doc but i don't really understand it :-(
>> Could you plz make it a little clearer for me  ?!
>>
>
> You are using a model form. The model form has a model selection in
> it. You want the select to have different labels.
>
> Labels on a model selection field come from the __unicode__ method of
> the model, or from the label_from_instance of the model field class.
>
> Model forms allow you to specify the classes to use for each model
> attribute.
>
> Hence:
>
> Define a new class derived from ModelChoiceField (not called
> ModelChoiceField).
> Add a label_from_instance method to the new class
> Configure your ModelForm to use this new field instead of ModelChoiceField
>
> All of this is explained in the docs. Read the docs.
>
> Tom
>
> --
> 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.
>
>

-- 
Sent from my mobile device

-- 
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: ANN: django-iadmin

2011-07-04 Thread Alex Kamedov
I agree with Thomas, It'll be great it you are providing screenshots or demo
project.

On Mon, Jul 4, 2011 at 7:01 PM, Thomas Weholt wrote:

> Did you have any screenshots? Didn't see any.
>
> Thomas
>
> On Mon, Jul 4, 2011 at 2:55 PM, Stefano Apostolico  wrote:
> > Hi all,
> >
> > I would like some feedback on
> > https://github.com/saxix/djangoscreenshots-home-page-iadmin.
> >
> > Documentation in progress,  but demo application included.
> >
> > Suggestions and comments are welcome, any help will be appreciated
> >
> >
> > sax
> >
> >
> > --
> > 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.
> >
>
>
>
> --
> Mvh/Best regards,
> Thomas Weholt
> http://www.weholt.org
>
> --
> 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.
>
>


-- 
Alex Kamedov
skype: kamedovwww: kamedov.ru

-- 
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.



AW: change values in "select list"

2011-07-04 Thread Szabo, Patrick (LNG-VIE)
Thanks for not giving up on me :-), i'll give it a try !


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: 00431 534521573 
Fax: +43 (1) 534 52 - 146 


-Ursprüngliche Nachricht-

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Andre Terra
Gesendet: Montag, 04. Juli 2011 15:52
An: django-users@googlegroups.com
Betreff: Re: change values in "select list"

Hi, Patrick.

Here are a couple of hints that will hopefully guide you in the right direction.

It seems you are calling return from your class definition, when it is
actually supposed to be used in a function.

What happened to the label_from_instance function? Where it is supposed to go?

I'll leave it to you to put two and two together. Consider it homework =)


Cheers,
André Terra

On 7/4/11, Szabo, Patrick (LNG-VIE)  wrote:
> Okay i think i'm close but i can't figure it out.
> I did this:
>
> class ReportingForm_ProduktField(ModelChoiceField):
> def label_from_instance(self, obj):
> return "My Object #%i" % obj.id
>
>
> class ReportingForm_Produkt(ModelForm):
> Produkt = ReportingForm_ProduktField(Produkte.objects.all())
> class Meta:
> model = Buchung
>
> I've also tried this:
>
> class ReportingForm_Produkt(ModelForm):
> Produkt = forms.ModelChoiceField(ReportingForm_ProduktField,
> Produkte.objects.all())
> class Meta:
> model = Buchung
>
> Could you plz tell me if i'm even close to the solution or maybe even give
> me a hint on what I'm doing wrong
>
> Sry but this is rly urgent
>
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Patrick Szabo
>  XSLT Developer
> LexisNexis
> Marxergasse 25, 1030 Wien
>
> mailto:patrick.sz...@lexisnexis.at
> Tel.: 00431 534521573
> Fax: +43 (1) 534 52 - 146
>
>
> -Ursprüngliche Nachricht-
>
> Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im
> Auftrag von Tom Evans
> Gesendet: Montag, 04. Juli 2011 13:10
> An: django-users@googlegroups.com
> Betreff: Re: change values in "select list"
>
> On Mon, Jul 4, 2011 at 11:46 AM, Szabo, Patrick (LNG-VIE)
>  wrote:
>> I was afraid somethig like that would come.
>> I did read the doc but i don't really understand it :-(
>> Could you plz make it a little clearer for me  ?!
>>
>
> You are using a model form. The model form has a model selection in
> it. You want the select to have different labels.
>
> Labels on a model selection field come from the __unicode__ method of
> the model, or from the label_from_instance of the model field class.
>
> Model forms allow you to specify the classes to use for each model
> attribute.
>
> Hence:
>
> Define a new class derived from ModelChoiceField (not called
> ModelChoiceField).
> Add a label_from_instance method to the new class
> Configure your ModelForm to use this new field instead of ModelChoiceField
>
> All of this is explained in the docs. Read the docs.
>
> Tom
>
> --
> 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.
>
>

-- 
Sent from my mobile device

-- 
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.



Re: change values in "select list"

2011-07-04 Thread Andre Terra
Don't take it personally, but while we're at it, I should tell you
that Classes have CamelCase names and functions are
lowercase_with_underscores. Try not to mix both unless you have an
incredibly compelling reason (which is not the case here).

For what it's worth, it will do you good to name everything in
English, even if it's not your native language. Python's keywords are
in English (if, while, for, class, return, break...) and sticking to
one language makes the code easier to maintain (you might have a
developer on your team who doesn't speak German) and readable for
those of us who can only speak a language or two.


Cheers,
Andre Terra

On 7/4/11, Andre Terra  wrote:
> Hi, Patrick.
>
> Here are a couple of hints that will hopefully guide you in the right
> direction.
>
> It seems you are calling return from your class definition, when it is
> actually supposed to be used in a function.
>
> What happened to the label_from_instance function? Where it is supposed to
> go?
>
> I'll leave it to you to put two and two together. Consider it homework =)
>
>
> Cheers,
> André Terra
>
> On 7/4/11, Szabo, Patrick (LNG-VIE)  wrote:
>> Okay i think i'm close but i can't figure it out.
>> I did this:
>>
>> class ReportingForm_ProduktField(ModelChoiceField):
>> def label_from_instance(self, obj):
>> return "My Object #%i" % obj.id
>>
>>
>> class ReportingForm_Produkt(ModelForm):
>> Produkt = ReportingForm_ProduktField(Produkte.objects.all())
>> class Meta:
>> model = Buchung
>>
>> I've also tried this:
>>
>> class ReportingForm_Produkt(ModelForm):
>> Produkt = forms.ModelChoiceField(ReportingForm_ProduktField,
>> Produkte.objects.all())
>> class Meta:
>> model = Buchung
>>
>> Could you plz tell me if i'm even close to the solution or maybe even
>> give
>> me a hint on what I'm doing wrong
>>
>> Sry but this is rly urgent
>>
>>
>> . . . . . . . . . . . . . . . . . . . . . . . . . .
>> Patrick Szabo
>>  XSLT Developer
>> LexisNexis
>> Marxergasse 25, 1030 Wien
>>
>> mailto:patrick.sz...@lexisnexis.at
>> Tel.: 00431 534521573
>> Fax: +43 (1) 534 52 - 146
>>
>>
>> -Ursprüngliche Nachricht-
>>
>> Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com]
>> Im
>> Auftrag von Tom Evans
>> Gesendet: Montag, 04. Juli 2011 13:10
>> An: django-users@googlegroups.com
>> Betreff: Re: change values in "select list"
>>
>> On Mon, Jul 4, 2011 at 11:46 AM, Szabo, Patrick (LNG-VIE)
>>  wrote:
>>> I was afraid somethig like that would come.
>>> I did read the doc but i don't really understand it :-(
>>> Could you plz make it a little clearer for me  ?!
>>>
>>
>> You are using a model form. The model form has a model selection in
>> it. You want the select to have different labels.
>>
>> Labels on a model selection field come from the __unicode__ method of
>> the model, or from the label_from_instance of the model field class.
>>
>> Model forms allow you to specify the classes to use for each model
>> attribute.
>>
>> Hence:
>>
>> Define a new class derived from ModelChoiceField (not called
>> ModelChoiceField).
>> Add a label_from_instance method to the new class
>> Configure your ModelForm to use this new field instead of
>> ModelChoiceField
>>
>> All of this is explained in the docs. Read the docs.
>>
>> Tom
>>
>> --
>> 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.
>>
>>
>
> --
> Sent from my mobile device
>

-- 
Sent from my mobile device

-- 
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.



AW: change values in "select list"

2011-07-04 Thread Szabo, Patrick (LNG-VIE)
Yeah, i know i'm a little messys with all that but thanks for the tipp. 

Could it be that you're Mail reader did something to the indentation because i 
am calling return inside the function or am i understanding you wrong ?!


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT Developer 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: 00431 534521573 
Fax: +43 (1) 534 52 - 146 


-Ursprüngliche Nachricht-

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Andre Terra
Gesendet: Montag, 04. Juli 2011 16:00
An: django-users@googlegroups.com
Betreff: Re: change values in "select list"

Don't take it personally, but while we're at it, I should tell you
that Classes have CamelCase names and functions are
lowercase_with_underscores. Try not to mix both unless you have an
incredibly compelling reason (which is not the case here).

For what it's worth, it will do you good to name everything in
English, even if it's not your native language. Python's keywords are
in English (if, while, for, class, return, break...) and sticking to
one language makes the code easier to maintain (you might have a
developer on your team who doesn't speak German) and readable for
those of us who can only speak a language or two.


Cheers,
Andre Terra

On 7/4/11, Andre Terra  wrote:
> Hi, Patrick.
>
> Here are a couple of hints that will hopefully guide you in the right
> direction.
>
> It seems you are calling return from your class definition, when it is
> actually supposed to be used in a function.
>
> What happened to the label_from_instance function? Where it is supposed to
> go?
>
> I'll leave it to you to put two and two together. Consider it homework =)
>
>
> Cheers,
> André Terra
>
> On 7/4/11, Szabo, Patrick (LNG-VIE)  wrote:
>> Okay i think i'm close but i can't figure it out.
>> I did this:
>>
>> class ReportingForm_ProduktField(ModelChoiceField):
>> def label_from_instance(self, obj):
>> return "My Object #%i" % obj.id
>>
>>
>> class ReportingForm_Produkt(ModelForm):
>> Produkt = ReportingForm_ProduktField(Produkte.objects.all())
>> class Meta:
>> model = Buchung
>>
>> I've also tried this:
>>
>> class ReportingForm_Produkt(ModelForm):
>> Produkt = forms.ModelChoiceField(ReportingForm_ProduktField,
>> Produkte.objects.all())
>> class Meta:
>> model = Buchung
>>
>> Could you plz tell me if i'm even close to the solution or maybe even
>> give
>> me a hint on what I'm doing wrong
>>
>> Sry but this is rly urgent
>>
>>
>> . . . . . . . . . . . . . . . . . . . . . . . . . .
>> Patrick Szabo
>>  XSLT Developer
>> LexisNexis
>> Marxergasse 25, 1030 Wien
>>
>> mailto:patrick.sz...@lexisnexis.at
>> Tel.: 00431 534521573
>> Fax: +43 (1) 534 52 - 146
>>
>>
>> -Ursprüngliche Nachricht-
>>
>> Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com]
>> Im
>> Auftrag von Tom Evans
>> Gesendet: Montag, 04. Juli 2011 13:10
>> An: django-users@googlegroups.com
>> Betreff: Re: change values in "select list"
>>
>> On Mon, Jul 4, 2011 at 11:46 AM, Szabo, Patrick (LNG-VIE)
>>  wrote:
>>> I was afraid somethig like that would come.
>>> I did read the doc but i don't really understand it :-(
>>> Could you plz make it a little clearer for me  ?!
>>>
>>
>> You are using a model form. The model form has a model selection in
>> it. You want the select to have different labels.
>>
>> Labels on a model selection field come from the __unicode__ method of
>> the model, or from the label_from_instance of the model field class.
>>
>> Model forms allow you to specify the classes to use for each model
>> attribute.
>>
>> Hence:
>>
>> Define a new class derived from ModelChoiceField (not called
>> ModelChoiceField).
>> Add a label_from_instance method to the new class
>> Configure your ModelForm to use this new field instead of
>> ModelChoiceField
>>
>> All of this is explained in the docs. Read the docs.
>>
>> Tom
>>
>> --
>> 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.
>>
>>
>
> --
> Sent from my mobile device
>

-- 
Sent from my mobile device

-- 
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: change values in "select list"

2011-07-04 Thread Andre Terra
Oh, yes... Sorry, I was reading from my phone earlier and the app ate part
of the line. Nevermind!


Cheers,
André

On Mon, Jul 4, 2011 at 11:11 AM, Szabo, Patrick (LNG-VIE) <
patrick.sz...@lexisnexis.at> wrote:

> Yeah, i know i'm a little messys with all that but thanks for the tipp.
>
> Could it be that you're Mail reader did something to the indentation
> because i am calling return inside the function or am i understanding you
> wrong ?!
>
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Patrick Szabo
>  XSLT Developer
> LexisNexis
> Marxergasse 25, 1030 Wien
>
> mailto:patrick.sz...@lexisnexis.at
> Tel.: 00431 534521573
> Fax: +43 (1) 534 52 - 146
>
>
> -Ursprüngliche Nachricht-
>
> Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com]
> Im Auftrag von Andre Terra
> Gesendet: Montag, 04. Juli 2011 16:00
> An: django-users@googlegroups.com
> Betreff: Re: change values in "select list"
>
> Don't take it personally, but while we're at it, I should tell you
> that Classes have CamelCase names and functions are
> lowercase_with_underscores. Try not to mix both unless you have an
> incredibly compelling reason (which is not the case here).
>
> For what it's worth, it will do you good to name everything in
> English, even if it's not your native language. Python's keywords are
> in English (if, while, for, class, return, break...) and sticking to
> one language makes the code easier to maintain (you might have a
> developer on your team who doesn't speak German) and readable for
> those of us who can only speak a language or two.
>
>
> Cheers,
> Andre Terra
>
> On 7/4/11, Andre Terra  wrote:
> > Hi, Patrick.
> >
> > Here are a couple of hints that will hopefully guide you in the right
> > direction.
> >
> > It seems you are calling return from your class definition, when it is
> > actually supposed to be used in a function.
> >
> > What happened to the label_from_instance function? Where it is supposed
> to
> > go?
> >
> > I'll leave it to you to put two and two together. Consider it homework =)
> >
> >
> > Cheers,
> > André Terra
> >
> > On 7/4/11, Szabo, Patrick (LNG-VIE)  wrote:
> >> Okay i think i'm close but i can't figure it out.
> >> I did this:
> >>
> >> class ReportingForm_ProduktField(ModelChoiceField):
> >> def label_from_instance(self, obj):
> >> return "My Object #%i" % obj.id
> >>
> >>
> >> class ReportingForm_Produkt(ModelForm):
> >> Produkt = ReportingForm_ProduktField(Produkte.objects.all())
> >> class Meta:
> >> model = Buchung
> >>
> >> I've also tried this:
> >>
> >> class ReportingForm_Produkt(ModelForm):
> >> Produkt = forms.ModelChoiceField(ReportingForm_ProduktField,
> >> Produkte.objects.all())
> >> class Meta:
> >> model = Buchung
> >>
> >> Could you plz tell me if i'm even close to the solution or maybe even
> >> give
> >> me a hint on what I'm doing wrong
> >>
> >> Sry but this is rly urgent
> >>
> >>
> >> . . . . . . . . . . . . . . . . . . . . . . . . . .
> >> Patrick Szabo
> >>  XSLT Developer
> >> LexisNexis
> >> Marxergasse 25, 1030 Wien
> >>
> >> mailto:patrick.sz...@lexisnexis.at
> >> Tel.: 00431 534521573
> >> Fax: +43 (1) 534 52 - 146
> >>
> >>
> >> -Ursprüngliche Nachricht-
> >>
> >> Von: django-users@googlegroups.com [mailto:
> django-users@googlegroups.com]
> >> Im
> >> Auftrag von Tom Evans
> >> Gesendet: Montag, 04. Juli 2011 13:10
> >> An: django-users@googlegroups.com
> >> Betreff: Re: change values in "select list"
> >>
> >> On Mon, Jul 4, 2011 at 11:46 AM, Szabo, Patrick (LNG-VIE)
> >>  wrote:
> >>> I was afraid somethig like that would come.
> >>> I did read the doc but i don't really understand it :-(
> >>> Could you plz make it a little clearer for me  ?!
> >>>
> >>
> >> You are using a model form. The model form has a model selection in
> >> it. You want the select to have different labels.
> >>
> >> Labels on a model selection field come from the __unicode__ method of
> >> the model, or from the label_from_instance of the model field class.
> >>
> >> Model forms allow you to specify the classes to use for each model
> >> attribute.
> >>
> >> Hence:
> >>
> >> Define a new class derived from ModelChoiceField (not called
> >> ModelChoiceField).
> >> Add a label_from_instance method to the new class
> >> Configure your ModelForm to use this new field instead of
> >> ModelChoiceField
> >>
> >> All of this is explained in the docs. Read the docs.
> >>
> >> Tom
> >>
> >> --
> >> 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.
> 

Re: ANN: django-iadmin

2011-07-04 Thread sax
Sorry,
wiki still in progress.
anyway demo application in included ( testprj directory), some screenshots
are available at
https://github.com/saxix/django-iadmin/tree/master/docs/source/_static or in
the wiki  section https://github.com/saxix/django-iadmin/wiki

S.

2011/7/4 Alex Kamedov 

> I agree with Thomas, It'll be great it you are providing screenshots or
> demo project.
>
>
> On Mon, Jul 4, 2011 at 7:01 PM, Thomas Weholt wrote:
>
>> Did you have any screenshots? Didn't see any.
>>
>> Thomas
>>
>> On Mon, Jul 4, 2011 at 2:55 PM, Stefano Apostolico  wrote:
>> > Hi all,
>> >
>> > I would like some feedback on
>> > https://github.com/saxix/djangoscreenshots-home-page-iadmin.
>> >
>> > Documentation in progress,  but demo application included.
>> >
>> > Suggestions and comments are welcome, any help will be appreciated
>> >
>> >
>> > sax
>> >
>> >
>> > --
>> > 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.
>> >
>>
>>
>>
>> --
>> Mvh/Best regards,
>> Thomas Weholt
>> http://www.weholt.org
>>
>> --
>> 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.
>>
>>
>
>
> --
> Alex Kamedov
> skype: kamedovwww: kamedov.ru
>
>  --
> 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.



Confusing path example for mod_wsgi?

2011-07-04 Thread candlerb
The example given in `django/docs/howto/deployment/modwsgi.txt` shows:


os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
...
path = '/path/to/mysite'
if path not in sys.path:
sys.path.append(path)


However, when deploying a project I found that I had to include both
the mysite directory and its parent (that is, both `/path/to/mysite`
and `/path/to`), for it to start under Apache, although I didn't have
any problem using `manage.py runserver` when developing. Without this,
apache gave a 500 result and the following in error.log:

[Mon Jul 04 15:38:42 2011] [error] [client 192.168.122.183]
ImportError: Could not import settings 'mysite.settings' (Is it on
sys.path?): No module named mysite.settings

I am running python 2.6.5 under Ubuntu 10.04.2 LTS

Aside: I found that I could make it work with just `/path/to` in
sys.path if I changed my code to qualify all references to
applications, i.e. use `mysite.app1` and `mysite.app2` everywhere
instead of just `app1` and `app2`. But that's messy. In fact, I would
like to be able to remove all references to `mysite` within the code,
but there are a few places it seems to be necessary; in particular,
whenever I want to pull something out of the toplevel SETTINGS file I
end up writing


from mysite import settings


Am I missing a trick here? If /path/to/mysite is on the path, would it
be safe to use "import settings" instead of "from mysite import
settings" everywhere?

Or should the documentation show both /path/to and /path/to/mysite
being added to the path?

Thanks,

Brian.

-- 
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: ANN: django-iadmin

2011-07-04 Thread bobhaugen
Awesome feature list. I'll start trying it tomorrow.  Just sending
this message to be encouraging.

-- 
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: Confusing path example for mod_wsgi?

2011-07-04 Thread Tom Evans
On Mon, Jul 4, 2011 at 3:49 PM, candlerb  wrote:
> The example given in `django/docs/howto/deployment/modwsgi.txt` shows:
>
> 
>    os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
> ...
>    path = '/path/to/mysite'
>    if path not in sys.path:
>        sys.path.append(path)
> 
>
> However, when deploying a project I found that I had to include both
> the mysite directory and its parent (that is, both `/path/to/mysite`
> and `/path/to`), for it to start under Apache, although I didn't have
> any problem using `manage.py runserver` when developing. Without this,
> apache gave a 500 result and the following in error.log:
>
> [Mon Jul 04 15:38:42 2011] [error] [client 192.168.122.183]
> ImportError: Could not import settings 'mysite.settings' (Is it on
> sys.path?): No module named mysite.settings

However you run django, you must configure the appropriate path
settings so that it can load your modules. If you have setup your
folder layout like this:

/path/to
  foo/
settings.py
bar/

Where 'foo' is your project and 'foo.bar' is your app, then you will
need to add /path/to to sys.path.

If on the other hand 'bar' is how you refer to your app, then you will
need to add /path/to/foo to sys.path as well.

>
> I am running python 2.6.5 under Ubuntu 10.04.2 LTS
>
> Aside: I found that I could make it work with just `/path/to` in
> sys.path if I changed my code to qualify all references to
> applications, i.e. use `mysite.app1` and `mysite.app2` everywhere
> instead of just `app1` and `app2`. But that's messy. In fact, I would
> like to be able to remove all references to `mysite` within the code,
> but there are a few places it seems to be necessary; in particular,
> whenever I want to pull something out of the toplevel SETTINGS file I
> end up writing
>
> 
> from mysite import settings
> 
>
> Am I missing a trick here? If /path/to/mysite is on the path, would it
> be safe to use "import settings" instead of "from mysite import
> settings" everywhere?
>

You're missing several - you should *never* directly import your
settings like that. The only reliable and approved way to access your
settings is:

  from django.conf import settings

Cheers

Tom

-- 
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: JQuery .load() works in production but fails in development

2011-07-04 Thread Joe Linoff
Hi Andre:

Thank you for responding and for your insights.

> For the record, you can use request.is_ajax to figure out whether a
> request is coming from a js file and make the view behave accordingly.
> It's mighty useful in some cases.

That is very useful.

> Also, have you gone trough the official tutorial? 

I have gone through a number of tutorials from this page: 
http://docs.jquery.com/Tutorials. I have also gone through the Django 
tutorial (https://docs.djangoproject.com/en/1.3/intro/tutorial01/ ...). Is 
there a particular one that you recommend?

Regards,

Joe

-- 
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/-/OE_HYAw4H1sJ.
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: ANN: django-iadmin

2011-07-04 Thread Thomas Weholt
Just by looking at the screenshots makes me like it! Alot! :-) Keep up
the great work. I'll see if I get the time to test it and provide you
with more feedback.

Regards,
Thomas

On Mon, Jul 4, 2011 at 4:42 PM, sax  wrote:
> Sorry,
> wiki still in progress.
> anyway demo application in included ( testprj directory), some screenshots
> are available at
> https://github.com/saxix/django-iadmin/tree/master/docs/source/_static or in
> the wiki  section https://github.com/saxix/django-iadmin/wiki
>
> S.
>
> 2011/7/4 Alex Kamedov 
>>
>> I agree with Thomas, It'll be great it you are providing screenshots or
>> demo project.
>>
>> On Mon, Jul 4, 2011 at 7:01 PM, Thomas Weholt 
>> wrote:
>>>
>>> Did you have any screenshots? Didn't see any.
>>>
>>> Thomas
>>>
>>> On Mon, Jul 4, 2011 at 2:55 PM, Stefano Apostolico  wrote:
>>> > Hi all,
>>> >
>>> > I would like some feedback on
>>> > https://github.com/saxix/djangoscreenshots-home-page-iadmin.
>>> >
>>> > Documentation in progress,  but demo application included.
>>> >
>>> > Suggestions and comments are welcome, any help will be appreciated
>>> >
>>> >
>>> > sax
>>> >
>>> >
>>> > --
>>> > 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.
>>> >
>>>
>>>
>>>
>>> --
>>> Mvh/Best regards,
>>> Thomas Weholt
>>> http://www.weholt.org
>>>
>>> --
>>> 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.
>>>
>>
>>
>>
>> --
>> Alex Kamedov
>> skype: kamedov    www: kamedov.ru
>>
>> --
>> 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.
>



-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

-- 
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.



Calling a custom templatetag inside a block/extrahead-block?

2011-07-04 Thread Thomas Weholt
I've created a templatetag called {% kolibri_imports %} which I use
the in the head-section of my templates. It imports related to
stylesheets, javascript libraries etc for my kolibri-package. This
works fine when I've control over the base-template I'm extending, but
when I want to extend a template which defines a extrahead for me to
add stuff to, I get an error trying to call my
kolibri_imports-templatetag. Now I want to call that templatetag
inside a

{% block extrahead %}
{% kolibri_imports %}
{% endblock %}

but I get the following error:

Invalid block tag: 'kolibri_imports', expected 'endblock' or 'endblock
extrahead'

So; How can I call a defined templatetag inside my {% block extrahead
%}-block? I've tried

{% block extrahead %}
{{kolibri_imports }}

But that didn't produce anything.

This is probably simple, but ... thanks for you input.

-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

-- 
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: Setting up EC2 for Django

2011-07-04 Thread creecode
Hello all,

On Sunday, July 3, 2011 11:15:15 AM UTC-7, Stuart wrote:

But here is how I would approach it.. 
>
> 1) Figure out how to get Ubuntu Server running out on EC2 (http:// 
> alestic.com/ is a good start) 
> 2) Figure out how to install django on ubuntu (also google for 
> virtualenv and pip) 
> 3) Figure out how to install / configure postgres on ubuntu 
> 4) Figure out how to run django with a production-quality web server 
> (you mention apache, but I would consider nginx or similar). 
> 5) Figure out how to install and configure solr 
>
> Of course each of those steps could be broken down quite a bit.


Stuart has some good general advice there.

An alternative I'll mention which I've been using on EC2 is Amazon's own 
Linux AMI.  Seems to work pretty well for a server and has a good set of 
packages available.  They are doing pretty regular updates to their packages 
as well.

I'm running...

Linux
Upstart (for Gunicorn job management, comes with Amazon Linux AMI)
Nginx
Gunicorn
Apache (for "mass" virtual hosting, Gunicorn's memory footprint seems 
not to compare favorably to Apache for this task, you can drop this if 
you're just hosting a few websites and stick with Gunicorn)
mod_wsgi (goes along with Apache, not needed for Gunicorn)
MySQL (use whatever database suits your needs)
Python (of course! ;-) )
virtualenv
virtualenvwrapper
pip
Django (again, of course! :-) )
Several dozen Python and Django related packages needed to run my 
websites.

Toodle-l
creecode

-- 
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/-/JywnPjCJAHoJ.
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: Calling a custom templatetag inside a block/extrahead-block?

2011-07-04 Thread Ian Clelland
On Monday, July 4, 2011, Thomas Weholt  wrote:
> I've created a templatetag called {% kolibri_imports %} which I use
> the in the head-section of my templates. It imports related to
> stylesheets, javascript libraries etc for my kolibri-package. This
> works fine when I've control over the base-template I'm extending, but
> when I want to extend a template which defines a extrahead for me to
> add stuff to, I get an error trying to call my
> kolibri_imports-templatetag. Now I want to call that templatetag
> inside a
>
> {% block extrahead %}
> {% kolibri_imports %}
> {% endblock %}
>
> but I get the following error:
>
> Invalid block tag: 'kolibri_imports', expected 'endblock' or 'endblock
> extrahead'
>
> So; How can I call a defined templatetag inside my {% block extrahead
> %}-block? I've tried
>
> {% block extrahead %}
> {{kolibri_imports }}
>
> But that didn't produce anything.
>
> This is probably simple, but ... thanks for you input.
>
> --
> Mvh/Best regards,
> Thomas Weholt
> http://www.weholt.org
>
> --
> 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.
>
>

Are you loading the tem

-- 
Regards,
Ian Clelland


-- 
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: ANN: django-iadmin

2011-07-04 Thread creecode
Hello sax,

How about a short description here of what this app does?

Toodle-loo..
creecode

-- 
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/-/64Q1hmkrmW0J.
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: Calling a custom templatetag inside a block/extrahead-block?

2011-07-04 Thread Ian Clelland
On Monday, July 4, 2011, Thomas Weholt  wrote:
> I've created a templatetag called {% kolibri_imports %} which I use
> the in the head-section of my templates. It imports related to
> stylesheets, javascript libraries etc for my kolibri-package. This
> works fine when I've control over the base-template I'm extending, but
> when I want to extend a template which defines a extrahead for me to
> add stuff to, I get an error trying to call my
> kolibri_imports-templatetag. Now I want to call that templatetag
> inside a
>
> {% block extrahead %}
> {% kolibri_imports %}
> {% endblock %}
>
> but I get the following error:
>
> Invalid block tag: 'kolibri_imports', expected 'endblock' or 'endblock
> extrahead'
>
> So; How can I call a defined templatetag inside my {% block extrahead
> %}-block? I've tried
>
> {% block extrahead %}
> {{kolibri_imports }}
>
> But that didn't produce anything.
>
> This is probably simple, but ... thanks for you input.
>
> --
> Mvh/Best regards,
> Thomas Weholt
> http://www.weholt.org
>
> --
> 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.
>
>

Are you loading the template tag library in the template that extends the base?

-- 
Regards,
Ian Clelland


-- 
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: ANN: django-iadmin

2011-07-04 Thread leo

It looks very good.I will follow this project and apply it soon.
thanks for your awesome work.

On 2011-7-4 22:42, sax wrote:

Sorry,
wiki still in progress.
anyway demo application in included ( testprj directory), some 
screenshots are available at 
https://github.com/saxix/django-iadmin/tree/master/docs/source/_static 
or in the wiki  section https://github.com/saxix/django-iadmin/wiki


S.

2011/7/4 Alex Kamedov mailto:kame...@gmail.com>>

I agree with Thomas, It'll be great it you are providing
screenshots or demo project.


On Mon, Jul 4, 2011 at 7:01 PM, Thomas Weholt
mailto:thomas.weh...@gmail.com>> wrote:

Did you have any screenshots? Didn't see any.

Thomas

On Mon, Jul 4, 2011 at 2:55 PM, Stefano Apostolico
mailto:s...@os4d.org>> wrote:
> Hi all,
>
> I would like some feedback on
> https://github.com/saxix/djangoscreenshots-home-page-iadmin.
>
> Documentation in progress,  but demo application included.
>
> Suggestions and comments are welcome, any help will be
appreciated
>
>
> sax
>
>
> --
> 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.
>



--
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

--
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.




-- 
Alex Kamedov

skype: kamedovwww: kamedov.ru 

-- 
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.


--
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: i save text with html in djanfo admin and when out its ilegible

2011-07-04 Thread Andres Pardini
Hi again,

2011/7/4 Kase 

> me too.. but i dont know other options for format text
>

i follow this tutorial for rich text editor

http://lazutkin.com/blog/2011/mar/13/using-dojo-rich-editor-djangos-admin/

when you output the text put something like this:

{{ notice.title }}
{{ notice.content|safe }}

the safe filter is what you are looking i think

https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#safe

-- 
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.



Questions on markdown

2011-07-04 Thread leo

I using a textfield to store some information and in admin
input interface i enter like this


Action: check WSMB
Reason: customer check this then got error
Result: finish, result is good, in spec

every single sentence every row, I using markdown to convert
this plain text to html but it did not go as i expected.

the formated text is below,


Action: check WSMB
Reason: customer check this then got error
Result: finish, result is good, in spec

this is not what i expected, i want every single sentence every row,
it misses some html mark.
what should i do?

someone help me.


My function of markdown.

from markdown import markdown

save(self):
self.action_html = markdown(self.action_detail, extensions = [],
   safe_mode=True, output_format = 'html4',)

--
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: Questions on markdown

2011-07-04 Thread creecode
Hello Liu,

On Monday, July 4, 2011 10:06:29 AM UTC-7, Liu Lin wrote:

If I understand your post correctly you are entering in something like...

> Action: check WSMB
> Reason: customer check this then got error
> Result: finish, result is good, in spec
>
...in a field of your form.  Upon save you process this field with markdown 
and you want to store something like...

Action: check WSMB
Reason: customer check this then got error
Result: finish, result is good, in spec
 
I'm no markdown expert but I would say this is a problem of your 
understanding of how markdown turns it's markup and into html not a problem 
with Django or the markdown package.

To achieve the results you want I think you would need to enter something 
like...

Action: check WSMB

Reason: customer check this then got error

Result: finish, result is good, in spec

You need a blank line between each line.

Alternately you could preprocess the input and add the extra lines yourself 
before processing with markdown..

Toodle-looo...
creecode

-- 
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/-/Tjkni_VHXCUJ.
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: Questions on markdown

2011-07-04 Thread Masklinn
On 2011-07-04, at 19:06 , leo wrote:
> I using a textfield to store some information and in admin
> input interface i enter like this
> 
> 
> Action: check WSMB
> Reason: customer check this then got error
> Result: finish, result is good, in spec
> 
> every single sentence every row, I using markdown to convert
> this plain text to html but it did not go as i expected.
> 
> the formated text is below,
> 
> 
> Action: check WSMB
> Reason: customer check this then got error
> Result: finish, result is good, in spec
> 
> this is not what i expected, i want every single sentence every row,
> it misses some html mark.
> what should i do?
> 
> someone help me.
Well depends. This behavior is as per "spec" for the original markdown dialect: 
single newlines are ignored (they're basically seen as line wrapping), double 
newlines create new paragraphs, ending a line with two spaces creates a hard 
return.

Since you have not specified what you expect your markdown text to become, 
there is little we can do to help you with.

-- 
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: Questions on markdown

2011-07-04 Thread leo

Yes, you totally understood me,actually I copied the text from word and
paste into textfield, it is very inconvenience manually add a blank line
and also as you mentioned,if I put blank line between each line the 
appearance

is not what i like i like this

Action: check WSMB
Reason: customer check this then got error
Result: finish, result is good, in spec

so do you have any suggestion to achieve this goal?

Thank you very much.

On 2011-7-5 1:46, creecode wrote:

Hello Liu,

On Monday, July 4, 2011 10:06:29 AM UTC-7, Liu Lin wrote:

If I understand your post correctly you are entering in something like...

Action: check WSMB
Reason: customer check this then got error
Result: finish, result is good, in spec

...in a field of your form.  Upon save you process this field with 
markdown and you want to store something like...


Action: check WSMB
Reason: customer check this then got error
Result: finish, result is good, in spec

I'm no markdown expert but I would say this is a problem of your 
understanding of how markdown turns it's markup and into html not a 
problem with Django or the markdown package.


To achieve the results you want I think you would need to enter 
something like...


Action: check WSMB

Reason: customer check this then got error

Result: finish, result is good, in spec

You need a blank line between each line.

Alternately you could preprocess the input and add the extra lines 
yourself before processing with markdown..


Toodle-looo...
creecode
--
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/-/Tjkni_VHXCUJ.

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.


--
chlin

--
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: ANN: django-iadmin

2011-07-04 Thread sax
Django iAdmin

iAdmin is a replacement of standard django admin application.
Features

   - multiple columns portlets-like home page
   - tabbed view of inlines
   - mass updates functionality
   - export to csv with options and formatting
   - advanced import from csv with foreign key handling
   - link to foreignkey edit page from changelist (list_display_rel_links)
   - filter by cell values (cell_filters)
   - ajax autocomplete widgets for ForeignKey
   - auto register missed modules.
   - auto add fields not present in fieldset (add_undefined_fields)
   - utilities ( tabular_factory)
   - info page for packages and application version
   - integrated file manager with upload/zip functionality
   - WYSIWYG editor wymeditor
   - shortcuts to configure django.contrib.* applications



2011/7/4 creecode 

> Hello sax,
>
> How about a short description here of what this app does?
>
> Toodle-loo..
> creecode
>
> --
> 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/-/64Q1hmkrmW0J.
>
> 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: Questions on markdown

2011-07-04 Thread leo

The original text is

Action: check WSMB
Reason: customer check this then got error
Result: finish, result is good, in spec

what i want is

html format

Action: check WSMB
Reason: customer check this then got error
Result: finish, result is good, in spec





On 2011-7-5 1:59, Masklinn wrote:

On 2011-07-04, at 19:06 , leo wrote:

I using a textfield to store some information and in admin
input interface i enter like this


Action: check WSMB
Reason: customer check this then got error
Result: finish, result is good, in spec

every single sentence every row, I using markdown to convert
this plain text to html but it did not go as i expected.

the formated text is below,


Action: check WSMB
Reason: customer check this then got error
Result: finish, result is good, in spec

this is not what i expected, i want every single sentence every row,
it misses some html mark.
what should i do?

someone help me.

Well depends. This behavior is as per "spec" for the original markdown dialect: 
single newlines are ignored (they're basically seen as line wrapping), double newlines 
create new paragraphs, ending a line with two spaces creates a hard return.

Since you have not specified what you expect your markdown text to become, 
there is little we can do to help you with.



--
chlin

--
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: i save text with html in djanfo admin and when out its ilegible

2011-07-04 Thread Venkatraman S
On Mon, Jul 4, 2011 at 10:12 PM, Andres Pardini  wrote:

> i follow this tutorial for rich text editor
>
> http://lazutkin.com/blog/2011/mar/13/using-dojo-rich-editor-djangos-admin/
>

How is this when compared with tinymce?

-V
http://blizzardzblogs.blogspot.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: Sidebars

2011-07-04 Thread Venkatraman S
On Mon, Jul 4, 2011 at 5:10 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:

> On a side note, you could have also used fixed/absolute positioning of
> the element, then used jQuery show() and hide() to show the menu bar
> if someone clicks on the pull out tab.
>
> Some examples of this on omgpop.com.
>

Cal, Not sure what you mean here by pull out tab and  which feature to look
in the site (its flash based).

-V

-- 
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: Questions on markdown

2011-07-04 Thread Petite Abeille

On Jul 4, 2011, at 8:08 PM, leo wrote:

> what i want is

To quote the friendly manual:

"When you do want to insert a  break tag using Markdown, you end a line 
with two or more spaces, then type return."

http://daringfireball.net/projects/markdown/syntax#p

-- 
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: ANN: django-iadmin

2011-07-04 Thread creecode
Sounds interesting!  Thanks!

On Monday, July 4, 2011 11:06:44 AM UTC-7, sax wrote:
>
> Django iAdmin 
>
> iAdmin is a replacement of standard django admin application.
> Features 
>
>- multiple columns portlets-like home page
>- tabbed view of inlines
>- mass updates functionality
>- export to csv with options and formatting
>- advanced import from csv with foreign key handling 
>- link to foreignkey edit page from changelist (list_display_rel_links)
>- filter by cell values (cell_filters)
>- ajax autocomplete widgets for ForeignKey
>- auto register missed modules.
>- auto add fields not present in fieldset (add_undefined_fields) 
>- utilities ( tabular_factory)
>- info page for packages and application version
>- integrated file manager with upload/zip functionality
>- WYSIWYG editor wymeditor
>- shortcuts to configure django.contrib.* applications
>
>

-- 
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/-/PCtWyR-jwVMJ.
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: ANN: django-iadmin

2011-07-04 Thread Fred Chevitarese
Hmmm I like it !

All those features are already working?


^^


"
*O relógio da vida recebe corda apenas uma vez.*
*Ninguém tem o poder de decidir quando os ponteiros pararão, se mais cedo ou
se mais tarde.*
*O presente é o único tempo que você possui.*
*Viva, ame e trabalhe com vontade.*
*Não ponha nenhuma esperança no tempo, pois o relógio pode parar a qualquer
momento.*
"

Fred Chevitarese - GNU/Linux
http://chevitarese.wordpress.com





2011/7/4 creecode 

> Sounds interesting!  Thanks!
>
>
> On Monday, July 4, 2011 11:06:44 AM UTC-7, sax wrote:
>>
>> Django iAdmin
>>
>> iAdmin is a replacement of standard django admin application.
>> Features
>>
>>- multiple columns portlets-like home page
>>- tabbed view of inlines
>>- mass updates functionality
>>- export to csv with options and formatting
>>- advanced import from csv with foreign key handling
>>- link to foreignkey edit page from changelist
>>(list_display_rel_links)
>>- filter by cell values (cell_filters)
>>- ajax autocomplete widgets for ForeignKey
>>- auto register missed modules.
>>- auto add fields not present in fieldset (add_undefined_fields)
>>- utilities ( tabular_factory)
>>- info page for packages and application version
>>- integrated file manager with upload/zip functionality
>>- WYSIWYG editor wymeditor
>>- shortcuts to configure django.contrib.* applications
>>
>>  --
> 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/-/PCtWyR-jwVMJ.
>
> 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: ANN: django-iadmin

2011-07-04 Thread sax
yep, but more test needed

sax



2011/7/4 Fred Chevitarese 

> Hmmm I like it !
>
> All those features are already working?
>
>
> ^^
>
>
> "
> *O relógio da vida recebe corda apenas uma vez.*
> *Ninguém tem o poder de decidir quando os ponteiros pararão, se mais cedo
> ou se mais tarde.*
> *O presente é o único tempo que você possui.*
> *Viva, ame e trabalhe com vontade.*
> *Não ponha nenhuma esperança no tempo, pois o relógio pode parar a
> qualquer momento.*
> "
>
> Fred Chevitarese - GNU/Linux
> http://chevitarese.wordpress.com
>
>
>
>
>
> 2011/7/4 creecode 
>
>> Sounds interesting!  Thanks!
>>
>>
>> On Monday, July 4, 2011 11:06:44 AM UTC-7, sax wrote:
>>>
>>> Django iAdmin
>>>
>>> iAdmin is a replacement of standard django admin application.
>>> Features
>>>
>>>- multiple columns portlets-like home page
>>>- tabbed view of inlines
>>>- mass updates functionality
>>>- export to csv with options and formatting
>>>- advanced import from csv with foreign key handling
>>>- link to foreignkey edit page from changelist
>>>(list_display_rel_links)
>>>- filter by cell values (cell_filters)
>>>- ajax autocomplete widgets for ForeignKey
>>>- auto register missed modules.
>>>- auto add fields not present in fieldset (add_undefined_fields)
>>>- utilities ( tabular_factory)
>>>- info page for packages and application version
>>>- integrated file manager with upload/zip functionality
>>>- WYSIWYG editor wymeditor
>>>- shortcuts to configure django.contrib.* applications
>>>
>>>  --
>> 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/-/PCtWyR-jwVMJ.
>>
>> 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.
>

-- 
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: ANN: django-iadmin

2011-07-04 Thread Fred Chevitarese
Thanks!

I will try to test :P


"
*O relógio da vida recebe corda apenas uma vez.*
*Ninguém tem o poder de decidir quando os ponteiros pararão, se mais cedo ou
se mais tarde.*
*O presente é o único tempo que você possui.*
*Viva, ame e trabalhe com vontade.*
*Não ponha nenhuma esperança no tempo, pois o relógio pode parar a qualquer
momento.*
"

Fred Chevitarese - GNU/Linux
http://chevitarese.wordpress.com





2011/7/4 sax 

> yep, but more test needed
>
> sax
>
>
>
>
> 2011/7/4 Fred Chevitarese 
>
>> Hmmm I like it !
>>
>> All those features are already working?
>>
>>
>> ^^
>>
>>
>> "
>> *O relógio da vida recebe corda apenas uma vez.*
>> *Ninguém tem o poder de decidir quando os ponteiros pararão, se mais cedo
>> ou se mais tarde.*
>> *O presente é o único tempo que você possui.*
>> *Viva, ame e trabalhe com vontade.*
>> *Não ponha nenhuma esperança no tempo, pois o relógio pode parar a
>> qualquer momento.*
>> "
>>
>> Fred Chevitarese - GNU/Linux
>> http://chevitarese.wordpress.com
>>
>>
>>
>>
>>
>> 2011/7/4 creecode 
>>
>>> Sounds interesting!  Thanks!
>>>
>>>
>>> On Monday, July 4, 2011 11:06:44 AM UTC-7, sax wrote:

 Django iAdmin

 iAdmin is a replacement of standard django admin application.
 Features

- multiple columns portlets-like home page
- tabbed view of inlines
- mass updates functionality
- export to csv with options and formatting
- advanced import from csv with foreign key handling
- link to foreignkey edit page from changelist
(list_display_rel_links)
- filter by cell values (cell_filters)
- ajax autocomplete widgets for ForeignKey
- auto register missed modules.
- auto add fields not present in fieldset (add_undefined_fields)
- utilities ( tabular_factory)
- info page for packages and application version
- integrated file manager with upload/zip functionality
- WYSIWYG editor wymeditor
- shortcuts to configure django.contrib.* applications

  --
>>> 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/-/PCtWyR-jwVMJ.
>>>
>>> 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.
>>
>
>  --
> 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.



Re: Confusing path example for mod_wsgi?

2011-07-04 Thread candlerb
On Jul 4, 4:29 pm, Tom Evans  wrote:
> If you have setup your folder layout like this:
> /path/to
>   foo/
> settings.py
> bar/
> Where 'foo' is your project and 'foo.bar' is your app, then you will
> need to add /path/to to sys.path.
> If on the other hand 'bar' is how you refer to your app, then you will
> need to add /path/to/foo to sys.path as well.

OK, that's what wasn't clear to me in the documentation. For some
reason, I can refer to 'bar' by itself when using runserver, but with
wsgi I need to add /path/to and /path/to/foo to sys.path (or else
refer to 'foo.bar' everywhere).

> The only reliable and approved way to access your
> settings is:
>
>   from django.conf import settings

Excellent, that makes it a lot tidier.

So now, the only two places I refer to mysite explicitly are:

./django.wsgi:os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
./settings.py:ROOT_URLCONF = 'mysite.urls'

Here's my full django.wsgi, which I have inside the top-level mysite
directory:


import os
import sys

path = os.path.dirname(__file__)
if path not in sys.path:
sys.path.append(path)
path = os.path.normpath(os.path.join(os.path.dirname(__file__),".."))
if path not in sys.path:
sys.path.append(path)

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()


It still fails if I comment out the second bit of path setup (the ".."
one). However, if I change those two lines to

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

and

ROOT_URLCONF = 'urls'

then the app does seem to work happily with just /path/to/mysite in
the path. Is this a reasonable thing to do? (I guess only if you ever
have one django project in your path)

Thanks,

Brian.

-- 
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.



Django admin - how to hide some fields in User edit?

2011-07-04 Thread galgal
How can I hide fields in admin User edit? Mainly I want to hide permissions 
and groups selecting in some exceptions, but exclude variable doesn't work 
:/

-- 
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/-/ydsmKWUyXQMJ.
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.



Django admin - hide remove link

2011-07-04 Thread galgal
How can I hide remove link in Django admin? I need to hide it in my code, 
not in permissions (only user with id=1 can see it no matter if any users 
are superusers)

-- 
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/-/2cpWateci3YJ.
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.



forcing authentication without a password

2011-07-04 Thread Josh Stratton
I've setup my authentication system to use the standard name/password with
good results, but some of the users are coming directly from Google Apps
with an OpenID I've authenticated by hand.  What I'd like is if they are
authenticated from Google Apps, I can just call
auth_login, but they haven't actually been "authenticated" in django's
eyes.  All I'd like to do is log in as if they had typed their
username and password.  If I just try to logon the user, I get an error
saying the "backend" hasn't been set.  Right now I can hack a login by
setting the backend to the same one used by the other method, but when I go
to the another tab and go back to the site, I see that I'm not actually
logged in on that page, like something isn't stored in the session
correctly.  This seems like it should be a simple problem, but it's
extremely frustrating.  I'd just like to say, "Hey, I trust this person, log
them in even though I don't know their password".

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: Django admin - how to hide some fields in User edit?

2011-07-04 Thread leo
try to modify this file 
"Python26\Lib\site-packages\django\contrib\auth\admin.py"


find this line
(_('Groups'), {'fields': ('groups',)}),

comment this line you will remove groups

On 2011-7-5 4:59, galgal wrote:
How can I hide fields in admin User edit? Mainly I want to hide 
permissions and groups selecting in some exceptions, but exclude 
variable doesn't work :/

--
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/-/ydsmKWUyXQMJ.

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.


--
chlin

--
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.



Odp: Re: Django admin - how to hide some fields in User edit?

2011-07-04 Thread galgal
I'm rather searchung the way to do that in my admin.py file not in core 
files.

-- 
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/-/sZ83LDHBIC8J.
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.



url problems

2011-07-04 Thread charles
I am trying to work through the 3rd part of the tutorial and I have a 
problem. When I copy and past


urlpatterns  =  patterns('',
(r'^polls/$',  'polls.views.index'),
(r'^polls/(?P\d+)/$',  'polls.views.detail'),
(r'^polls/(?P\d+)/results/$',  'polls.views.results'),
(r'^polls/(?P\d+)/vote/$',  'polls.views.vote'),
(r'^admin/',  include(admin.site.urls)),
)

into mysite.urls I receive the following error message:


Using the URLconf defined in |mysite.urls|, Django tried these URL 
patterns, in this order:


  1. ^polls/$
  2. ^polls/(?P\d+)/$
  3. ^polls/(?P\d+)/results/$
  4. ^polls/(?P\d+)/vote/$
  5. ^admin/

The current URL, ||, didn't match any of these.

I am using Python 2.7.1 and Windows Vista. Does the url code work 
differently on Vista? or is there something I am missing? What do I need 
to fix the code, or is there a work around?


Charles




--
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: Odp: Re: Django admin - how to hide some fields in User edit?

2011-07-04 Thread Michał Sawicz
Dnia 2011-07-04, pon o godzinie 14:19 -0700, galgal pisze:
> I'm rather searchung the way to do that in my admin.py file not in
> core files. 

Obviously the proposal was... fundamentally wrong.

Create your own UserAdmin, unregister the one registered by
django.contrib.admin and register your own.

> admin.site.unregister(User)
> admin.site.register(User, MyUserAdmin)
-- 
Michał (Saviq) Sawicz 


signature.asc
Description: This is a digitally signed message part


Re: Calling a custom templatetag inside a block/extrahead-block?

2011-07-04 Thread Thomas Weholt
On Mon, Jul 4, 2011 at 6:09 PM, Ian Clelland  wrote:
> On Monday, July 4, 2011, Thomas Weholt  wrote:
>> I've created a templatetag called {% kolibri_imports %} which I use
>> the in the head-section of my templates. It imports related to
>> stylesheets, javascript libraries etc for my kolibri-package. This
>> works fine when I've control over the base-template I'm extending, but
>> when I want to extend a template which defines a extrahead for me to
>> add stuff to, I get an error trying to call my
>> kolibri_imports-templatetag. Now I want to call that templatetag
>> inside a
>>
>> {% block extrahead %}
>> {% kolibri_imports %}
>> {% endblock %}
>>
>> but I get the following error:
>>
>> Invalid block tag: 'kolibri_imports', expected 'endblock' or 'endblock
>> extrahead'
>>
>> So; How can I call a defined templatetag inside my {% block extrahead
>> %}-block? I've tried
>>
>> {% block extrahead %}
>> {{kolibri_imports }}
>>
>> But that didn't produce anything.
>>
>> This is probably simple, but ... thanks for you input.
>>
>> --
>> Mvh/Best regards,
>> Thomas Weholt
>> http://www.weholt.org
>>
>> --
>> 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.
>>
>>
>
> Are you loading the template tag library in the template that extends the 
> base?

Argh! How did I miss that? I've restructured my templates and didn't
load my own templatetags! I feel embarrased for wasting your time.
Anyway, thanks for your help Ian.

-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

-- 
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: Django admin - hide remove link

2011-07-04 Thread Michał Sawicz
Dnia 2011-07-04, pon o godzinie 14:15 -0700, galgal pisze:
> How can I hide remove link in Django admin? I need to hide it in my
> code, not in permissions (only user with id=1 can see it no matter if
> any users are superusers)

Override has_delete_permission [1] on your ModelAdmin.

https://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contrib.admin.ModelAdmin.has_delete_permission

-- 
Michał (Saviq) Sawicz 


signature.asc
Description: This is a digitally signed message part


Odp: Re: Odp: Re: Django admin - how to hide some fields in User edit?

2011-07-04 Thread galgal
That's my code now - how to hide groups for example?

admin.site.unregister(User)
class UserProfileInline(admin.StackedInline):
model = UserProfile
filter_horizontal = ('cities',)
extra = 1
max_num = 1
filter_horizontal = ('cities',)

class UserProfileAdmin(UserAdmin):
inlines = [UserProfileInline,]
list_filter = ('userprofile__type','userprofile__cities',)
search_fields = ['userprofile__type', 'username', 
'userprofile__cities__name', 'email', 'first_name', 'last_name',]

# show users list - if user_id=1 show all, else: show id's > 1
def queryset(self, request):
qs = super(UserProfileAdmin, self).queryset(request)
if request.user.id == 1:
return qs
return qs.filter(id__gt=1)

admin.site.register(User, UserProfileAdmin)

-- 
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/-/ZzrytaO1EOcJ.
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: url problems

2011-07-04 Thread Michał Sawicz
Dnia 2011-07-04, pon o godzinie 16:50 -0500, charles pisze:
> The current URL, , didn't match any of these.

And the current URL was?
-- 
Michał (Saviq) Sawicz 


signature.asc
Description: This is a digitally signed message part


Re: Django admin - how to hide some fields in User edit?

2011-07-04 Thread Michał Sawicz
Dnia 2011-07-04, pon o godzinie 15:13 -0700, galgal pisze:
> That's my code now - how to hide groups for example?

Have you tried reading the Django Admin docs? [1] [2]

[1] https://docs.djangoproject.com/en/1.3/ref/contrib/admin/
[2]
https://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contrib.admin.ModelAdmin.exclude

P.S. please fix your e-mail client not to translate "Re:" in responses'
subjects.
-- 
Michał (Saviq) Sawicz 


signature.asc
Description: This is a digitally signed message part


Odp: Re: Django admin - how to hide some fields in User edit?

2011-07-04 Thread galgal
Yes I read it.  exclude = ('groups',) throws:

Caught KeyError while rendering: "Key 'groups' not found in Form"

-- 
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/-/V5P1M_GH80sJ.
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: url problems

2011-07-04 Thread charles

On 11/07/04 17:14, Michał Sawicz wrote:

Dnia 2011-07-04, pon o godzinie 16:50 -0500, charles pisze:

The current URL, , didn't match any of these.

And the current URL was?
the current url (path) is C:\Users\Dagon\mysite. Everything is relative 
to mysite.


--
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: url problems

2011-07-04 Thread Daniel Roseman
What? URLs have nothing to do with file paths.

There is nothing wrong here at all. The tutorial got you to define some URLs 
beginning with 'polls'. You have to go to one of those URLs. Going to the root 
of the site won't work, because you haven't set up a URL for it.
-- 
DR.

-- 
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/-/vUZU7XRU_rcJ.
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: getting objects unique in several ways (annotate?)

2011-07-04 Thread elliot
incase anyone cares, this is the solution I came up with.  an initial
query to filter for one condition, and then a for loop that checks
that each member satisfies the second condition.  hopefully,
selected_related makes sure only one db call is made:

(in a function)
books =
Book.objects.filter(whateverconditions).distinct().select_related('transaction')
incirc = []
for b in books:
recenttran = b.transaction_set.order_by('-start_date')[0]
if recenttran.recipient == self:
incirc.append(b)

-- 
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: Odp: Re: Django admin - how to hide some fields in User edit?

2011-07-04 Thread Michał Sawicz
Dnia 2011-07-04, pon o godzinie 15:20 -0700, galgal pisze:
> Yes I read it.  exclude = ('groups',) throws: 
> Caught KeyError while rendering: "Key 'groups' not found in Form"

That's because the stock UserAdmin defines fieldsets in which 'groups'
is a field, you need to modify the fieldsets, too. [1] 

[1]
https://code.djangoproject.com/browser/django/trunk/django/contrib/auth/admin.py#L27
-- 
Michał (Saviq) Sawicz 


signature.asc
Description: This is a digitally signed message part


Re: url problems

2011-07-04 Thread Herman Schistad
> the current url (path) is C:\Users\Dagon\mysite. Everything is relative to
> mysite.

Make sure you read the guide once more, and that you have "runserver"
up and running (issue the command: python manage.py runserver"
Then you go to the following URL: localhost:8000/polls and you will
hopefully get another result.

-- 
With regards, Herman Schistad

-- 
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.



Auth Login well documented but elusive

2011-07-04 Thread TuckFrance
Having problems with getting login to work even though it's well
documented. The pages for success, invalid, and no info provided
aren't getting used at all. Instead, clicking login always redirects
to /login which is not what I want. Any ideas?

URLconf:
...
(r'^accounts/login/$', 'django.contrib.auth.views.login'),

View:
...
def login(request):
username = request.POST['username']
password = request.POST['password']
user = authenticate(username=username, password=password)
if user is not None:
if user.is_active:
login(request, user)
return HttpResponseRedirect('/registration/
login_success/')
else:
return HttpResponseRedirect('/registration/
login_incorrect/')
else:
return HttpResponseRedirect('/registration/no_info/')

HTML template:

{% extends "base.html" %}
{% load url from future %}

{% block title %}
Login Page
{% endblock %}

{% block style %}
body{
background-color:pink;
}
{% endblock %}


{% block content %}

{% if form.errors %}
Your username and password didn't match. Please try again.
{% endif %}

Login

{% csrf_token %}


{{ form.username.label_tag }}
{{ form.username }}


{{ form.password.label_tag }}
{{ form.password }}







{% endblock %}

-- 
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: ANN: django-iadmin

2011-07-04 Thread Venkatraman S
On Mon, Jul 4, 2011 at 6:25 PM, Stefano Apostolico  wrote:

>
> I would like some feedback on
> https://github.com/saxix/djangoscreenshots-home-page-iadmin
> .
>
> Documentation in progress,  but demo application included.
>
> Suggestions and comments are welcome, any help will be appreciated
>

Screenshots look interesting. Would be great to see it production ready.

-V
http://twitter.com/venkasub
http://blizzardzblogs.blogspot.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.



ModelForm save call with data and instance

2011-07-04 Thread Constantine
def view(request)
form = MyForm(request.POST, instance = MyModel(myfiled = 1))
if form.is_valid():
obj = form.save()

but POST will NEVER merged with instance i've looked through stack:

ModelForm's save() 
https://code.djangoproject.com/browser/django/trunk/django/forms/models.py#L362

save calls:

return save_instance(self, self.instance, self._meta.fields,
 fail_message, commit, >>>
construct=False <<<)

BUT construct=False and in save_instance
https://code.djangoproject.com/browser/django/trunk/django/forms/models.py#L68

if construct:
instance = construct_instance(form, instance, fields,
exclude)

in doesn't populate instance with cleaned data

Bug or Feature?

and if it's feature, how can I set values dynamically if it's not
specified in POST

-- 
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.