I have a simple model like so:
# models.py
class Announcement(models.Model):
"""
Table containing intranet announcements
"""
category = models.ForeignKey(AnnouncementCategory)
user = models.ForeignKey(User)
text = models.TextField()
timestamp = models.DateTimeField(auto
6:38 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On Sat, Nov 29, 2008 at 5:25 PM, AJ <[EMAIL PROTECTED]> wrote:
> > to the vairables self and commit. So as far as I can tell I can't do
> > this in the Admin. It looks like I would need to write my ow
I'm not sure if/how this is done in django version prior to 1.1, but
if you are using the 1.1 alpha or working from the trunk you can use
the F() expression:
http://docs.djangoproject.com/en/dev/topics/db/queries/#filters-can-reference-fields-on-the-model
On Mar 5, 1:46 pm, Adam Nelson wrote:
>
ROOT_URLCONF: 'tp.urls'
I just saw that line in my settings.py
--AJ
`
On Aug 22, 8:33 pm, Aman wrote:
> I recently installed Django on my personal Ubuntu Dev Server and have
> been trying with mod_wsgi (as mod_python is officially dead). I just
> had some breakthrough
ROOT_URLCONF = 'tp.urls'
Just saw this in my settings.py
--AJ
On Aug 22, 8:33 pm, Aman wrote:
> I recently installed Django on my personal Ubuntu Dev Server and have
> been trying with mod_wsgi (as mod_python is officially dead). I just
> had some breakthrough where I
file.html I get the title of Edit Profile with an
h1 tag and the word 'text' underneath it. However The form in the
profile_content block is not rendered, and is in fact not on the
page. I am doing something incorrect?
Thanks,
AJ
--~--~-~--~~~---~--~~
Yo
Turns out I figured out the problem. In the profile/profile.html file
there was an {% ifequal %} block, and the {% block profile_content %}
was inside that. This was causing the if to fail for the profile/
edit_profile.html template, thus no content.
On Mar 2, 6:12 pm, AJ <[EMAIL PROTEC
So I have a manager for an model that executes some custom sql. That
custom sql on a certain page populates a select dropdown. For an
example we'll say that the select is a list of colors, and there is
also a page to add new colors. If I add a new color then go to the
page that has the list of
s = Color.objects.custom_query()
return render_to_response('page.html', {'colors' : colors})
Is this not the proper way to setup the code so that the manager's
custom_query get's run every time it is called?
Thanks,
Aaron
On Apr 4, 11:50 am, "Karen Tracey" &l
(c.id, c.name) for c in Color.objects.custom_query()]
color = forms.Field(widget=widgets.Select(choices=colors),
initial="")
Is any sort of caching enabled by default? I haven't added/changed
any settings involving caching in the settings.py
On Apr 4, 2:11 pm, "Karen Tracey&qu
> On Fri, Apr 4, 2008 at 1:19 PM, AJ <[EMAIL PROTECTED]> wrote:
>
> > What would be the proper way to make sure the code is run each time
> > the manager is called? Here's a example of how I have my code
> > currently setup:
>
> > //models.py
>
s for all of your help.
On Apr 4, 2:11 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Fri, Apr 4, 2008 at 1:19 PM, AJ <[EMAIL PROTECTED]> wrote:
>
> > What would be the proper way to make sure the code is run each time
> > the manager is called? Here
> On Fri, Apr 4, 2008 at 2:25 PM, AJ <[EMAIL PROTECTED]> wrote:
>
> > The actual custom_query is called in forms.py, something similar to
> > the following:
>
> > //views.py
> > from app.forms import CrayonForm
>
> > def add_crayon(request):
> &g
My custom sql works great unless there is an ' in the query, then of
course it fails. The question is how do I escape the apostrophe? For
example the query is "pete's". I first tried:
query = query.replace("'", "\'")
If you printed the query out it does say "pete\'s", but as soon as it
gets su
Do you have your TEMPLATE_DIRS setting as a tuple or list? If it's a
tuple and it has only one element you need a trailing comma like so:
TEMPLATE_DIRS = (
'C:/python25/django/templates',
)
On Apr 15, 12:00 pm, "Gaurav Sharma" <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I am very new to Django an
HERE
`table`.`name` LIKE '%%%s%%' GROUP BY `table`.`original_id`;", [kw])
And I get a sql error, it looks like there are quotes going on the
inside of the %'s:
You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right
e % to the keyword then pass
it as a tuple to the 2nd paramater of the execute function. Using %
in the actual query does not work, even if you escape it with a double
%%.
Not sure if this is the best way but it seems to work as expected now.
On Apr 15, 2:03 pm, AJ <[EMAIL PROTECTED]> wrote:
&
I've run into an issue using a manager for a model to run some custom
sql.
A dumbed down version of the code looks something like this:
cursor = connection.cursor()
# Get list of zipcodes
zips = [zip.zipcode for zip in
Zip_Co
he parens around the params? I tried
passing in a string like '("3", "33344")' and it didn't error, but
it didn't return any results either.
On Jul 8, 8:00 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-07-08 at 16:56 -0700,
Thanks for your assistance, I got it working properly now.
On Jul 8, 9:55 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-07-08 at 17:17 -0700, AJ wrote:
> > Thanks for your quick reply. I have been searching for a long time
> > for good documentation on us
>>Here's a fun thought, why can't a custom blog like enty and the comments
>>framework be utilized to do this?
Precisely but I was hoping I'd get something with modifications.
Here is what I require:
* Posts in the system: bunch of text. --- (This i already have.)
* Each post gives user to be a
>>Wait aren't we programmers or not? This should be something you can do
>>in a couple days...
Indeed. Just wanted opinions. :)
Consider this resolved now.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to dj
Why has this become a case for me? I just wanted to know about a particular
solution, that whether it exists or not. I did try Google and other forums.
I never complained about 'a couple of days', someone else did.
I apologize for asking a 'dumb' question by your standards. Please accept my
since
Thanks a lot for that suggestion.
On Apr 15, 2011 8:52 AM, "Daniel Hilton" wrote:
> On 15 April 2011 13:01, roberto wrote:
>> You can also have a look at askbot.
>> It seems to have more functionalities.
>> Good luck !
>>
>> www.askbot.org
>>
&
I see. Any clue where I can begin in my case (for filters etc.)? 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-us
Appreciate your response, Shawn. I am a newbie and struggling.
Yea, but that is 'latest'. I need ascending descending order by
score/votes. Can't seem to figure that one out. That would go in the else
part. By default in my app, I want the comments to be sorted by vote/score.
else:#This is
I am not aware what 'relations' can do or if there was anything like
'relations' let alone 'GenericRelations' :)
What does the Sum('vote') done?
--
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
I am impressed at the maturity of folks around here. Keep up the good work
folks. :)
--
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
Oh, I can agree with that. I am just saying that the way it was handled by
Shawn and GKR...I liked 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
>From what you've tried to explain, I can see that you would really want to
use AJAX, that means, for that page you have to write a JavaScript handler
(function that handles the event of adding a new record by pressing Add or
Enter). The JS will take care of the page not being submitted/refreshed.
.
> 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.
>
--
AJ
--
You received this message because you are subscribed to the Google Groups
"
t;
> so shall i put the scripts directly on the template file to work out or is
> there any better alternate..
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-user
ango 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 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-
o 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
Sorry about that. It is indeed not right. I will take care of this from next
time onwards.
On Mon, May 16, 2011 at 11:45 AM, Fabian Ezequiel Gallina <
galli...@gmail.com> wrote:
> 2011/5/16 AJ :
> > I think you are getting the poll object back. You need to specify the
> method
;t comment on whether it works, what it does,
> etc.
>
> 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 unsub
Thanks for the great advice Tom.
On Tue, May 17, 2011 at 12:33 PM, Tom Evans wrote:
> On Tue, May 17, 2011 at 5:04 PM, AJ wrote:
> > Many times I do not know how to use some snippets on djangosnippets.org.
> has
> > anyone else felt the same? I, obviously, am a newbie.
>
email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
--
AJ
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
As Simon mentioned that it is a bad idea and I agree but just for the
answer's sake you could save them as BLOBs
http://www.postgresql.org/files/documentation/books/aw_pgsql/node96.html
Am I correct folks?
<http://www.postgresql.org/files/documentation/books/aw_pgsql/node96.html>
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/dja
ll become known as a valuable
> community resource, and the entire community will benefit.
>
> Yours,
> Russ Magee %-)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email
am yet to start with it properly.
Is anyone using or used a cheatsheet for keyboard shortcuts with Komodo?
Thanks.
AJ
--
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@googlegrou
ot;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=
id you really mean 404? That would
> change my reply.
>
> Best,
> Gabe
>
> --
> 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 unsu
Simon,
Can you please give details of plugins that you use for Python/Django in
MacVim?
Thanks,
AJ
On Tue, May 24, 2011 at 12:51 PM, Simon Connah wrote:
>
> On 20 May 2011, at 21:18, Kevin Monceaux wrote:
>
> > On Fri, May 20, 2011 at 07:51:06AM -0400, Brian Bouterse wrote:
>
://www.vim.org/scripts/script.php?script_id=69
but again, still have to deal with the learning curve.
Having complained enough, I still think that if I do not give up this time,
I will be better off with this editor as my primary.
Best,
AJ
On Tue, May 24, 2011 at 4:02 PM, Simon Connah wrote
his group at
> http://groups.google.com/group/django-users?hl=en.
>
--
AJ
--
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 e
of django templates). Stick with one editor for a few weeks and
> decide what additional functionality you might need. Then do some searching
> based on those requirements to see if there's a better option.
>
>
> On 26 May 2011 21:11, Shawn Milochik wrote:
>
>> On 05/26/20
o 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.
>
>
--
AJ
--
You received this message because you are subscribed to the Google Groups
"Dja
/test/ etc. but
Dreamhost uses passenger and I am not sure how to install multiple instances
of a Django app per domain on Dreamhost either.
What are you suggestions? Please feel free to point me to earlier
discussions or articles or tools that I can use to achieve this.
Thanks a lot.
AJ
--
You receiv
web projects?
Best,
AJ
On Fri, Jun 3, 2011 at 2:05 PM, Cal Leeming [Simplicity Media Ltd] <
cal.leem...@simplicitymedialtd.co.uk> wrote:
> Hi AJ,
>
> Just a heads up, I have had a few clients in the past who used Dreamhost
> (and I had to set it up for them). They are not
om.
> 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.
>
>
--
AJ
--
You received this message because you are subscribed to the Google Groups
&q
and users will not email amongst themselves.
On Sat, Jun 4, 2011 at 12:21 AM, Kenneth Gonsalves
wrote:
> On Fri, 2011-06-03 at 14:12 -0400, AJ wrote:
> > To change the question or ask a new one too: what name do you suggest
> > as a
> > good, reliable yet economical hostin
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.
>>>
>>>
>> --
>> Y
be using to
search for this kind of behaviour.
If you want additional information, please let me know.
Thanks.
AJ
--
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
Hi Shawn,
Thanks for your reply. To begin with, I am trying this with a small test
app.
I have this so far. I tried with two textarea elements on a page and tried
to save them but I cannot figure out how to save two elements. Each element
list corresponds to one model instance or table row for Te
I do realize that I need the number of elements so that I can loop over that
many times...
On Sun, Jul 3, 2011 at 4:30 PM, AJ wrote:
> Hi Shawn,
>
> Thanks for your reply. To begin with, I am trying this with a small test
> app.
>
> I have this so far. I tried with two text
Nevermind. I did not know about and eventually solved it with formsets.
Thanks.
On Sun, Jul 3, 2011 at 4:34 PM, AJ wrote:
> I do realize that I need the number of elements so that I can loop over
> that many times...
>
>
> On Sun, Jul 3, 2011 at 4:30 PM, AJ wrote:
>
>>
I have a model like this:
class Post (models.Model):
name = models.CharField(max_length=1000, help_text="required, name
of the post")
description = models.TextField(blank=True)
custom_hashed_url = models.CharField(unique=True, max_length=1000,
editable=False)
def save(self, *args, **k
No one?
On Mar 16, 10:05 pm, AJ wrote:
> I have a model like this:
>
> class Post (models.Model):
> name = models.CharField(max_length=1000, help_text="required, name
> of the post")
> description = models.TextField(blank=True)
> custom_hashed_url
.
--AJ
On Mar 17, 10:39 am, Daniel Roseman wrote:
> On Thursday, March 17, 2011 2:33:50 PM UTC, AJ wrote:
>
> > No one?
>
> > On Mar 16, 10:05 pm, AJ wrote:
> > > I have a model like this:
>
> > > class Post (models.Model):
> > > name = models.C
I have tried both solutions but could not achieve the results. here is
the actual code that I started working with. This is the simplest
version that I did to test this feature.
Model--
class Post (models.Model):
name = models.Ch
OK. I believe that the form is invalid.
"if post_form.is_valid():"
actually fails and it prints "not working".
I am using the default form that Django creates from
class PostForm(ModelForm):
class Meta:
model = Post
Is it not good?
On Mar 18, 10:1
My form is not valid and I cannot figure out why. I am using Django's
ModelForm to generate a form (As above). I printout out the
request.POST and all it has is
"csrfmiddlewaretokenname"
Just putting it here.
--
You received this message because you are subscribed to the Google Groups
"Django
No, the form submits, with other values too, to the view but it just
does not validate.
AJ
--
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 g
I was wondering if there is a pluggable application in Django that I
can use which is a replica of Stackoverflow kind Answer and
commenting.
Each post on my web app will have answers and all answers can have
comments discussing that answer, just like SO.
Does anyone know such an app or has anyone
Isn't there any app with just the commenting part? I mean the answer and
comments on those answers part only.
--
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 fro
I am kind of aware of that. I just want to add a Stackoverflow kind of a
commenting system (with comments on answers and voting on answers) to my
already present application.
Does anyone know if Django's own comment app can be enhanced to be that or
has anyone already done that?
On Wed, Apr 13,
if contactform.is_valid():
contactform.save()
elif request.method == 'POST' && 'feedback' in request.post :
feedbackform = feedbackForm(request.POST)
if feedbackform.is_valid():
feedbackform.save()
else:
contactform = contactForm()
I have Python 2.7.3
I am new in django and I am following the tutorial 3 at :
https://docs.djangoproject.com/en/1.6/intro/tutorial03/
I followed exactly the steps described:
Here is a copy/paste from files in the project:
*cat polls/views.py*
from django.http import HttpResponse
def index(r
On Friday, April 15, 2011 2:59:32 PM UTC+5:30, paganplan paganplan wrote:
>
> Solved!
> in settings.py file, option 'ENGINE' must be like this:
> django.db.backends.mysql
>
> 2011/4/14, pagan >:
> > same problem. apache2, mod_wsgi, python-mysqldb installed. When i add
> > databases engine, name,
as far i understand you want to connect with postgreSQL database on jupyter
notebook :
you can do like this
1. install -c anaconda psycopg2 and install -c anaconda sqlalchemy
*2. *from sqlalchemy import create_engine and import pandas as pd
3.
engine=create_engine(‘postgres+psycopg2://postgres:
This person had a similar problem. Hopefully this can give you some clue
to help fix your issue:
http://stackoverflow.com/questions/26276397/django-1-7-upgrade-error-appregistrynotready-apps-arent-loaded-yet
--
You received this message because you are subscribed to the Google Groups
"Django
I don't know if it matters but I usually do pip upgrades this way:
pip install --upgrade django
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsu
75 matches
Mail list logo