Exactly.
Perhaps we should just ignore MEDIA and STATIC variable setup in the
settings file altogether. When I couldn't get the variables to work like how
I thought they should work, I just put the following stuff in the Apache
vhost config file:
Alias /media /Users/eiji/Sites/assets/media
Alias
So if I use the BSD license as Django does, do I need to (according to this
license) disclose my source code or not? Which BSD license is Django using
anyway? Clause 3?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
Not a question, just a piece of code. Feel free to use it. And any
feedback will be appreciated.
Starting from Django 1.2 you can create your custom template loader
that returns your Template object. Doing that you can make django's
render_to_response, render_to_string and counterparts render usin
I debugged it step by step and the data dissapears from DB in the line
of session.flush()
The data are three models that I created, and instances of these
models are saved in the form. The difference between these models and
others saved but not deleted by flush(), is that these 3 models have
fore
ok, I spot the bug. In one of these models, I have a foreign key to
Session model.
So, when I do session.flush(), on cascade deleted all the related
models.
thank you for your time.
On May 14, 3:15 pm, ekms wrote:
> I debugged it step by step and the data dissapears from DB in the line
> of sess
Hi, I work to a project on my laptop in with I installed django-jython
under Archlinux, and all work correctly.
After some problem with my project, i try to install django-jython
under one other pc in with runs OpenSuse.
I installed jython from the installer in the jython web-site.
I installed and
Hi,all!
I use the django admin interface to insert a record to the mysql database,
While the field is FloatField in django and the mysql field show a double
type,
But when I click the save button,it tell me that:
Environment:
Request Method: POST
Request URL: http://localhost:8080/admin/main/lea
Any advice? Do I have to do new form?
Gabe
On 13 Maj, 14:55, Gabe wrote:
> Hi,
>
> what I am trying to do is to put a login box which will use
> django.contrib.auth.views.login. According to documentation I`ve
> crated inclusion tag which works, but it only views form sumbit button
> not a whole
> Exception Type: TypeError at /admin/main/learndjango/add/
> Exception Value: 'float' object is not callable
Please paste your model that is having the problem.
--
Andy McKay
a...@clearwind.ca
twitter: @andymckay
--
You received this message because you are subscribed to the Google Gr
It sounds like all your issues with these features are a result of not
reading the documentation.
Feel free to ignore these optional features and do things the hard way
if you feel like it.
On the other hand, you could invest a small amount of time in
understanding them and get the benefits.
On Sat, May 14, 2011 at 1:38 AM, Kenneth Gonsalves
wrote:
> On Fri, 2011-05-13 at 12:23 +, Bjarni Rúnar Einarsson wrote:
> > Other random points: Generally speaking, I prefer the more recent,
> > modern
> > licenses (GPLv3 instead of GPLv2, Apache instead of BSD) because they
> > do a
> > bett
Hi Bostjan,
I think you are misunderstanding one basic thing. You do not NEED a license
for your own code. By default, program code is protected by copyright in
most parts of the world.
Licenses clarify or renounce some or all of the protections of copyright and
patent law, and they only matter
Say I create an app in Python and wxPython (a Python GUI framework). And
then I upload my installation binaries (binaries created with py2exe and
setup made with Inno Setup) to, say, Google Code. I don't want to dislose my
source code. I just want my users to download the setup program and use my
p
Hey all,
I have a Django project where I need to access another apps models.
The problem is that I cannot directly import the model that I need
from the app that needs to access it (I'm pretty sure that I need it
for a ForeignKey field or similar). Is there any way that I can fix
this besides movin
All you should need is for the external app to be somewhere on your
PYTHONPATH.
Then you can add it to INSTALLED_APPS in settings.py and you'll be all set.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to d
I can add it to my PYTHONPATH by doing 'export PYTHONPATH=""'
right?
--
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-users+
On 05/14/2011 04:25 PM, augdawg wrote:
I can add it to my PYTHONPATH by doing 'export PYTHONPATH=""'
right?
Yes, but you might want to just append it to your PYTHONPATH, in case
there's already something there you don't want to lose.
Like this:
export PYTHONPATH=$PYTHONPATH;
Maybe even pu
I have a "new" contact form. If I post it, and it has error, I found
(while debugging, not documented that I can find) that I can redraw
the submitted form data using form.name.data like this:
But, if I use that same form model in my "edit" contact form,
form.name.data is None. Why is that?
On 05/14/2011 05:04 PM, Greg Donald wrote:
I have a "new" contact form. If I post it, and it has error, I found
(while debugging, not documented that I can find) that I can redraw
the submitted form data using form.name.data like this:
The problem is that you're doing this at all. You shoul
On Sat, May 14, 2011 at 4:08 PM, Shawn Milochik wrote:
> On 05/14/2011 05:04 PM, Greg Donald wrote:
>>
>> I have a "new" contact form. If I post it, and it has error, I found
>> (while debugging, not documented that I can find) that I can redraw
>> the submitted form data using form.name.data lik
On 05/14/2011 05:14 PM, Greg Donald wrote:
On Sat, May 14, 2011 at 4:08 PM, Shawn Milochik wrote:
On 05/14/2011 05:04 PM, Greg Donald wrote:
I have a "new" contact form. If I post it, and it has error, I found
(while debugging, not documented that I can find) that I can redraw
the submitted f
On Saturday, 14 May 2011 22:14:38 UTC+1, Greg Donald wrote:
>
> On Sat, May 14, 2011 at 4:08 PM, Shawn Milochik
> wrote:
> > The problem is that you're doing this at all. You should instead be using
> {{
> > form.name }} to put the field in the form.
>
>
> Well that works for the vanilla case b
On Sat, May 14, 2011 at 4:22 PM, Daniel Roseman wrote:
> Which is what Shawn said. If you follow the pattern described in the
> excellent documentation, you'll see that there's no reason to try and
> reference the form's data, as the form will re-render itself anyway if
> validation fails. And the
On 05/14/2011 05:33 PM, Greg Donald wrote:
On Sat, May 14, 2011 at 4:22 PM, Daniel Roseman wrote:
Which is what Shawn said. If you follow the pattern described in the
excellent documentation, you'll see that there's no reason to try and
reference the form's data, as the form will re-render itse
On Sat, May 14, 2011 at 4:39 PM, Shawn Milochik wrote:
> I'm certain there are plenty of reasons that others could chime in with. In
> any case, you're free to do it however you like. But if you choose to use
> Django, be aware of the fact that a huge amount of thought has gone into the
> project,
On 05/14/2011 05:47 PM, Greg Donald wrote:
On Sat, May 14, 2011 at 4:39 PM, Shawn Milochik wrote:
I'm certain there are plenty of reasons that others could chime in with. In
any case, you're free to do it however you like. But if you choose to use
Django, be aware of the fact that a huge amount
On Sat, May 14, 2011 at 4:58 PM, Shawn Milochik wrote:
> This isn't a case of "our way rules and if you disagree then you suck." I
> just wanted to make sure you don't walk away with that impression.
How can I set this same widget value
name = CharField( widget=TextInput( attrs={ 'class':'mycla
On 05/14/2011 06:09 PM, Greg Donald wrote:
On Sat, May 14, 2011 at 4:58 PM, Shawn Milochik
wrote:
> This isn't a case of "our way rules and if you disagree then you
> suck." I just wanted to make sure you don't walk away with that
> impression.
How can I set this same widget value
name =
On Sat, May 14, 2011 at 5:20 PM, Shawn Milochik wrote:
> One way:
>
> class CustomCharField(forms.CharField):
>
> def __init__(self, *args, **kwargs):
>
> super(CustomCharField, self).__init__(*args, **kwargs)
>
> self.widget=forms.TextInput(attrs={ 'class':'myclass' })
>
>
> c
Thanks Shawn, I didn't read the documentation as thoroughly as I should
have. And I know that I should read the English version rather than relying
on the outdated, Japanese version. But this is good, as I need to learn
English more.
I modified the urls.py according to the docs, and the MEDIA_URL,
I have a database of patients ("Patient" model), and a patient can
have subordinate accounts which is a self-foreign-key (eg, for family
members), We also store multiple addresses for each patient (home,
work, billing). I'm pretty sure I need to have an Address model as a
many-to-one, because a
On 05/14/2011 06:50 PM, bendavis78 wrote:
I have a database of patients ("Patient" model), and a patient can
have subordinate accounts which is a self-foreign-key (eg, for family
members), We also store multiple addresses for each patient (home,
work, billing). I'm pretty sure I need to have a
Eiji,
If you put a folder in each app named 'static' it will automatically be
used when you run 'manage.py collectstatic.'
You only need to specify additional directories if you want to pull
static media from somewhere else, of if you named your static folders
something other than 'static' i
How does one handle non-changing existing data when updating a form?
My 'add' form includes several fields my 'edit' form does not. For
example once I create a contact and assign it a company_id foreign
key, it will never change. So when I implement my edit method in my
view, I get errors about
My HTML guy and designer tend to get together to do some fancy stuff
(read: pain in the butt) so sometimes I need to access the data that a
model form field represents and can't just let django render it, which
is obviously the preferred way and I go that way if possible. I am
pretty knew to this,
On 05/14/2011 07:51 PM, Greg Donald wrote:
How does one handle non-changing existing data when updating a form?
My 'add' form includes several fields my 'edit' form does not. For
example once I create a contact and assign it a company_id foreign
key, it will never change. So when I implement m
Eiji,
Sorry to hear about the Japanese translation being out-of-date. I just
checked and saw that it's extremely old. The development of Django moves
too quickly to rely on static documentation. I don't know of any
alternatives to the English version if you want to remain current, but
in any
On Sat, May 14, 2011 at 6:56 PM, Shawn Milochik wrote:
> If you're using forms.Form objects instead of forms.ModelForm objects then
> that would explain it. If you're dealing with a model then you should
> probably be using a ModelForm.
>
> To have a ModelForm that doesn't show certain fields just
On 05/14/2011 08:09 PM, Greg Donald wrote:
I have
from django.db import models
from django.forms import ModelForm
class Contact( models.Model ):
company = models.ForeignKey( Company )
name = models.CharField( max_length=32 )
class ContactForm( ModelForm ):
class Meta:
i've written something similar to Dajax..
but i don't think that's a good solution..
and i'll not use it in my new project..
it goes the opposite of django philosophy..to design url explicitly..
url should be well mantained..
..and can be used as an api..as similar as possible
i thought..
On 5月9日
Conceptually, an interface element of my application can either be
click through (i.e. requires user interaction) or auto-cycle (no user
interaction). So its boolean. But i picked the wrong one when I
originally designed the model and now we have existing data and I
don't want to change it.
So I
2011/5/15 Andy McKay
>
> > Exception Type: TypeError at /admin/main/learndjango/add/
> > Exception Value: 'float' object is not callable
>
>
> Please paste your model that is having the problem.
>
class MyItem(models.Model):
title=models.CharField(max_length=1024)
description=models.Char
On 2011-05-14, at 6:10 PM, Korobase wrote:
> price=models.FloatField(default=0.0)
You really should really be using a DecimalField for storing prices, not a
FloatField.
http://docs.djangoproject.com/en/dev/ref/models/fields/#decimalfield
http://docs.djangoproject.com/en/dev/ref/models/field
I am trying to create a simple billing/CRM app for my company. I have
create a Django project with the following apps:
sales_manager
office_manager
customer_manager
Within, I have models representing things like Customers, Contacts,
Projects, Tasks, etc. The problem I am having seems to arise fro
I have a typical Django app using MySQL.
I've decided to change a model and make some fields unique=True
AFTER tables and data exist in MySQL.
I noticed that "python manage.py syncdb" doesn't automatically modify
MySQL
database to make desired fields unique now.
Is there some MySQL command line
If you have two models that need to explicitly refer to each other then
they should probably be in the same app.
If they need to be in two apps, you can have a foreign key in one and
from the other use the RelatedManager to access the first.
You'll have to make these decisions based upon what
The best way is to use South.
http://south.aeracode.org/
In your current situation, after you install South (pip install then add
to INSTALLED_APPS, and syncdb to add the South table) you'll just have
to do this:
1. manage.py convert_to_south appname #this will set up the basics,
you'll
On 2011-05-14, at 6:08 PM, br wrote:
> However, come interface tweaking time (now), we decided we want to
> display a page with a check box "Auto Cycle?" instead of "click-
> through", so I basically need to invert the actual value with respect
> to this interface .
> What is the easiest way to im
On Sat, May 14, 2011 at 9:10 PM, Korobase wrote:
>
>
> 2011/5/15 Andy McKay
>
>>
>> > Exception Type: TypeError at /admin/main/learndjango/add/
>> > Exception Value: 'float' object is not callable
>>
>>
>> Please paste your model that is having the problem.
>>
>
> class MyItem(models.Model):
>
Shawn
Thanks! Is South just a script that runs? Can I uninstall after the
conversion if desired?
Or, does it permanently alter a Django app somehow?
cs
On May 14, 10:53 pm, Shawn Milochik wrote:
> The best way is to use South.
>
> http://south.aeracode.org/
>
> In your current situation, aft
South is another Django app that you can run on demand when you make a
change to your app Models.
Why do you want to uninstall South after the alteration? Let it be there and
manage your App Models with South. It is better than just syncdb.
On Sun, May 15, 2011 at 12:49 AM, Chris Seberino wrot
51 matches
Mail list logo