I cant find something about this on the net.
What is the difference if i leave out the through
parameter on a ManyToManyField
in a model definition like this one from the django docs:
class Person(models.Model):
name = models.CharField(max_length=128)
def __unicode__(self):
On Monday 24 Aug 2009 5:47:02 pm Gungor wrote:
> class Admin_Panel(admin.ModelAdmin):
> list_display=("name","surname","date","time")
> ordering=["-date","time"]
> search_fields=("name","surname","date")
> class Filtre(admin.ModelAdmin):
> fil =
Running Django 1.1, and I get funny results in testing which indicate
ordering.
Two applications: A and B.
A requires that you set settings.A_SETTING in your project's
settings.py, which refers to an interface. It has a test case that
modifies A_SETTING from its normal, default value in order
On Monday 24 Aug 2009 5:41:07 pm Kenneth Gonsalves wrote:
> > both admin media and sitemedia work perfectly. Only the uploaded media
> > does not get served. It gets saved in the correct location, a look at the
> > page source shows that the url is correct, but apache refuses to put it
> > on the
Thanks again Mike, this solved everything.
d
On Aug 24, 1:02 pm, Mike Ramirez wrote:
> On Sunday 23 August 2009 06:48:33 pm The Danny Bos wrote:
>
>
>
>
>
> > Hey, so I've got this code to quickly create thumbnail files, below.
> > When I give it a value, it squishes the
Thanks Tim, in that case I will carry on this way.
2009/8/23 Tim Chase :
>
>> The raw SQL is something along the lines of "INSERT INTO backup SELECT
>> * FROM today; DELETE FROM today;".
>>
>> Is there a Django way of doing this? I would required something
>>
On Mon, Aug 24, 2009 at 9:11 PM, Michael Thomason wrote:
> Anyway, I have two concerns. I'm building a web application that will
> be a portal for different companies.
>
> http://example.com/company1/webapp/
> http://example.com/company2/webapp/
>
I have a programming background, with C, C++, Objective C, and for web
I've always used PHP, which I can build most anything with.
Read a Python book, and I'm wondering if Django is right for my next
project. I know MVC, so I think I know what the framework is about,
but I haven't looked far
Hi,
You can use the strip_tags function to strip all html from text.
from django.utils.html import strip_tags
In your view
comment = strip_tags(request.POST["comment"])
--
Regards
Parag
On Tue, Aug 25, 2009 at 4:25 AM, When ideas fail
wrote:
>
> Hello, i want to
I have a hierarchy of models where the bottom object in the hierarchy has a
many to many relationship to itself.
Here are my models and views:
models.py
class Bar(models.Model):
name = models.CharField(max_length=200)
class BarPart(models.Model):
bar = models.ForeignKey(Bar)
name =
Note the normal method of creating a PG DictCursor doesn't seem to
work through Django's db module. Is anyone aware of a workaround?
import psycopg2.extras
from django.db import connection
connection.cursor(cursor_factory=psycopg2.extras.DictCursor)
TypeError: cursor() got an unexpected keyword
There's no way to do this?
On Aug 10, 8:47 am, Chris wrote:
> You can get a backend neutral database cursor with
> django.db.connection.cursor(). However, any results executed are
> returned as nameless lists. Is there a way to get results returned as
> dictionaries, via
I am using Nginx as a front end web server redirecting Python requests
to Apache + mod_wsgi. Everything with that is working fine. I have one
Django project running and I want to setup subdomains for a few of my
project apps.
Proposed structure:
/www/project/ -
-->/admin/ - admin.domain.com
On Mon, Aug 24, 2009 at 7:01 PM, MIL wrote:Since I had
the pleasure of getting help in here once I will try
> again :o)
>
> I have read about the mark_safe, and I would like to use it, but it
> just returns the value "False"
>
> What am I doing wrong?
>
> i my view:
> from
Thanks for the quick answer, Dan! That project is exactly what I was looking
for.
http://github.com/CrowdSense/django-saas-kit/tree/master
Cheers!
2009/8/24 Daniel Hilton
>
> You might have alook at the saas kit which is availble on github,
> which does subscription
On Aug 25, 6:19 am, Michael wrote:
> On Mon, Aug 24, 2009 at 3:57 PM, Léon Dignòn wrote:
>
> > Hello,
>
> > there are plenty of possible combinations out there. The suggested one
> > is apache and mod_wsgi, but in the docs is also mentioned, that
>
Since I had the pleasure of getting help in here once I will try
again :o)
I have read about the mark_safe, and I woul like to use it, but it
just returns the value "False"
What am I doing wrong?
i my view:
context = RequestContext(request, {
'title' : title,
Since I had the pleasure of getting help in here once I will try
again :o)
I have read about the mark_safe, and I would like to use it, but it
just returns the value "False"
What am I doing wrong?
i my view:
from django.utils.safestring import mark_safe
...
context =
Another thread today just clued me in. Adding @property to the model
method made it work. Thank you for helping out Javier, I provided the
full example below in case someone else looks for this:
import urlparse
def stripdomain(url):
bits = urlparse.urlparse(url)
return bits[1]
class
On Mon, Aug 24, 2009 at 5:37 PM, Merrick wrote:
> Do you know if there is a way to have url.domain return what
> stripdomain() did above? Otherwise I'll use a template filter and move
> on.
no need for a filter, {{url.stripdomain}} will call url.stripdomain()
or, you could
Exactly. Thats what I need to learn :o)
Thanks alot :o)
On 21 Aug., 17:25, David Zhou wrote:
> On Aug 21, 2009, at 9:54 AM, MIL wrote:
>
> > this works fine but I dont want to repeat it in all my views:
> > def my_profile(request):
> > gotta_go_through =
Looks like we were writing at the same time. I also was not aware you
could call a model method in a template without the parenthesis,
that's where I was getting hung up.
Again thank you.
On Aug 24, 3:54 pm, Javier Guerra wrote:
> On Mon, Aug 24, 2009 at 5:37 PM,
Hello, i want to allow users to post comments and I don't want them to
be allowed to put html in comments.
However I would like the to be able to use paragraph p tags and
tags but not anything other. Could someone tell me how to do this?
Thanks
Andrew
Hi Guys,
Relative newbie and I want to ensure I'm getting started on the right
track. How does this model look?
# encoding: utf-8
"""
class P4Document(models.Model):
depotfile = models.CharField(max_length=1024)
action= models.CharField(choices=(("add","Add"),
url.stripdomain() returns:
yourdomain.com
Do you know if there is a way to have url.domain return what
stripdomain() did above? Otherwise I'll use a template filter and move
on.
Merrick
On Aug 24, 12:20 pm, Javier Guerra wrote:
> On Mon, Aug 24, 2009 at 1:42 PM,
The reason I'm trying it is due to a requirement, the data rather than
being sent using a normal post request in a multienc form has to be sent
over in a json string
in the post request containing the base64 encoded image.
On Mon, 2009-08-24 at 18:38 +0200, Maksymus007 wrote:
> On Tue, Aug 4,
Maybe a generic foreign key would solve your problem.
http://www.djangoproject.com/documentation/models/generic_relations/
On Aug 24, 7:38 am, Mikoskay wrote:
> Hi,
>
> I'm searching for something like C++ union of types for my Django
> models. I know I can do it by
On Mon, Aug 24, 2009 at 3:57 PM, Léon Dignòn wrote:
>
> Hello,
>
> there are plenty of possible combinations out there. The suggested one
> is apache and mod_wsgi, but in the docs is also mentioned, that
> fastcgi could be faster if configured properly. Unfortunately it's
A bunch of searching turned up the "expect" utility and "autoexpect",
which seems to have done the trick.
On Aug 24, 3:14 pm, ringemup wrote:
> Maybe I'm just making some sort of stupid shell command mistake, but I
> can't seem to automate the input to manage.py flush (I
Hello,
there are plenty of possible combinations out there. The suggested one
is apache and mod_wsgi, but in the docs is also mentioned, that
fastcgi could be faster if configured properly. Unfortunately it's not
mentioned, what properly means.
For a site with few users who upload images up to
On Mon, Aug 24, 2009 at 3:29 PM, sandravigo wrote:
>
> Hi, friends. I have a problem.
> I created a function (main) that displays a list on the first page
> (index.html) of site administration. The problem is that for example,
> if I put in URLConf: (r '^ admin /(.*)','
On Mon, Aug 24, 2009 at 1:42 PM, Merrick wrote:
url = yourmodel.objects.get(id=1)
url.domain
> u'http://yourdomain.com/'
what does url.stripdomain() return?
--
Javier
--~--~-~--~~~---~--~~
You received this message because you are
Excellent. Many 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
india ,bangalore
On Tue, Aug 25, 2009 at 12:09 AM, Michael wrote:
>
> Where are you located?
>
> On Aug 24, 12:17 pm, ankit rai wrote:
> > can do for u ..
> >
> >
> >
> > On Mon, Aug 24, 2009 at 11:30 PM, Michael wrote:
> >
> >
Hi, friends. I have a problem.
I created a function (main) that displays a list on the first page
(index.html) of site administration. The problem is that for example,
if I put in URLConf: (r '^ admin /(.*)',' myproject.views.main '),
I get this list as I want, but don't shows the view by
Maybe I'm just making some sort of stupid shell command mistake, but I
can't seem to automate the input to manage.py flush (I need to do a
lot of database reloading as part of my current testing sequence). It
appears to fail when processing the email address.
Any suggestions? I'm using the
Take this off of the list please.
On Mon, Aug 24, 2009 at 11:39 AM, Michael wrote:
>
> Where are you located?
>
> On Aug 24, 12:17 pm, ankit rai wrote:
>> can do for u ..
>>
>>
>>
>> On Mon, Aug 24, 2009 at 11:30 PM, Michael
Thank you for the help.
On Aug 24, 12:18 pm, Daniel Roseman wrote:
> On Aug 24, 7:00 pm, Michael wrote:
>
> > I own a web based medical recertification company and we are looking
> > for a Python/Django web programmer to do some work for us. The site
Where are you located?
On Aug 24, 12:17 pm, ankit rai wrote:
> can do for u ..
>
>
>
> On Mon, Aug 24, 2009 at 11:30 PM, Michael wrote:
>
> > I own a web based medical recertification company and we are looking
> > for a Python/Django web programmer
Thank you Javier, for some reason I cannot get it working.
Using your example, I noticed the return value is stripdomain, I am
assuming that function would be outside of the model?
Assuming the code you provided, I would expect that adding the code
below, directly above the class yourmodel
can do for u ..
On Mon, Aug 24, 2009 at 11:30 PM, Michael wrote:
>
> I own a web based medical recertification company and we are looking
> for a Python/Django web programmer to do some work for us. The site
> is written in Python using Django 1.0. We need to switch
On Aug 24, 5:06 pm, BobZ wrote:
> The real brain buster is that I get this error whether I'm passing a
> form_class or a simple Model in urls.py
>
> On Aug 24, 11:05 am, BobZ wrote:
>
>
>
> > Thanks for the quick response!
>
> > forms.py
>
> > from
On Aug 24, 6:12 pm, Ken wrote:
> Apologies if this is in an FAQ somewhere, but I've been unable to find
> it...
>
> As a complete newcomer to Django (and Python, for that matter), I'd
> like to present my users with an HTML table that contains columns a, b
> and c from my
On Mon, Aug 24, 2009 at 1:01 PM, Merrick wrote:
> I know how to parse the URL but am drawing a blank on how to
> accomplish this at the model level.
add a function to the model, that returns the parsed field.
class yourmodel (models.Model):
domain =
On Aug 24, 7:00 pm, Michael wrote:
> I own a web based medical recertification company and we are looking
> for a Python/Django web programmer to do some work for us. The site
> is written in Python using Django 1.0. We need to switch from using
> Paypal to Authorize.net and
I own a web based medical recertification company and we are looking
for a Python/Django web programmer to do some work for us. The site
is written in Python using Django 1.0. We need to switch from using
Paypal to Authorize.net and would like to add content to our site. We
are based in
I have this in models.py:
domain = models.URLField(...)
Let's say one row in the table has this for domain:
'http://www.google.com'
When the domain field is looked up, I would like to return:
www.google.com
I know how to parse the URL but am drawing a blank on how to
accomplish this at the
Hey folks,
I've a strange problem at the moment with auth and login decorator.
If a user is logged in index page have to redirect to portal, if the
user is not logged in portal have to redirect to login-screen/index.
Seems to be not a big problem, I thought, but my following code
creates a loop.
Apologies if this is in an FAQ somewhere, but I've been unable to find
it...
As a complete newcomer to Django (and Python, for that matter), I'd
like to present my users with an HTML table that contains columns a, b
and c from my table in the database, and then do arithmetic on the
Model columns
On Tue, Aug 4, 2009 at 10:58 PM, scuzz wrote:
>
> Hi,
>
> I'm trying to receive a file encoded in a json string and store it in
> an ImageField. I was hoping to use the standard Django deserialisation
> like:
>
> serializers.deserialize("json", "...snip...,
The real brain buster is that I get this error whether I'm passing a
form_class or a simple Model in urls.py
On Aug 24, 11:05 am, BobZ wrote:
> Thanks for the quick response!
>
> forms.py
>
> from django import forms
> from django.forms import ModelForm
> from models import
When you do get to it, I'd love to see what you come up with.
On Aug 23, 9:16 am, Doug Blank wrote:
> On Sat, Aug 22, 2009 at 12:24 PM, ringemup wrote:
>
> > Has anyone here ever written an application that needed to be able to
> > take a date field
Did you find a way to do this? I'm having the same problem.
Lewis
On Aug 4, 9:58 pm, scuzz wrote:
> Hi,
>
> I'm trying to receive a file encoded in a json string and store it in
> an ImageField. I was hoping to use the standard Django deserialisation
> like:
>
>
Excellent. Thanks for the fix!
On Aug 24, 5:55 am, Russell Keith-Magee
wrote:
> On Mon, Aug 24, 2009 at 6:27 AM, David Haas wrote:
>
> > Hi:
>
> > Yet again, I've run into a behavior change which seems to be linked to
> > svn revision 10190.
On Aug 24, 4:26 pm, BobZ wrote:
> I'm having a similar problem actually.
>
> I'm trying to extend Photologue to offer front-end user upload
> capability with generic views and I haven't been able to successfully
> render a page yet.
> Each of the commented-out "upload_args"
Hi all,
One of my clients has asked me to implement a Django site where they
host the application side on their own Internet connection (low
latency 2Mbit fibre pipe) while hosting the static content on their
ISP's provided web space. Which is high speed (I tested it as likely
having multiple
Thanks for the quick response!
forms.py
from django import forms
from django.forms import ModelForm
from models import Photo
class UserPhotoUploadForm(ModelForm):
def __init__(self, *args, **kwargs ):
self.user = kwargs.pop("user")
super(UserPhotoUploadForm,
Ah, that makes a lot more sense. Thank you.
On Aug 23, 2:26 pm, Karen Tracey wrote:
> On Thu, Aug 20, 2009 at 2:19 PM, ringemup wrote:
>
> > I'm running the test listed below, and the test client is submitting a
> > request to /test2/ despite the
I hope that this doesn´t violate any group-rules ...
* * * * * * * * * *
vonautomatisch is looking for a webdeveloper having profound knowledge
and experience with django/python/html/css/javascript.
– scope of work
in collaboration with the concept- and graphics-department, you have
to
Sorry, I forgot about json.
Solved!
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,
hyuen wrote:
> When I use aggregators, I do something like
>
> T.aggregate(Max('LastName'))
>
> but the problem is that for aggregators, it expects a float, not a
> string. Is it possible to use strings as maximum/minimum values?
Where are you importing Max from?
What is the error and
On Aug 24, 4:00 pm, Gustavo Henrique wrote:
> Hi!
> I'm sending unicode string for template page, whitin a javascript
> code, and I have a problem with the char u before string value.
> For example:
>
>
> {{ string|safe }} -->// {'fieldLabel': u'Cliente', 'name':
I'm having a similar problem actually.
I'm trying to extend Photologue to offer front-end user upload
capability with generic views and I haven't been able to successfully
render a page yet.
Each of the commented-out "upload_args" are variations I've tried to
get something back and none of them
Hi!
I'm sending unicode string for template page, whitin a javascript
code, and I have a problem with the char u before string value.
For example:
{{ string|safe }} -->// {'fieldLabel': u'Cliente', 'name': u'cliente',
'value': u''}
In the body there isn't a problem, but in the javascript code
I must use fckeditor file upload but I want it to be possible only for
django staff authenticated users.
I'm using mod_python inside apache, is it possible ?
--
Alessandro Ronchi
SOASI
Sviluppo Software e Sistemi Open Source
http://www.soasi.com
Would be nice if you would share your solution
On Jul 26, 9:05 pm, nixon66 wrote:
> ran into this error. Anyone familiar with it.
>
> TemplateSyntaxError at /lobby/lobbytype/public-relations/
>
> Caught an exception while rendering: Error binding parameter 0 -
> probably
On Aug 24, 2:45 pm, Hotmail wrote:
> On Pzt, 2009-08-24 at 06:17 -0700, Daniel Roseman wrote:
>
> > On Aug 24, 12:51 pm, Gungor wrote:
> > > I have a register() takes at most 3 arguments (4 given) problem with
> > > these codes.
>
> > > from
On Pzt, 2009-08-24 at 06:17 -0700, Daniel Roseman wrote:
> On Aug 24, 12:51 pm, Gungor wrote:
> > I have a register() takes at most 3 arguments (4 given) problem with
> > these codes.
> >
> > from randevu.rts.models import Randevu
> > from django.contrib import admin
> >
On Mon, Aug 24, 2009 at 8:17 AM, Gungor wrote:
>
> I have register() takes at most 3 arguments (4 given) error with these
> codes.
>
> from randevu.rts.models import Randevu
> from django.contrib import admin
> from datetime import datetime
>
> class
On Aug 24, 12:51 pm, Gungor wrote:
> I have a register() takes at most 3 arguments (4 given) problem with
> these codes.
>
> from randevu.rts.models import Randevu
> from django.contrib import admin
> from datetime import datetime
>
> class Admin_Panel(admin.ModelAdmin):
>
On Mon, Aug 24, 2009 at 2:46 AM, Mikoskay wrote:
>
> Hi,
>
> Is there any equivalent of C++ union construction for my Django
> models? I know I can do it at low-level, but I hope it's not
> necessary. For example: there's a model Transaction with attribute
> Client pointing
On Mon, Aug 24, 2009 at 6:27 AM, David Haas wrote:
>
> Hi:
>
> Yet again, I've run into a behavior change which seems to be linked to
> svn revision 10190. I've figured out a workaround for my code, but
> I'm wondering if someone could provide some feedback if the change
Thanks for your patience, I created a new project with only a login-page and
a small 'debug' page, seems to work at this stage. Next I will test my own
auth_backend, if this problem appears again (I hope not), I'll be able to
localise it a bit better.
greetings,
florian
2009/8/21 Russell
Hi,
I'm searching for something like C++ union of types for my Django
models. I know I can do it by low-level fun, but I really hope it's
not necessary.
For example: I've got Transaction model which has a Client field - a
ForeignKey to Company model OR to Individual model - depending on what
I
I have a register() takes at most 3 arguments (4 given) problem with
these codes.
from randevu.rts.models import Randevu
from django.contrib import admin
from datetime import datetime
class Admin_Panel(admin.ModelAdmin):
list_display=("name","surname","date","time")
I have register() takes at most 3 arguments (4 given) error with these
codes.
from randevu.rts.models import Randevu
from django.contrib import admin
from datetime import datetime
class Admin_Panel(admin.ModelAdmin):
list_display=("name","surname","date","time")
On Monday 24 Aug 2009 5:03:47 pm Kenneth Gonsalves wrote:
> my first foray into mod_wsgi and apache. I configured everything. There are
> three media directories:
> media - for admin
> sitemedia - hard coded media
> smedia - uploaded media
>
> both admin media and sitemedia work perfectly. Only
Hi,
Is there any equivalent of C++ union construction for my Django
models? I know I can do it at low-level, but I hope it's not
necessary. For example: there's a model Transaction with attribute
Client pointing to model IndividualClient OR to model CompanyClient.
How to do that?
Thanks for
hi,
my first foray into mod_wsgi and apache. I configured everything. There are
three media directories:
/media/ - for admin
/sitemedia/ - hard coded media
/smedia/ - uploaded media
both admin media and sitemedia work perfectly. Only the uploaded media does
not get served. It gets saved in
On Mon, Aug 24, 2009 at 5:07 AM, OnCEL wrote:
> This is a form created dynamically in JS and it contains only a file
> input and a submit button (also created dynamically).
> The entire form creating code is:
I would wonder whether security restrictions in the browser are
Basically you have to link them with a foreign key. I hope this fits
your needs with the legacy table.
class Character(models.Model):
guid = models.IntegerField(primary_key=True)
name = models.CharField()
…
class CharacterHome(models.Model):
character =
Hi Emily,
This is a form created dynamically in JS and it contains only a file
input and a submit button (also created dynamically).
The entire form creating code is:
var upform = document.createElement('form');
upform.setAttribute('action','/engine/users/avatar/');
goobee, I am not sure, if I understand you. You have a person with a
name, let's say "Max Mustermann". You want to show the ModelForm
participant for this particular person? Is this correct?
On Aug 24, 9:14 am, goobee wrote:
> thanks Léon
>
> but I need name and firstname
Yeah, to finish this off, I got it working as I described below.
On Aug 24, 12:16 am, Anogar wrote:
> Sorry for the triple post - I think I'm going to be taking the image
> field out of the main model, making it a custom model, then adding the
> option for multiples with
On Aug 23, 11:31 pm, OnurCelebi wrote:
> Hi all,
> I have a very strange behaviour. I have an upload form like this:
>
> var upform = document.createElement('form');
> upform.setAttribute('action','/engine/users/avatar/');
>
hi Ronghui,
may i know what do u mean by "didnt save the file" using the form save
() method?
Do u mean that in Guptha's views.py, the function should have:
form.save()
in order to save the image?
Best Regards.
On Jul 24, 7:20 pm, Ronghui Yu wrote:
> You didn't save the
Hi all, I am creating a form ( a customized one ) which tries to
upload ( bind )
an image file and save the file into my directory ( and its location
in mysql database )
The code is right here :
# views.py
def customized_form(request):
if request.method == 'POST':
form =
Sorry for the triple post - I think I'm going to be taking the image
field out of the main model, making it a custom model, then adding the
option for multiples with the Inline option and extras.
On Aug 24, 12:08 am, Anogar wrote:
> For a simpler concept, just consider
thanks Léon
but I need name and firstname from the referenced table 'person', but
only from ONE person; the person I read from 'participant'.
goobee
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
For a simpler concept, just consider what I'd do if I wanted to add
multiple "title" fields or something basic and text based.
On Aug 24, 12:02 am, Anogar wrote:
> I've got iamge uploading working in a portfolio app I'm working on,
> but only with a single image. I'm
I've got iamge uploading working in a portfolio app I'm working on,
but only with a single image. I'm trying to get it working so that you
can add as many or as few images as you'd like, but I'm hitting a bit
of a brick wall with the logic of how it should work.
Does anyone have any pointers? I
Hi Simon,
Simon Lee schrieb:
> Thank you for being patient in helping me out.
>
> I checked it /etc/passwd and found this line which I think is the
> reference for UID 70
>
> _www:*:70:70:World Wide Web Server:/Library/WebServer:/usr/bin/false
>
> I did "su - _www" (I hope I did this
You might have alook at the saas kit which is availble on github,
which does subscription billing, subdomain handling and multi user
accounts. You could then write a decorator to wrap any db request to
perform a test to check that only rows that are linked to that
requesting user are returned or
I missed a step - I did go ahead and chown it over to www-data, but I
needed to chmod x to u.
sudo chmod u+x uploads/
I thought 777 would be a little insecure, you really don't need to
give full permissions to group / others. I know it's probably not a
huge deal, but I figure it's best
94 matches
Mail list logo