On 25 March 2010 09:25, Scot Hacker wrote:
>
>
> It sounds like you're saying that the model method is not
> attaching to an instance like it usually does (which is why "self"
> doesn't work). But I'm no closer to figuring out how why it's
> different from model methods accessed from within views
On Thu, Mar 25, 2010 at 5:52 AM, Kenneth Gonsalves wrote:
> hi,
>
> I have a model like this:
>
> name - unique
> slno - not null
> mode - not null
>
> If the instance does not exist and I give all three values to get_or_create,
> it works
>
> if the instance exists, and I give values for slno and
On Wed, Mar 24, 2010 at 8:16 PM, Shawn Milochik wrote:
> Have your 'export' button make an AJAX call to a view, which creates the CSV
> file and prompts the user to 'Save As.'
>
> Details:
>
> 1. Use the same view you currently have, with an 'if' statement which
> returns a standard (html
On Mar 25, 9:32 am, Tom Evans wrote:
> On Thu, Mar 25, 2010 at 5:52 AM, Kenneth Gonsalves wrote:
> > hi,
>
> > I have a model like this:
>
> > name - unique
> > slno - not null
> > mode - not null
>
> > If the instance does not exist and I give all three values to get_or_create,
> > it works
>
>
On Thu, Mar 25, 2010 at 10:29 AM, Daniel Roseman wrote:
>
> Actually the kwarg is 'defaults', not 'initial'.
>
> See
> http://docs.djangoproject.com/en/1.1/ref/models/querysets/#get-or-create-kwargs
> --
> DR.
>
Indeed :/
coffee++
Cheers
Tom
--
You received this message because you are subs
Has anybody tried using Django with a tiny linux distribution?
Thanks for replies
Mm.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email
On Thu, Mar 25, 2010 at 05:11:28AM -0700, Pythoni wrote:
> Has anybody tried using Django with a tiny linux distribution?
It depends on how you define "tiny". I've just bootstrapped Debian,
installed Django and apache2, and removed docs. The result is:
Base system154 MB
Django 52 MB
http://pastebin.com/dFW6MdBm
Hi
I have a raw MySQL query which im using for performance reasons.
It works great except under one condition. When i want to apply a
filter based on a directories related table 'tags'. In SQL i use this:
`directory_directorytag`.`name` = '%s'
now typically i would w
Hi,
I've just set up the admin site and when I try to log in, I get the
following message:
"Looks like your browser isn't configured to accept cookies. Please
enable cookies, reload this page, and try again."
Following extensive searching through this group, google, and just
about every other re
look at turnkeylinux.com
They have an ubuntu django base system ready to go.
Thanks,
Richard
On Thu, Mar 25, 2010 at 8:11 AM, Pythoni wrote:
> Has anybody tried using Django with a tiny linux distribution?
> Thanks for replies
> Mm.
>
> --
> You received this message because you are subscribed
Hi,
I need to block google indexer from indexing my site.
If it was a static site, i would put a htaccess or robots.txt, but
django is different right.
I cant put robot meta tag also, cause there are many pages in my site.
How do i do it then?
Vishnu Kumar
--
You received this message because
On 25 Mar 2010, at 14:18 , vishnu.kumar wrote:
>
> Hi,
>
> I need to block google indexer from indexing my site.
>
> If it was a static site, i would put a htaccess or robots.txt, but
> django is different right.
> I cant put robot meta tag also, cause there are many pages in my site.
>
> How d
On Mar 24, 5:30 pm, adam wrote:
> derek
>
> i want to do the same thing.
>
> first, the site below mentioned about
> filtering.http://patrickbeeson.com/blog/2008/aug/11/how-create-user-specific-ad...
>
> in this time, you have to give country_id as a request parameter by
> changing link url.
> li
On Mar 24, 11:21 pm, Thierry Chich wrote:
> Le mercredi 24 mars 2010 16:53:12, Sandman a écrit :
>
> > Hi Derek,
>
> > One way to do this would be to create a proxy model that can be used
> > throughout your project.
>
> > Check out
> >http://docs.djangoproject.com/en/dev/topics/db/models/#proxy-m
Not sure if this will help, but the docs have a pretty in-depth
explanation of doing csv export.
http://docs.djangoproject.com/en/dev/howto/outputting-csv/
HTH,
Alex
On Mar 24, 3:03 pm, jlwlynn wrote:
> I'm trying to simply export CSV, but have failed miserably. First I
> perform a search and
I would not recommend to mess with contrib.auth.models. If you want to
make some fields of the User model required I would do this on form
level. Just create a custom model form for User and override the
fields in questions.
On Mar 25, 2:43 pm, derek wrote:
> On Mar 24, 11:21 pm, Thierry Chich w
Thanks Tim,
Yes, I just saw this. I was subclassing auth.User because I didn't
know the right way to do it.
Now I am on the right track.
Just one thing I can't figure out.
"When a user profile model has been defined and specified in this
manner, each User object will have a method -- get_profi
On Thu, Mar 25, 2010 at 2:48 PM, Jim N wrote:
> Thanks Tim,
>
> Yes, I just saw this. I was subclassing auth.User because I didn't
> know the right way to do it.
>
> Now I am on the right track.
>
> Just one thing I can't figure out.
>
> "When a user profile model has been defined and specified i
I work as a single person on a single machine. I use an unstable
programme that requires me to employ more than one OS user. The
programme will store some files locally (in each specific user
environment).
I am trying to build a Django application to centralise the
information gathered by this uns
On Thu, Mar 25, 2010 at 08:27:37AM -0700, BobAalsma wrote:
> I am trying to build a Django application to centralise the
> information gathered by this unstable programme, but in some cases I
> need to refer to the stored files. So I want to store the
> "originating" OS user name in the database, a
On Thu, 2010-03-25 at 11:22 +0530, Kenneth Gonsalves wrote:
> hi,
>
> I have a model like this:
>
> name - unique
> slno - not null
> mode - not null
>
> If the instance does not exist and I give all three values to get_or_create,
> it works
>
> if the instance exists, and I give values for sl
On Thu, Mar 25, 2010 at 3:47 PM, Malcolm Tredinnick
wrote:
> On Thu, 2010-03-25 at 11:22 +0530, Kenneth Gonsalves wrote:
>> hi,
>>
>> I have a model like this:
>>
>> name - unique
>> slno - not null
>> mode - not null
>>
>> If the instance does not exist and I give all three values to get_or_creat
92 {%ifequal au.ReservePrice 0%}
93 None
94 {%else%}
95 {%if au.ReservePrice > au.currentbid %}Met{%else%}Not
Met{%endif%}
96 {%endifequal%}
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
On Thu, Mar 25, 2010 at 4:09 PM, Bobby Roberts wrote:
> 92 {%ifequal au.ReservePrice 0%}
> 93 None
> 94 {%else%}
> 95 {%if au.ReservePrice > au.currentbid %}Met{%else%}Not
> Met{%endif%}
> 96 {%endifequal%}
>
Since you haven't said what goes wrong with it, I will
Walt,
Thanks for the response. This is making me crazy. Seems like this
should be an easy thing to do.
I have tried your suggestion, but I am not totally clear on where in
the admin.py It is just not loading up the new media class.
Am I supposed to add the resize class as a separate class like t
On Thu, 2010-03-25 at 15:58 +, Tom Evans wrote:
[...]
>
> He is describing this situation:
>
> >>> User.objects.get(username='tevans...@googlemail.com')
>
> >>> User.objects.get_or_create(username='tevans...@googlemail.com')
> (, False)
> >>> User.objects.get(username='tevans...@googlemail.c
Hi,
For my xml sitemap i would like to show blog posts and pages from the
CMS. How can i pass 2 querysets to the dictionary ?
What i have so far is below, it's obviously wrong :-(
info_dict = {
'queryset': Page.objects.filter(active=1),
'queryset': Entry.objects.filter(status=1),
'da
sorry -
it is in the template an the traceback thrown is:
'if' statement improperly formatted
On Mar 25, 12:11 pm, Tom Evans wrote:
> On Thu, Mar 25, 2010 at 4:09 PM, Bobby Roberts wrote:
> > 92 {%ifequal au.ReservePrice 0%}
> > 93 None
> > 94 {%else%}
> > 95 {%if
On Thu, Mar 25, 2010 at 4:23 PM, Malcolm Tredinnick
wrote:
> No, he's not, because Kenneth said that the instance exists. In your
Actually, he described both situations where the instance exists, but
with different values for the non-key attributes of the model, and
where the instance doesn't exi
On Thu, Mar 25, 2010 at 11:28 AM, Bobby Roberts wrote:
> it is in the template an the traceback thrown is:
>
> 'if' statement improperly formatted
The documentation states:
> New in Django Development version.
> if tags may also use the operators ==, !=, <, >, <=, >= and in which work as
> foll
On Thu, Mar 25, 2010 at 12:28 PM, Bobby Roberts wrote:
> sorry -
>
> it is in the template an the traceback thrown is:
>
> 'if' statement improperly formatted
>
You are trying to use a feature added for 1.2 (smart if) with 1.1.X level
code.
Karen
--
You received this message because you are s
thanks for your quick reply... is there a quick way to do something
like this in 1.1?
On Mar 25, 12:40 pm, Karen Tracey wrote:
> On Thu, Mar 25, 2010 at 12:28 PM, Bobby Roberts wrote:
> > sorry -
>
> > it is in the template an the traceback thrown is:
>
> > 'if' statement improperly formatted
On Thu, Mar 25, 2010 at 4:42 PM, Bobby Roberts wrote:
> thanks for your quick reply... is there a quick way to do something
> like this in 1.1?
>
Import the smart_if as a standalone, separate tag:
http://www.djangosnippets.org/snippets/1350/
Cheers
Tom
--
You received this message because yo
Have you set SESSION_COOKIE_DOMAIN in settings.py? Without that being
set correctly, you'll run into the problem you've described above. In
your case,
SESSION_COOKIE_DOMAIN = 'dev.mydomain.com'.
http://docs.djangoproject.com/en/dev/ref/settings/#session-cookie-domain
On Mar 25, 7:47 am, Tim w
Hi Bob,
this not a Django specific question/problem but more a general Python question.
The information you are looking for is most likely located in the
os.environ object.
So take a look at this in your python commandline/shell
>>> import os
>>> [i for i in os.environ.items()]
and look for the
On Mar 25, 4:27 pm, grimmus wrote:
> Hi,
>
> For my xml sitemap i would like to show blog posts and pages from the
> CMS. How can i pass 2 querysets to the dictionary ?
>
> What i have so far is below, it's obviously wrong :-(
>
> info_dict = {
> 'queryset': Page.objects.filter(active=1),
>
On Mar 25, 4:44 pm, Genghisu wrote:
> Have you set SESSION_COOKIE_DOMAIN in settings.py? Without that being
> set correctly, you'll run into the problem you've described above. In
> your case,
>
> SESSION_COOKIE_DOMAIN = 'dev.mydomain.com'.
>
> http://docs.djangoproject.com/en/dev/ref/settings
I'd prefer not to as I keep switching between 15-20 users and find the
log in of the OS quite enough, thank you.
My beautiful but unstable programme makes it a good idea to
periodically fully log out and log in, say twice a day...
On Mar 25, 4:47 pm, Baurzhan Ismagulov wrote:
> On Thu, Mar 25, 20
Hello Bobby,
On Mar 25, 9:42 am, Bobby Roberts wrote:
> is there a quick way to do something like this in 1.1?
You could do the comparison at the view level and then set an
attribute on your object with the result.
Toodle-lo..
creecode
--
You received this message because
Hi Benjamin,
Thanks, I'll have look.
Bob
On Mar 25, 4:43 pm, Benjamin Reitzammer wrote:
> Hi Bob,
> this not a Django specific question/problem but more a general Python
> question.
> The information you are looking for is most likely located in the
> os.environ object.
> So take a look at th
YES!
Works beautifully, thanks.
On the newbie part: how could I have found this?
I did find the os.environ and you've helped me discover how to look
inside, but what if I need something completely different?
Regards,
Bob
On Mar 25, 4:43 pm, Benjamin Reitzammer wrote:
> Hi Bob,
> this not a Dja
Hello Vishnu,
You might find Django Robots <
http://bitbucket.org/jezdez/django-robots/overview/
> of use.
On Mar 25, 6:18 am, "vishnu.kumar" wrote:
> I need to block google indexer from indexing my site.
>
> If it was a static site, i would put a htaccess or robots.txt, but
> django is differ
Check the module index in the python website: http://docs.python.org/
modindex.html
There you will find everything about python modules like sys, os, and
others.
Regards,
Oscar C.
El 25/03/2010, a las 18:28, BobAalsma escribió:
YES!
Works beautifully, thanks.
On the newbie part: how cou
OK, found it - thanks!
Regards,
Bob
On Mar 25, 6:40 pm, "piz...@gmail.com" wrote:
> Check the module index in the python website:http://docs.python.org/
> modindex.html
>
> There you will find everything about python modules like sys, os, and
> others.
>
> Regards,
> Oscar C.
>
> El 25/03/2010
I am connecting facebook to an app I have running. In order not to
change a load of code I created a dummy account when someone logs in
through facebook. My only problem is I want to authenticate with this
account when they log Is there a way to login in a user using the
encrypted password. I am u
On Mar 11, 1:03 pm, Tom Evans wrote:
> On Thu, Mar 11, 2010 at 4:54 PM, russianbandit
> wrote:
> > I'm using UserProfile to add one field to my users. However, I know
> > that I must explicitly create UserProfile for each new user that
> > registers. So, I make a UserProfile upon registration. I
>On Thu, Mar 25, 2010 at 2:00 AM, mjlissner wrote:
> I'll make things more concrete. I have the following in my model
> (which is made into a ModelForm):
> class UserProfile(models.Model):
> barmembership = models.ManyToManyField(BarMembership,
> verbose_name="the bar memberships held by
The old django debug-toolbar used to make it possible to group
statements that were the same so you can see if a particular statement
was called repeatedly. This does not appear to be possible in the
latest version; or am I wrong?
--
You received this message because you are subscribed to the Goo
I wasn't using ProfileForm(instance = userProfile) because I didn't
realize I could. Wow, that makes things easier and neater.
Thanks so much.
On Mar 25, 11:57 am, Nuno Maltez wrote:
> >On Thu, Mar 25, 2010 at 2:00 AM, mjlissner wrote:
> > I'll make things more concrete. I have the following in
Hi!
Example code:
==
{% for pretty_date, days_events in date_days_events_tuple %}
...
...
{% for details in days_events %}
...
...
{% endfor %}
...
...
{% endfor %}
==
The output:
==
..
..
...
==
What I really want:
==
..
..
...
If what you want to achieve is to log in a user programmatically you
don't do that by authenticating by username and password.
Example:
def login_by_id(request):
user = FacebookUser.objects.get(...).user
from django.contrib.auth import load_backend, login
for ba
Is it possible to do
{% cycle "odd" "even" as parent_cycle_thing %}
?
If so there's your answer.
On 25 Mar, 19:57, mhulse wrote:
> Hi!
>
> Example code:
>
> ==
>
> {% for pretty_date, days_events in date_days_events_tuple %}
> ...
>
> ...
> {% for details in days_events %}
> ...
> ...
>
Generally, try to build your application so that it doesn't blindly
depend on the profile existing. The signal example Tom showed you is
good as it means you won't have to check if the UserProfile instance
exists for the user on every turn. However, don't depend on the data
within. Keep it light an
On Thu, Mar 25, 2010 at 3:57 PM, mhulse wrote:
> Hi!
>
> Example code:
>
> ==
>
> {% for pretty_date, days_events in date_days_events_tuple %}
> ...
>
> ...
> {% for details in days_events %}
> ...
> ...
> {% endfor %}
> ...
>
> ...
> {% endfor %}
>
> ==
>
> The output:
>
> =
Hi Peter and Bill! Thanks for the quick replies, I really appreciate
it. :)
@Peter:
I tried this:
==
{% for foo, baz in tuple %}
...
...
{% cycle "odd" "even" as foo %}
{% for bar in baz %}
...
...
{% endfor %}
...
...
{% endfor %}
==
But the cycle "renders" the output and t
> As I understand it, {{ foo }} renders the current value of the
> variable and doesn't change it.
> {% cycle foo %} or the creating {% cycle "odd" "even" as foo %}
> advance the variable and
> then render it. So you still need one of the latter in your loop, or
> the variable won't advance.
Ahhh
As I understand it, {{ foo }} renders the current value of the
variable and doesn't change it.
{% cycle foo %} or the creating {% cycle "odd" "even" as foo %}
advance the variable and
then render it. So you still need one of the latter in your loop, or
the variable won't advance.
On Thu, Mar 25,
Hi Peter,
I'm building an app where all logged-in users will be a Django user,
rather than creating some new separate class of users just for my own
app.
But to make it work, these users have to have more than the minimal
information contained in the django.contrib.auth.models User. I
figure tha
On 25 Mar, 17:27, grimmus wrote:
> Hi,
>
> For my xml sitemap i would like to show blog posts and pages from the
> CMS. How can i pass 2 querysets to the dictionary ?
>
> What i have so far is below, it's obviously wrong :-(
>
> info_dict = {
> 'queryset': Page.objects.filter(active=1),
>
Hi,
I am looking to implement an "Export to Excel sheet" feature. The
result-set is already available and rendered in the template. I need
to provide a link or button to export result to Excel sheet.
Result-set is a set of list variables and cannot be passed over GET
request due to length limitat
My models are:
class Album(models.Model):
slug = models.SlugField(
unique=True,
help_text=_("Suggested value automatically generated from title.
Must be unique.")
)
# using name of the model, rather than the model object itself,
# because Photo is not yet d
On Thu, Mar 25, 2010 at 9:03 PM, Dries Desmet wrote:
> My models are:
>
>
> class Album(models.Model):
> slug = models.SlugField(
> unique=True,
> help_text=_("Suggested value automatically generated from title.
> Must be unique.")
> )
> # using name of the mod
On 26 March 2010 01:11, Ramiro Morales wrote:
> On Thu, Mar 25, 2010 at 9:03 PM, Dries Desmet wrote:
> > My models are:
> >
> >
> > class Album(models.Model):
> > slug = models.SlugField(
> > unique=True,
> > help_text=_("Suggested value automatically generated from titl
I have 2 models: A, B
I need a form that inserts/updates both fields of A and fields of B.
Is there any way to create a ModelForm tied to A & B? Or do I need to
use the plain old Form?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
I also read a good article. As it turns out im using a lot of inner joins:
http://www.caktusgroup.com/blog/2009/09/
This was quite handy.
My processis usually build it to be as fast as possible in raw SQL
then go back in and try and makre it with the ORM.
"I've read your description and it does
I have a question about model.ForeignKey field.Foreign key fields are
shown as object in admin page. How can I show them in other types like
integer type
for example I have a Model like this:
class Advisor(models.Model):
advisorid = models.IntegerField(primary_key=True,
db_column='advisorId')
This should help:
http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#raw-id-fields
Shawn
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, s
I have a simple model that allows a volunteer to have many jobs and a
job to have many volunteers:
class Volunteer(models.Model):
jobs = models.ManyToManyField( 'Job', blank=True )
The following ModelForm displays a Multi-select widget so I can choose
all the jobs for a volunteer:
class
I cant show the foreignkey values in a list_display. I tried
raw_id_fields but didnt work
On 25 Mart, 23:18, Shawn Milochik wrote:
> This should help:
>
> http://docs.djangoproject.com/en/1.1/ref/contrib/admin/#raw-id-fields
>
> Shawn
--
You received this message because you are subscribed to t
On Thursday 25 Mar 2010 9:17:12 pm Malcolm Tredinnick wrote:
> I don't understand what you are saying here. If the instance exists (as
> in, the filter parameters passed to get would return a single item),
> that instance is returned and the default parameters are never
> considered. So the values
Hmm, on second thoughts...
I tested from the shell in a few user environements and it worked.
However, when applying this to Django, all users show the user name of
the user running the server.
Hindsight makes this logical, as the other users only use their
browser, not their own local python.
Hmm, on second thoughts...
I tested from the shell in a few user environements and it worked.
However, when applying this to Django, all users show the user name of
the user running the server.
Hindsight makes this logical, as the other users only use their
browser, not their own local python.
In addition:
So maybe Baurzhan was right: using a database login (explicit or
implicit) could be the easier solution to build.
Regards,
Bob
On Mar 26, 7:32 am, BobAalsma wrote:
> Hmm, on second thoughts...
>
> I tested from the shell in a few user environements and it worked.
>
> However, when a
73 matches
Mail list logo