Hi,
in my models.py I'm tring to add some fields to User with add_to_class
(so I can access them in admin). Everything works fine, only when I
try to add a ForeignKey on User itself, Django dev server gets in a
loop and has to be killed or it consumes every byte of memory and all
processor time.
Everything can be changed. Look under auto_id in the newforms docs on
djangoproject.com. The default does it exactly the way you seem to
be, prepending 'id_' to the field name. If you want to set a class,
you need to change the attrs dict on the field's widget.
All a newforms field really cons
I'm using the Books, Publishers, Authors example from the
documentation (Django Book) and I'm trying to figure out how to get
related data in a list. For example, I want to print a list of books
and a list of authors for each book in my template. What do I have to
do to make the code below functio
On 7/31/07, Todd O'Bryan <[EMAIL PROTECTED]> wrote:
>
> Is there an easy way to tell if something is running as a test so that I
> can mock that behavior? I'm thinking of something like
...
> Or maybe this isn't the right approach at all and I'm missing something
> that would make this easier.
Ad
Some of my pages fetch data based on user input. It obviously doesn't
make sense to do the actual fetch in test cases, since I should know
what is going to be returned and should be checking for what I do with
the data.
Is there an easy way to tell if something is running as a test so that I
can
Hi list,
I've used the property() function to simulate
a field that is computed by other fields of a
model. Now I want to filter a QuerySet using
this property field. I get an error claiming
to use a "real" field.
I could create one but this is kind of ugly for
a field that is completely computed
Russ,
pysqlite2.3.3
On Jul 30, 7:20 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 7/31/07, Greg <[EMAIL PROTECTED]> wrote:
>
>
>
> > I guess I have v3. In my settings.py file i have:
>
> > DATABASE_ENGINE = 'sqlite3'
>
> That's just what your settings file says. This setting could re
Hi,
>
> http://django-registration.googlecode.com/svn/trunk/registration/form...
>
Thanks Nathaniel, I am looking for over riding the clean() instead of
clean_(). After hours of experiments. I would like to confirm if
my learnings are correct.
in over riding the clean() method, I have to f
Hi,
this is how I am using the newforms.
My Form
class NewEmployeeForm(forms.Form):
contract_from = forms.DateField()
contract_to = forms.DateField()
position = forms.CharField(max_length=20)
My View
def create_employee(request):
f = None
if request.method == 'POST':
On 7/31/07, Greg <[EMAIL PROTECTED]> wrote:
>
> I guess I have v3. In my settings.py file i have:
>
> DATABASE_ENGINE = 'sqlite3'
That's just what your settings file says. This setting could read
sqlite3 even if you don't have sqlite installed.
Yours
Russ Magee %-)
--~--~-~--~~
Russ,
I guess I have v3. In my settings.py file i have:
DATABASE_ENGINE = 'sqlite3'
On Jul 30, 6:57 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 7/31/07, Greg <[EMAIL PROTECTED]> wrote:
>
>
>
> > Russ,
> > I'm using SQLite version - 0.99svn. And here is my django info
>
> Ermm.. a
On 7/31/07, Greg <[EMAIL PROTECTED]> wrote:
>
> Russ,
> I'm using SQLite version - 0.99svn. And here is my django info
Ermm.. are you sure? Django requires v3 of SQLite, and pysqlite v2
bindings... I can't even think where you would get a subversion
release of SQLite 0.99. If you really _do_ hav
Hello,
I just noticed this thread about http push. I'm the author of orbited,
and the only reason there aren't django tutorials on using orbited is
b/c I'm somewhat unfamiliar with the Django framework. There is
absolutely no reason you can't use orbited to push events from Django
to the browser.
On Jul 30, 11:18 pm, stereoit <[EMAIL PROTECTED]> wrote:
> Hi, I'm having problem withmod_python.
>
> EnvironmentError: Could not import settings 'syslog.settings' (Is it
> on sys.path? Does it have syntax errors?): No module named settings
>
>
> I've developed small app for viewing syslog me
A side conversation from the Django BOF at OSCON this year made some
noises about "TheSchwartz" (http://code.sixapart.com/trac/TheSchwartz)
- a Perl job queue that SixApart (Brad FitzPatrick) has made
available. I'd heard there were now Ruby and Python bindings to it,
but I haven't found the relev
We pre-process the search query with our own simple code, converting
"and" and "or" and verifying that the resulting query is acceptable.
Ultimately, we fall back to a method that just checks against TSearch2
itself to verify the query is "OK":
def _validate_query(querystring):
""" validates
>
> The concerns are few:
> - lack of big corporate backing (like Seam) and guaranteed sound
> documentation
Lack of big corporate backing is seen as an advantage to some. They need to
make money somehow and support contracts can be very lucrative. Small teams
can do amazing work. Just look at
You are being most helpful mr. Siegfreid. I will take your advise to
heart and start out simple.
The following expresses my personal opinions:
I am aware that a comparison against one Java-framework is very
insufficient.
Other frameworks can do the job just as well, i am sure. I see no
compell
Thanks Malcom, I changed the views function name but still got the
same error so I don't know if it's a bug. I will try to take a closer
look at it, but I really don't know why this may happen. Does anybody
else has an idea?
Thank you,
Regards,
A Mele
On 30 jul, 22:28, Malcolm Tredinnick <[EMA
On Mon, 2007-07-30 at 19:28 +, zenx wrote:
> Hi,
>
> I get the following error when trying to use the {% url %}
> templatetag. I have read the documentation several times but cannot
> understand where is the problem:
>
> AttributeError at /c/albums/wonderful-world/
> 'str' object has no attr
I want to use the test framework with my application, using
postgresql/psycopg2.
I had the problem that any db error in any of my tests (including
setups) would cause all following tests to fail (because the transaction
was not rolled back). This was made even worse by the fact that I used
the db
testing and documentation (plus two minor bug fixes) are checked into
the schema-evolution branch:
tests/modeltests/schema_evolution/models.py
docs/schema-evolution.txt
> because I suspect the existing test framework will require some
> modifications to enable models to be evo
I completely forgot to run is_valid() on the receiving view, so
cleaned_data wasn't being populated. This was the problem.
Thanks!
On Jul 30, 4:00 pm, RajeshD <[EMAIL PROTECTED]> wrote:
> > Is it not possible to use Newforms with GET requests?
>
> It is. You can pass it any "dictionary-like" obj
> Is it not possible to use Newforms with GET requests?
It is. You can pass it any "dictionary-like" object instance as its
submitted data (request.GET and request.POST are both dictionary-like
objects.)
> I'm trying to
> figure out how to paginate results from a search form, and I'm passing
> G
OK, sorted using:
object=pricelist.pricelisttable_set.extra(where=["""(abs(width - %s))
= ( SELECT Min(Abs(pl.width - %s)) FROM table_pricelisttable pl where
name_id=%s)"""], params=[w, w,d.pricelist_id])[0]
The error was missing in subquery where name_id=%s.
Now it works exactly as should.
On
Greetings,
Is it not possible to use Newforms with GET requests? I'm trying to
figure out how to paginate results from a search form, and I'm passing
GET values to the pagination view, instantiating an instance of the
Form object with request.GET as an argument (instead of the typical
request.POS
Hi,
I get the following error when trying to use the {% url %}
templatetag. I have read the documentation several times but cannot
understand where is the problem:
AttributeError at /c/albums/wonderful-world/
'str' object has no attribute 'callback'
My urls.py:
urlpatterns = patterns('',
ur
Russ,
I'm using SQLite version - 0.99svn. And here is my django info
C:\Python24\Lib\site-packages\django>svn info
Path: .
URL: http://code.djangoproject.com/svn/django/trunk/django
Repository Root: http://code.djangoproject.com/svn
Repository UUID: bcc190cf-cafb-0310-a4f2-bffc1f526a37
Revision:
Il giorno 30/lug/07, alle ore 17:21, Matt ha scritto:
> For instance, if you also had categories of users and wanted to be
> able to list the users in each category, a 'human-friendly' url
> scheme might look like this:
>
> www.mysite.com/users/matt --> go to my area
> www.mysite.com/users/jess
Yes, you've right.
If I put = the query will return None !
The only query which return what i want is only raw sql:
select min(abs(width-240)) as m,width from table_pricelisttable where
name_id = 1 group by width order by m limit 1;
than performing the second query to get object.
like:
cursor =
Emanuele Pucciarelli napsal(a):
>
> Il giorno 29/lug/07, alle ore 22:48, Tomas Kopecek ha scritto:
>
>> I know, it's syntactical nonsense. But does anybody know about some
>> way
>> how to combine variable content with string content? Is it possible?
>>
>> For example, very crude way could be
I am not using new forms... but I'm assuming you would make this a
text field... with a link next to it that says something like 'view
existing entries'
Then when a user clicks that, you could do one of the following:
1. Display a ldiv with a list of all entries, and make it so that when
the use
I found the forms from James Bennett's Django Registation app helpful
when I was first learning newforms.
http://django-registration.googlecode.com/svn/trunk/registration/forms.py
- whiteinge
On Jul 30, 2:08 am, james_027 <[EMAIL PROTECTED]> wrote:
> Hi,
>
> is there any sample on over riding t
On 7/30/07, Snirp <[EMAIL PROTECTED]> wrote:
>
>
>
> Was BPM not a issue in these smaller projects, or did you have a way
> of dealing with this? I am much less experienced a developer and want
> to avoid using the wrong tool and hammering a screw in. On the other
> hand, however much I was impress
Oops..pardon the typo... #1 shold say "Display a div"
On Jul 30, 1:10 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I am not using new forms... but I'm assuming you would make this a
> text field... with a link next to it that says something like 'view
> existing entries'
>
> Then when a u
Julio Nobrega wrote:
> Damn, 3 weeks ago I was talking to a friend about an idea for a
> website which is just like Splice. The focus was a little bit more
> towards musicians, letting them upload tracks and setting prices for
> its usage, but anyway, the sound mixer you coded is fantastic, and
> For instance, if you also had categories of users and wanted to be
> able to list the users in each category, a 'human-friendly' url
> scheme might look like this:
>
> www.mysite.com/users/matt --> go to my area
> www.mysite.com/users/jess --> go to Jess' area
> www.mysite.com/users/mark --> g
On Jul 30, 11:56 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 7/30/07, Daniel Kvasnicka jr. <[EMAIL PROTECTED]> wrote:
>
> > Hey, nobody has ever needed this? Any thoughts?
>
> You might want to search the archives of this list, or go to Google
> and type in "django extend user"; this is a
> Maybe you should stick to one for now
> and then get follow up on the details if you decide on Django: Python and
> Django vs Java and some enterprise framework.
Yeah, i agree i got it a bit clogged up. What matters most now is to
make the right choice. Scalability and business logic handling a
Thank you, I'll try with the commit=False! :)
On Jul 30, 5:15 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote:
> Hi,
>
> if the fields will never be edited, you can use editable=False
> in your model.
>
> I do it like this:
>
> instance=formobj.save(commit=False)
> instance.attribute=...
> instance
There's some big questions in there. Maybe you should stick to one for now
and then get follow up on the details if you decide on Django: Python and
Django vs Java and some enterprise framework.
I use Java for my main project and also looked at Seam and JBPM. My day
project is limited to Java for a
I feel like I'm spending as much time designing URLs for this same problem
as I do handling other aspects of software architecture.
The simplest solution for this case would be a user/matt for mapping to
specific users and users/premium for retrieving a collection of users in a
category. Subtle but
I am considering Django to develop a business-to-business service. It
should handle invoices (accounts payable) for my customers. It more or
less comes down to:
1. enter invoices [we | various XML formats go into the
database]
2. complete invoices [automated | interface with cus
This might help you:
http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model
On Jul 30, 11:56 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 7/30/07, Daniel Kvasnicka jr. <[EMAIL PROTECTED]> wrote:
>
> > Hey, nobody has ever needed this? Any thoughts?
>
> You might want to s
Hi everyone,
Thanks for the suggestions. The problem is a little more subtle than
my example suggested.
For instance, if you also had categories of users and wanted to be
able to list the users in each category, a 'human-friendly' url
scheme might look like this:
www.mysite.com/users/matt -->
Hi,
if the fields will never be edited, you can use editable=False
in your model.
I do it like this:
instance=formobj.save(commit=False)
instance.attribute=...
instance.save()
BTW: the "commit" keywords does not mean database commit.
If means, don't call save() of the instance.
Am Montag, 30.
Hi,
I want to use a popUp instead of an select widget, since
there will be too many entries (>10.000). It would be better
to use a PopUp with a search form. Has anyone done something like
this?
I search some example code to learn from.
Thomas
--~--~-~--~~~---~--~--
If all you have is a list of users to look through the suggestions work just
fine. Otherwise, it's easier to set a common root for that particular
lookup, such as mysite.com/user/matt. This avoids the problem of mixing in a
variable URL value with other parts of your site. It also maps nicely to a
Hi, thanks for quick reply.
When I did as suggested I received:
EnvironmentError: Could not import settings 'settings' (Is it on
sys.path? Does it have syntax errors?): No module named settings
<
so I also changed the PythonPath to
PythonPath "['/srv/code/syslog/'] + sys.path"
now I re
Hi Gilbert --
Yeah, this is a bug; it's on my shortlist to fix.
Jacob
--~--~-~--~~~---~--~~
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
On Jul 30, 7:42 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>
>
try to pprint the variables you pass the template directly in the view
fonction they will appear in the console if you use the django dev
server :)
--~--~-~--~~~---~--~~
You received th
Welcome !
On Jul 30, 2:01 pm, "Peter Melvyn" <[EMAIL PROTECTED]> wrote:
> On 7/30/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
>
> > Try {% debug %}
>
> If you mentioned this feature: is there an easy way to reformat {%
> debug %} output the same/similiar way an exception error is reported?
Damn, 3 weeks ago I was talking to a friend about an idea for a
website which is just like Splice. The focus was a little bit more
towards musicians, letting them upload tracks and setting prices for
its usage, but anyway, the sound mixer you coded is fantastic, and I
bet it was damn difficult,
On 7/30/07, Peter Melvyn <[EMAIL PROTECTED]> wrote:
>
> On 7/30/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
>
> > Try {% debug %}
>
> If you mentioned this feature: is there an easy way to reformat {%
> debug %} output the same/similiar way an exception error is reported?
Not easily. {% de
On 7/30/07, Greg <[EMAIL PROTECTED]> wrote:
>
> Russell,
> I'm using sqlite
>
> DATABASE_ENGINE = 'sqlite3'
Hrm. I don't get this problem with sqlite, either; b.timestamp returns
a datetime object for me.
It is possible this might be a problem specific to sqlite on Windows -
I don't currently ha
Hi Robert,
I had quite the same problem, it's been solved by setting
DJANGO_SETTINGS_MODULE to "settings" instead of "syslog.settings" in
.
My current apache2.conf file sets handler to "python-program" instead of
"mod_python", you can also try it that way.
Hope this helps,
Anthony.
stereoi
Hi, I'm having problem with mod_python.
EnvironmentError: Could not import settings 'syslog.settings' (Is it
on sys.path? Does it have syntax errors?): No module named settings
I've developed small app for viewing syslog messages and it runs fine
with following commands:
cd /srv/code/s
Hey Ben...thanks...I'll check that out.
We'll most likely continue to use ReportLab for our project, as we are
using the graphs in some reports we are going to export to PDF... but
looks like an interesting read :)
I'll also add the other two samples to the wiki this week...
Carole
On Jul 30, 4
Russell,
I'm using sqlite
DATABASE_ENGINE = 'sqlite3'
I can't seem to find out what django revision I have. I ran 'svn
info' from c:/django however it said 'svn: '.' is not a working copy'
On Jul 30, 6:49 am, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 7/30/07, Greg <[EMAIL PROTECT
Hello!
I have a form generated with form_for_model.
I deleted a couple of fields from it, beacuse I don't want the user to
insert value for them, but their value should be automatically filled
after the submit of the form.
So, I have something like this:
MyForm = form_for_model(myModel)
del MyFo
On 7/30/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote:
> Try {% debug %}
If you mentioned this feature: is there an easy way to reformat {%
debug %} output the same/similiar way an exception error is reported?
Peter
--~--~-~--~~~---~--~~
You received this me
Russell Keith-Magee escribió:
> On 7/30/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote:
>
>> I didn't know of that function. Nice to know. But, is there a var where
>> to access *all* the vars available in the template and it's contents?
>> I've been needing that one for debugging for ever!
>>
On 7/30/07, Greg <[EMAIL PROTECTED]> wrote:
>
> Russ,
> Here is what I get with I use 'python manage.py shell'
...
> >>> b.timestamp
> u'2007-07-29'
Ok - this is interesting. This should be a datetime object. This
suggests a problem with the database backend.
I've just tried what you've sent me
On 7/30/07, Chris Hoeppner <[EMAIL PROTECTED]> wrote:
>
> I didn't know of that function. Nice to know. But, is there a var where
> to access *all* the vars available in the template and it's contents?
> I've been needing that one for debugging for ever!
Try {% debug %}
http://www.djangoproject.
That's a good tutorial thanks for that. I think the way you described
the workings has helped me a lot in "getting into" django.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
> Seems to work now with:
> w=240
> pricelisttable_set.extra(where=["""(table_pricelisttable.width - %s)
> >= ( SELECT Min(Abs(pl.width - %s)) FROM table_pricelisttable pl)
> """], params=[w, w])[0]
I would be very surprised if it works now as described with ">="
rather than "=". It's basically
On 7/30/07, Daniel Kvasnicka jr. <[EMAIL PROTECTED]> wrote:
> Hey, nobody has ever needed this? Any thoughts?
You might want to search the archives of this list, or go to Google
and type in "django extend user"; this is a pretty common question and
has been covered in a lot of detail ;)
--
"Bur
Nathan Ostgard escribió:
> Try: {{ data|pprint }}
>
> On Jul 29, 10:42 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>> I'm coming from CakePHP and I would typically set a variable for use
>> in my view with a call to findAll. Since there is a lot of data in the
>> array, I typically do
Hey, nobody has ever needed this? Any thoughts?
Dan
On Jul 27, 1:18 pm, "Daniel Kvasnicka jr."
<[EMAIL PROTECTED]> wrote:
> Hi django fellows,
>
> I scubclassed django's User model to create my own more complicated
> model, I set it as my AUTH_PROFILE_MODULE in settings and I also wrote
> my own
Forest Bond escribió:
> On Sun, Jul 29, 2007 at 05:49:54PM -, Henrik Lied wrote:
>
>> @Forest: I agree, it should be that simple. But let's say you've got a
>> comment reply plugin. How would we - through a middleware - manage to
>> intercept our usual comment system, and modify the HTML te
Oho yes yes.
Did not realize that. It just escaped my mind.
Thanks a lot for reminding
On Jul 30, 12:01 pm, oggie rob <[EMAIL PROTECTED]> wrote:
> The admin interface contains a history feature, you might want to look
> at how that works. Apart from a table to record the actual changes,
> there
Hey Carole,
A guy called Toby has put something together using R and rpy that does
graphs... I haven't been able to make it work as yet, but he's keen to move
on with it, and wants some testers and some help!
Check out:
http://groups.google.com/group/django-users/browse_thread/thread/43eafd773734a
Il giorno 30/lug/07, alle ore 01:17, Matt ha scritto:
> This could all be acheived using another view to determine whether the
> given name was a valid user, and if so direct you to the appropriate
> view, but wouldn't that prevent you using Django's generic views?
You should probably look at '
On 28 Jul 2007, at 1:19 pm, Bram - Smartelectronix wrote:
http://www.splicemusic.com/
( summary: upload sounds, load them into a flash audio sequencer with
effects and synthesizers + standard community features)
thanks a lot to all the people who have helped me getting this
thing up
and
On 28 Jul 2007, at 4:34 am, [EMAIL PROTECTED] wrote:
I had the need to generate a few different types of charts using
ReportLab. The wiki only had a sample of a Horizontal Bar Chart, so
I've added a new sample on how to produce a Line Chart...
http://code.djangoproject.com/wiki/Charts
If any
Hi,
is there any sample on over riding the clean method of the newforms?
Thanks
james
--~--~-~--~~~---~--~~
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@googleg
Try: {{ data|pprint }}
On Jul 29, 10:42 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I'm coming from CakePHP and I would typically set a variable for use
> in my view with a call to findAll. Since there is a lot of data in the
> array, I typically do something like:
>
>
>
>
>
> This wa
Thank you Tim,
Seems to work now with:
w=240
pricelisttable_set.extra(where=["""(table_pricelisttable.width - %s)
>= ( SELECT Min(Abs(pl.width - %s)) FROM table_pricelisttable pl)
"""], params=[w, w])[0]
On 7/29/07, Tim Chase <[EMAIL PROTECTED]> wrote:
>
> > In pure sql we can do :
> > "select
The admin interface contains a history feature, you might want to look
at how that works. Apart from a table to record the actual changes,
there is a "relationship" table that links the model that is changed
with the log record (i.e. the log isn't tied to a particular table
because of this).
Table
79 matches
Mail list logo