Hi all,
I have an extended userprofile with AUTH_PROFILE_MODULE (ref: http://tinyurl.com/yhracqq)
I would like to set a user.is_guru() method similar to user.is_active(). This would results for al views (or rather templates) to e.g. disable/enable certain user messages, displaying of widgets, etc. The boolean is stored in the extended ...
I wrote this little function for writing out HTML tags:
def html_tag(tag, content=None, close=True, attrs={}):
lst = ['<',tag]
for key, val in attrs.iteritems():
lst.append(' %s="%s"' % (key, escape_html(val)))
if close:
if content is None: lst.append(' />')
else: lst.extend(['>', content, '</', tag, ...
Hi, all.
I am trying to design a tagging system with a model like this:
Tag:
content = CharField
creator = ForeignKey
used = IntergerField
It is a many-to-many relationship between tags and what's been tagged.
Everytime I insert a record into the assotication table,
Tag.used is incremented by one, and decremented by one in...
this is my model:
class Position(models.Model):
map = models.ForeignKey(Map,primary_key=True)
#members=models.CharField(max_length=200)
LatLng = models.CharField(max_length=40000)
infowindow = models.CharField(max_length=40000)
but it can't run ..
thanks
...
If there are are no values in the table how can should the code be to indicate no name found else show the drop down box in the below code
{% for name in dict.names %}
<option value="{{name.id}}" {% for selected_id in selected_name %}{% ifequal name.id selected_id %} {{ selected }} {% endifequal %} {% endfor %}>{{name.firstname}}</o...
Hi,
How can I add a field in the form init function? e.g. in the code below I want to add a profile field.
class StaffForm(forms.ModelForm):
def __init__(self, user, *args, **kwargs):
if user.pk == 1:
self.fields['profile'] = forms.CharField(max_length=200)
super(StaffForm, self).__init__(*args, **kwarg...
Hi, I am developing application on app-engine-path and I would like to upload some data to datastore.
For example I have a model
models/places.py:
class Place(db.Model):
name = db.StringProperty()
longitude = db.FloatProperty()
latitude = db.FloatProperty()
If I save this in view, kind() of this entity is "models_place"...
I haven't found any concrete language on the terminal commands for installing python 3.1 on Leopard using MacPorts. I already have 2.5.1 on Leopard by way of Apple. I don't want to mess with this version & I think having the newer version of Python running from my opt/local file would be better. Also SQL3 comes packed with the standard P...
I'm running Django on Linux using fcgi and Lighttpd. Every now and again (about once a day) the server just dies. I'm using the latest stable release of Django, Python and Lighttpd.
The only thing I can think of is that my program is opening a lot of files and executing a lot of external processes, but I'm fairly sure that side of thing...
Hi,
Common situation: I have a client on my server who may update some of the code in his python project. He can ssh into his shell and pull from his repository and all is fine -- but the code is stored in memory (as far as I know) so I need to actually kill the fastcgi process and restart it to have the code change.
I know I can grace...
When using Django "out-of-the-box" administration forms, the "change form" pages can be rather long for complex models (with a lot of fields).
I would like to use tabs in the "change form", so things can be more readable (group fields by tabs...)
Instead of doing it all by myself, by modifiying the 'change_form.html' admin template, I ...
Is it possible to let the users choose / change dynamically the columns displayed in a object list in Django administration ?
Things can surely be implemented "from scratch" by modifying the 'change_list.html' template but I was wondering if somebody has already had the same problem and/or if any django-pluggin can do that.
Thanks in a...
I am trying to grab a reference to images with src's in URI scheme. An example would be the images on google.com/news.
if I alert(escape(saveObj.image)); I get something like below:
data%3Aimage/jpeg%3Bbase64%2C/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQ...
Hey All,
I am making use of django-registration and django-profile to handle registration and profiles. I would like to create a profile for the user at the time of registration. I have created a custom registration form, and added that to the urls.py using the tutorial on:
http://dewful.com/?p=70
The basic idea in the tutorial is to...
Hi
I have such stuff in my django view:
message = 'sometext'
rating = 7
data = {'message':message, 'rating':rating}
from django.utils import simplejson
return HttpResponse(simplejson.dumps(data))
and this in my site.js:
$.ajax({
'type': "POST",
'url': url,
'data': {'rating':rating},
'success': function(msg){
alert(msg['rating'...
My Model
class Player(models.Model):
player_name = models.CharField(max_length=50)
player_email = models.CharField(max_length=50)
def __unicode__(self):
return self.player_name
My Root urls.py
urlpatterns = patterns('',
(r'^kroster/', include('djangosite.kroster.urls')),
(r'^admin/(.*)', admin.site.root),
)
My ...
I'm trying to set up the simple syndication example from the Django docs, in a working project. But I'm getting an ImportError, even though I'm sure I've copied the example exactly.
Here's what I have in feeds.py:
from django.contrib.syndication.views import Feed
class LatestEntriesFeed(Feed):
# etc
And here's what I have in url...
Has anyone else noticed performance issues using Django's F() object? I am running Windows XP SP3 and developing against the Django trunk. A snippet of the models I'm using and the query I'm building are below. When I have the F() object in place, each call to a QuerySet method (e.g. filter, exclude, order_by, distinct, etc.) takes ap...
Hi folks,
I'm using mechanize to navigate pages, it works pretty well.
Unfortunately I have a random error come up, by random I mean it occasionally appears.
URLError at /test/
urlopen error [Errno 1] _ssl.c:1325: error:140943FC:SSL routines:SSL3_READ_BYTES:sslv3 alert bad record mac>
I really need help on this one :)
...
I use dumpdata to output all my apps's classes. One of my app has one class that never get's outputted and I don't know where to start looking to know what's wrong. The class is used regularly, every other classes in the app are dumped fine and dumpdata doesn't throw any error.
Any cue ?
...