hat you can have access to it via Python.
Also, have you taken a look at the inspectdb management command - it might
go a long way in helping you get your models.py files setup - see
http://docs.djangoproject.com/en/dev/ref/django-admin/#inspectdb
>
> Michael lissnermliss...@michaeljaylissner.c
On Fri, Feb 19, 2010 at 10:04 AM, mjlissner wrote:
> I'm using django for a final project in my masters program at UC
> Berkeley, and I'm trying to sort out exactly how the database works. I
> would spend a bunch of time figuring this out myself, but I am working
> in a
gt; seem something in the toolbar is causing the problem.
>
> And you are right... those settings you refer to are optional.
>
> Thanks,
> Rob
>
> On Feb 11, 10:57 pm, Rishabh Manocha <rmano...@gmail.com> wrote:
> > Mike,
> >
> > Thanks for replying. Re
toolbar.panels.logger.LoggingPanel',
>)
>
>MIDDLEWARE_CLASSES += (
>'debug_toolbar.middleware.DebugToolbarMiddleware',
>)
>
>INSTALLED_APPS += (
>'debug_toolbar',
>)
>
> Mike
>
>
> On 11/02/2010 2:07pm, Rishabh Manocha wrote:
>
>> Hey Guys,
>>
&
Hey Guys,
I know I must be doing something stupid here, but for the life of me, I
can't seem to be able to get django-debug-toolbar to work - I keep getting a
404 error whenever I visit http://localhost:8000/admin/ (see [1]). I've
followed the Installation instructions at
On Sat, Feb 6, 2010 at 10:35 PM, Karen Tracey <kmtra...@gmail.com> wrote:
> On Sat, Feb 6, 2010 at 6:16 AM, Rishabh Manocha <rmano...@gmail.com>wrote:
>
>> [snip]
>> While this works just fine, the one problem I'm having is that instead of
>> showing the ti
Hi Guys,
I was trying to use the newly introduced ModelAdmin.get_readonly_fields
method to mark a OneToOne relation as read only - something along the lines
of:
models.py:
class Book(models.Model):
title = models.CharField(max_length = 50)
...
def __unicode__(self):
return
On Tue, Feb 2, 2010 at 8:56 AM, Sumanth wrote:
> Hi all,
>
> I have a basic form
>
> class AssumptionsForm(forms.Form):
> writedownoper = forms.ChoiceField( required=True, choices =
> [('1','1'),('2',2='),('3','3')])
>
> Now in my view after I create the form I want
Hey guys,
I've been trying to get InlineModelAdmin objects setup in my admin
app, but am unable to figure out how to do so correctly. Using the
same example as the one listed in the docs [1]:
class Author(models.Model):
name = models.CharField(max_length=100)
class Book(models.Model):
On Thu, Dec 10, 2009 at 12:12 PM, Rishabh Manocha <rmano...@gmail.com> wrote:
> On Thu, Dec 10, 2009 at 11:21 AM, Kenneth McDonald
> <kenneth.m.mcdon...@sbcglobal.net> wrote:
>>
>>> And the code to create and validate the form is...? That might help
>>>
On Thu, Dec 10, 2009 at 11:21 AM, Kenneth McDonald
wrote:
>
>> And the code to create and validate the form is...? That might help
>> in figuring out what is wrong.
>>
> Sure. It's just:
>
>
>
> def buysell(request):
> form = BuySellForm()
> return
On Thu, Dec 3, 2009 at 4:17 PM, Todd Blanchard wrote:
> All the tutorials on forms discuss creating a new record.
>
> I've got a record in the database, I want to fetch it, plunk its values into
> a form, let the user edit it and save it.
>
> I don't see how to conveniently
On Tue, Nov 17, 2009 at 7:40 PM, guptha wrote:
> hi group,
>
> class Parent(models.Model):
>user = models.ForeignKey(User,unique=True)
>school=models.ForeignKey(School)
>def __unicode__(self):
> return self.user.username
>
> class Student(models.Model):
>
On Sun, Nov 8, 2009 at 9:41 PM, Bobby Roberts wrote:
>
> anyone out there that can help me?
>
> On Nov 7, 8:39 pm, Bobby Roberts wrote:
> > Hi. I have never used foreign keys I need to start and I need
> > help. I'm running python2.5 and
On Mon, Nov 2, 2009 at 1:43 PM, Denis Bahati wrote:
> Hi All,
> Am developing an application where by it links two tables author and book,
> the id of author is a foreign key to book table. How can i display the name
> of the author when am displaying the book list.
>
> >
>
On Thu, Oct 29, 2009 at 2:47 PM, sridharpandu wrote:
>
> Hi,
>
> I ran the syncdb command to create the tables for INSTALLED_APPS. I
> get the errors as shown in the output below. Can someone tell me
> what's wrong. I am using a laptop that runs Django as well as the
>
On Mon, Oct 26, 2009 at 9:37 AM, Jeffrey Taggarty wrote:
>
> Hello,
>
> I have a web site which shows different content based on a location
> the visitor chooses. e.g: User enters in 55812 as the zip. I know what
> city and area lat/long. that is and give them their content
On Tue, Jun 2, 2009 at 9:10 AM, Marco Bazzani wrote:
>
> On Mon, Jun 1, 2009 at 23:19, V wrote:
> >
> > On Jun 1, 6:50 pm, Marco Bazzani wrote:
> >> I'm trying to extends django-registration app with some more fields
On Thu, Apr 30, 2009 at 4:10 PM, ruben.django wrote:
>
> Hi,
>
> i've got a template with a jquey ajax call. Before, the web service
> (Apache) always redirects to a http direction and the ajax call worked
> perfectly, but from now, it redirects to a secure https direction
On Fri, Feb 6, 2009 at 5:48 AM, mguthrie wrote:
>
> Anybody?
>
> On Feb 3, 9:41 am, mguthrie wrote:
> > I'm looking at creating an application that would use Django Auth for
> > managing users but once logged in the user will "belong" only to a
>
On Wed, Nov 26, 2008 at 10:00 AM, Praveen <[EMAIL PROTECTED]>wrote:
>
> Hi All, i am very new bie of Django, i have started work on before 3
> days.
> I am following DJango book. I am playing with 6 chapter "Using the
> admin interface"
> In my urls.py file i set the url for admin
>
> from
On Wed, Nov 26, 2008 at 9:59 AM, Greg <[EMAIL PROTECTED]> wrote:
>
> Hello,
> I have the following code:
>
> ///
>
> b = Choice.objects.filter(choice=a.collection.id)
>for cb in b:
>discount_price = cb.price.name * Decimal(str(.75))
>cb.price.name = discount_price
>
On Wed, Oct 8, 2008 at 5:07 PM, Chris <[EMAIL PROTECTED]> wrote:
>
> I installed django-registration via easy_install, and followed the
> directions for setting it up in my app, but when I go to /register, I
> get the error:
>
> File "/usr/lib/python2.5/site-packages/django_registration-0.5-
>
On Wed, Aug 27, 2008 at 10:55 AM, Vance Dubberly <[EMAIL PROTECTED]>wrote:
>
> So I want to do something I'd think would be extremely common and simple.
>
> user = User.objects.get(pk=data['id'])
>
> I want a dictionary of the model attributes/values from user.
>
> user_dict = { 'first_name' :
In your form field definition, set empty_labal = None
This was somewhere in the docs, but am unable to find it in the 2 mins I
spent on the search.
Best,
R
On Fri, Jul 25, 2008 at 10:14 AM, JF Simon <[EMAIL PROTECTED]> wrote:
>
> hi !
>
> How to remove the first --- in a from a
>
That's "empty_label = None". Sorry for the typo
Best,
R
On Fri, Jul 25, 2008 at 3:07 PM, Rishabh Manocha <[EMAIL PROTECTED]> wrote:
> In your form field definition, set empty_labal = None
>
> This was somewhere in the docs, but am unable to find it in the 2 min
You could use "user profiles" which will allow you to store various user
specific preferences. See [1] to learn how to do this.
I am currently using profiles to identify users by the department they work
in and the last time they edited a form (this is different from last login).
Best,
R
[1] -
Anybody got any ideas here?? I could really use some help with this problem.
Thanks,
Rishabh
On Tue, Jun 24, 2008 at 9:49 AM, Rishabh Manocha <[EMAIL PROTECTED]> wrote:
> Ok, so I need a bit more direction here. I've got newforms-admin setup and
> working as far as displaying th
You're probably looking for
http://www.djangoproject.com/documentation/newforms/#initial
Best,
Rishabh
On Tue, Jun 24, 2008 at 9:04 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I probably need to be more specific..
>
> here's my model:
>
> class Recipe(modesl.Model):
>
> recipetitle
Ok, so I need a bit more direction here. I've got newforms-admin setup and
working as far as displaying the various FK relationships a user has on
his/her page. However, I'm still not able to figure out how to display FK
relationships in the list_filter page. Here is my setup (the UserTechSkill
Some more details would be good, but off the top of my head, something like
this might work:
def my_view(request):
form = MyForm()
form.fields['mychoice'].choices = ((1,'ABC'),(2,'XYZ'))
I havent' been able to test this out, so make sure you do before you using
it.
You can of-course do
Why not just override the save method for the model and delete any instances
of it before calling super.save(). I'm not a 100% sure on this, but I do
think the admin interface calls the model save method whenever you edit
something from there.
So, something like this:
class About(models.Model):
This is what I was thinking, but I thought there was a glimmer of hope of
achieving this without moving over to newforms-admin. Is there absolutely no
way to do this using trunk??
I'll give newforms-admin a shot on my dev box over the weekend and see what
comes out of it. I will research this
http://www.djangoproject.com/documentation/newforms/#custom-form-and-field-validationis
probably what you're looking for.
Best,
Rishabh
On Wed, Jun 11, 2008 at 3:20 PM, mwebs <[EMAIL PROTECTED]> wrote:
>
> I want to add a custom validation rule for a newforms form.
> I could not figure out how
Hey all,
I'm using django's in-built authentication mechanism for my app. Several of
my models are of the form:
class UserTechSkill(models.Model):
user = models.ForeignKey(User,edit_inline = models.TABULAR)
skill = models.ForeignKey(TechSkillsList,core=True)
prof_level =
What you want to do is perfectly doable. If (for example) you want the
street field to show up as a textarea with 40 columns in your form, you
would put something like this in your forms.py:
class PersonForm(ModelForm):
street = forms.CharField(widget = forms.TextArea(attrs = {"cols":40}))
seems like that
could be an issue if my app ever goes large.
Thanks for your help,
R
On Wed, May 21, 2008 at 5:42 AM, Graham Dumpleton <
[EMAIL PROTECTED]> wrote:
>
>
>
> On May 20, 10:53 pm, "Rishabh Manocha" <[EMAIL PROTECTED]> wrote:
> > Hey Guys,
> &g
There was a permission denied error 'cause if your webserver was
running under some user other than root (as it should be), it won't be
able to write to the root's home directory (as it shouldn't).
Assuming you are using Apache with mod_python, here is something you
could put in your httpd.conf:
Hey Guys,
I have just deployed my code to my test server (from my laptop) and
setup apache/mod_python to serve the pages. Everything works just fine
when I work with Firefox, but whenever I access my pages using IE 6, I
keep getting the following errors in the apache error logs:
[Tue May 20
Since the list of countries is coming from a model, why not use
ModelChoiceField [1]. So, your field will look something like:
Country = forms.ModelChoiceField(required=True,widget=forms.Select(attrs
= attrs_dict), queryset = Country.objects.all())
Best,
R
On Mon, May 19, 2008 at 10:02 AM,
Did you take a look at
http://www.djangoproject.com/documentation/newforms/#customizing-the-error-list-format
??
You could just return the error message without wrapping it in any
div/span/ul etc.
R
On Tue, 2008-04-29 at 22:23 -0700, Mike Chambers wrote:
> Thanks.
>
> This was the only way I
008 at 12:06 PM, Rishabh Manocha <[EMAIL PROTECTED]>
> wrote:
>
>
> >
> > Thanks for writing back, Karen. I guess the snippets of code I
> > inserted were a little misleading. I have many other modelforms too,
> > which all have a user = ForeignKey(User)
I'm having similar issues gettind mod_python to work with Apache on a
windows box. I don't have my httpd.conf in front of me atm, but i'm
basically seeing what zoggernaut is seeing :(
Best,
R
On 25-Apr-08, at 8:14 AM, zoggernaut wrote:
>
> FYI, I followed the instructions on the tutorial
> form.save()
> else:
> form = ThingForm()
>
> return render_to_response('iuv.html', {'form': form})
>
>
>
> On Apr 21, 3:19 pm, "Rishabh Manocha" <[EMAIL PROTECTED]> wrote:
> > I don't know if this answers your
AFAIK that JS date picker is only available in the admin interface.
rendering a form as {{ my_form}} does not print that date picker
either.
I'd be interested in knowing how to get it to show up too (what JS/CSS
files need to be added, whether there is some setting we can use in
the python code
http://www.djangoproject.com/documentation/newforms/#customizing-the-error-list-format
documentation ftw :)
On Mon, Apr 21, 2008 at 5:15 AM, J. Pablo Fernández <[EMAIL PROTECTED]> wrote:
>
> No ideas on this?
>
>
>
> On Apr 6, 2:38 am, J. Pablo Fernández <[EMAIL PROTECTED]> wrote:
> > Hello,
set the
queryset for each list on submission.
Hope that clears up my problem a little bit more.
Best,
R
On Mon, Apr 21, 2008 at 6:38 PM, Karen Tracey <[EMAIL PROTECTED]> wrote:
>
> On Mon, Apr 21, 2008 at 2:53 AM, Rishabh Manocha <[EMAIL PROTECTED]> wrote:
>
>
> >
I don't know if this answers your specific question, but this is being
worked on, apparently - http://code.djangoproject.com/ticket/5361.
I had a similar requirement, where I wanted to dynamically append a
model field to the filename before saving it. I ended up getting the
model field's value
Hey Guys,
I have 4 models working something like this:
class User(models.Model):
name = models.CharField()
email = models.EmailField()
...
class A(models.Model):
domainname = models.CharField()
class B(models.Model):
domain = models.ForigenKey(A)
name = models.CharField()
You could just write a clean_mycharfield() (assuming mycharfield is
your field name) and just return
self.cleaned_data['mycharfield'].strip().
Check
http://www.djangoproject.com/documentation/newforms/#custom-form-and-field-validation
for more details.
On Sat, Apr 19, 2008 at 2:37 AM, Peter
Did you take a look at
http://www.djangoproject.com/documentation/static_files/#how-to-do-it.
If you are using the dev server, this is the way to do it.
Hence, you should not be using anything like (http://127.0.0.1:8000/detail/...) in your view.
R
On Wed, Apr 16, 2008 at 4:37 AM, [EMAIL
ngo code. As you said in
> > your post, I've never seen it documented anywhere. I came across it
> > after I found it in a few bug reports because apparently, there were
> > similar issues. I posted that ticket in my first post.
> >
> > When you use this, are you ha
I would like to get an answer for this too. Just reading through
Justin's code, I have figured out the solution to a problem I was
stuck on for a few days (I am new to Django so reading and learning
about the _set_queryset function was a godsend).
Also, I was wondering if someone can point me in
Does anyone have any ideas here?? If the question is unclear, I'd be
happy to clarify myself.
Thanks,
Rishabh
On Fri, Apr 4, 2008 at 4:50 PM, Rishabh Manocha <[EMAIL PROTECTED]> wrote:
> Hey Guys,
>
> I was trying to rewrite parts of the Poll app example described in the
PM, Ronny Haryanto <[EMAIL PROTECTED]> wrote:
>
> Try:
>
> r'^test/fullpath/(?P[\w/]+)
>
> Ronny
>
>
>
> On Mon, Mar 31, 2008 at 4:08 PM, Rishabh Manocha <[EMAIL PROTECTED]> wrote:
> >
> > Hey guys,
> >
> > I'm trying to
I think he meant recipes in that are there any recipes to accomplish
this (storing binary data to the DB). Unless I'm getting this
completely wrong, he was not talking about cooking recipes :).
I would be interested in a solution for this too. There are cases
where apps running as the apache/web
Hey guys,
I'm starting work on a project and for now, won't be using a db with
it. Instead, I'll be using a library which fetches all the data I need
from a local SVN store. I was wondering where should I access this
library from - the model (models.py) or the view (views.py)?? I don't
know if
57 matches
Mail list logo