Don't know if this is the solution for you, but you could take a look
here: http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#id1
and do something like this:
class Product(models.Model):
name = models.CharField(max_length=64)
class Meta:
abst
i think you want to create a group.
On Tue, 2009-10-06 at 01:05 -0700, elminio wrote:
> Hi,
> In admin Panel I can choose groups and give them specified
> permissions. For example
>
> admin | log entry | can add log entry
>
> And I would like to create my own type of permission which for exampl
may change that field to 6 letters length word. Thats sily
> example but in some cases it may be useful.
>
>
> On Oct 6, 10:19 am, "Bogdan I. Bursuc"
> wrote:
> > i think you want to create a group.
> >
> > On Tue, 2009-10-06 at 01:05 -0700, elminio w
You could do something like this:
def save(self, force_insert=False, force_update=False):
# first save the model using the base class save method
super(MyModel, self).save(force_insert, force_update)
# then self will have an id set
v = self.id
On Tue, 2009-10-06 at
If you want to set the status field on the model after you save the
form, you can do something like this:
msg_instance = form.save(commit=False)
msg_instance.status = 'F'
msg_instance.save() # don't forget the save, because the form didn't
# save the model
On Wed, 2009-10-
I think we need a little more info here, post your urls.py that contain
mostro_permesso url and your view that is linked to that url.
On Thu, 2009-10-08 at 00:04 -0700, luca72 wrote:
> Hello this is my model:
> from django.db import models
>
>
> class Per(models.Model):
> dip = models.CharF
.urls.defaults import *
> from django.contrib import admin
> admin.autodiscover()
>
>
> urlpatterns = patterns('',
> (r'^admin/', include(admin.site.urls)),
> (r'^mostro_permesso/', 'rm.remi.views.mostro_permesso'),
> )
>
>
&g
uot;>
> http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
>
> {{titolo}}
>
>
>
>
> {{form.as_table}}
>
>
>
>
>
>
> Luca
>
> On 8 Ott, 10:33, "Bogdan I. Bursuc"
Yes is simple:
just add the field to the form and will override the model one:
class PerForm(ModelForm):
dri = forms.CharField(max_length=100, widget=forms.HiddenInput())
class Meta:
model = Per
You should check the docs on the Widgets to make sure:
http://docs.djan
You want the field hidden or not on the form at all ?
if you want it out of the form user
exlude = ('dri',) on Meta but type exclude with a 'd' :)
On Thu, 2009-10-08 at 07:14 -0700, luca72 wrote:
> I have try it but the field dri is show in the form
>
> Luca
>
> On 8 Ott, 16:06, "Mark (Nosred
Why don't you set the value directly from the view functions ?
return render_to_response('index.html', {'val': dict[msg.status]})
On Thu, 2009-10-08 at 23:51 -0700, valler wrote:
> How can i use dictionary values in example below?
>
> def index(request):
> msg = Msg.objects.all()
> dict =
You forgot a ")" sign. That's why syntax error.
On Thu, 2009-10-08 at 23:48 -0700, Eva Hamilton wrote:
> >From the django documentation (here:
> >http://www.djangoproject.com/documentation/models/select_related/)
> I obtained this bit of code for performing a select_related on a list
> of object
I, see.
Don't know an alternative. Don't know if it's possible. You may consider
creating a tag or a filter for this job. That will result in a clean,
pretty solution.
On Fri, 2009-10-09 at 00:28 -0700, valler wrote:
> On Oct 9, 11:14 am, "Bogdan I. Bursuc"
> w
a typo in the post - but not present in the actual
> code.
>
> It should have read...
>
> world = Species.objects.all.select_related()
> family_list = [o.genus.family for o in world]
>
> Or is there another missing ")" that I'm not seeing?
>
> Thank y
It can be improved.
My suggestion is to use lower_underscored for methods names and you can
do something like this:
delete the method in your model because django models allready provides
a method for your choice fields:
get_field_display()
for your field would be:
I know the shell and view are the same i meant the view and the template
are different, you didn't specify the brackets after the all method
like: all(), this because your might be used with the template syntax, I
made this mistake, too. That why i was telling you about the difference
between view
Try to delete the auth_permissions table the sync db
see if it helps
On Fri, 2009-10-09 at 01:29 -0700, elminio wrote:
> Up Up
>
> On Oct 8, 12:10 pm, elminio wrote:
> > Hi,
> > I've extended my model with new permission.
> >
> > class Meta:
> > permissions = (
> > ("total
from shcbelpa.season.models import Game
This is the line of code that generates the error right?
Is myapp = shcbelpa ?
On Fri, 2009-10-09 at 10:39 +0200, Christian Wittwer wrote:
> Hi,
> I have a strange problem with importing models from an other app.
>
> /myapp/season/models.py
> ---
chefsmart wrote:
> I have a particular scenario that I can't seem to figure out how to
> accomplish in Django.
>
> I have the following models: -
>
> class Process(models.Model):
> name = models.CharField(max_length=50)
> is_active = models.BooleanField(db_index=True)
>
> class Phase(model
their
> respective orders in a single "screen/page"? The way I see it, I would
> use a ModelMultipleChoiceField to allow the user to select all the
> phases that they want. But how do I allow the user to specify the
> order of each selected phase in the same "screen/
20 matches
Mail list logo