I have in my models, some tables that hold static information, like
status codes, types and descriptions, for example:
in models.py:
class CustomerStatus(models.Model):
name = models.CharField()
class CustomerType(models.Model):
name = models.CharField()
class Customer(models.Model):
hi,
I'm using django' standard auth system, and decorating my views with
@user_passes_test(lambda u: u.is_staff) or something alike.
everything works fine 99% of the time, but sometimes, one day when I
get back to my application, I go to the login page, type my correct
username and correct passwo
I'm not sure how to do directly in Django ORM, but if you use plain
SQL queries, you could do try:
select * from conference_room cr1
where cr1.start_time >=
(select max(start_time) from conference_room cr2 where cr2.start_time
< :yout_filter_time)
and cr1.start_time < :your_filter_time
hi.
I'm working with inline formsets, and I plan to add them dynamically
in my application.
I did some tests and I found the following key points to handle:
1. my html must contain two hidden fields, named:
myinlineformsetname_set-TOTAL_FORMS
myinlineformsetname_set-INITIAL_FORMS
2. each new fo
it seems that inline-formsets will do the job.
something related to models.BaseInlineFormSet and
models.inlineformset_factory.
http://code.google.com/p/django-dynamic-formset/
I'm still studying the code. :P
regards.
-
On 6 abr, 16:09, Cesar Devera wrote:
> hi. imagine f
hi. imagine following scenario:
#--
from django.db import models
from django.forms.models import ModelForm
# ignore this Sample for now. focus on Master and Detail
class Sample(models.Model):
foo = CharField()
class Master(models.Mo
hi.
I have a ModelForm based on an Model like this:
class MyModel(models.Model):
attr1 = models.CharField()
attr2 = models.CharField()
attr3 = models.CharField()
createdby = models.ForeignKey(User, related_name='createdby',
db_column='createdbyid')
calculatedfield = models.CharField()
7 matches
Mail list logo