How about writting adapter to the django user class? It can have
descriptor for login (getting login would return users email). While
creating such user login would be set (only once, during creation) for
example the following value: user id converted to string preceded by
one character. For other
Hi,
I've got an application called myapp
In the main folder of django project there is initial_data.json file
containing initial data for the application
I also have file "simplefix.json" situated in myapp/fixtures
containing initial data for tests
Then after calling: python manage.py test mya
So I sloved my problem with QuerySet - while creating the ModelForm
instance, there should be passed instance argument, not only POST or
GET, so that the ModelForm could "know" if there should be edition of
existing model or creating a new one.
Regards,
Marek
Marek
Marek Wawrzy
Hi,
I've got the following class:
CarForm(ModelForm):
def __init__(self, *args, **kwargs):
super(CarForm, self).__init__(*args, **kwargs)
id = self.instance.id
qs = CarPhoto.objects.filter(car__id = id)
self.fields['main_image'] = forms.ModelChoiceField(qs)
= CarPhotoForm(post)
return render_to_response('cars.html', {'carForm':carForm,
'carPhotoForm':carPhotoForm})
then without calling form's is_valid method, the validation was
performed after submitting form.
Malcolm Tredinnick wrote:
> On Mon, 20
t;
> On Mon, 2009-03-23 at 00:59 +0100, Marek Wawrzyczek wrote:
> > Hi
> >
> > Is there any possibility, to create an bound instance of a form (even if
> > it contains fields with incorrect data) and then resend the form to the
> > page without validating ?
> &g
Hi
Is there any possibility, to create an bound instance of a form (even if
it contains fields with incorrect data) and then resend the form to the
page without validating ?
Regards,
Marek
--~--~-~--~~~---~--~~
You received this message because you are subscrib
Malcolm Tredinnick wrote:
> On Mon, 2009-03-09 at 13:34 +0100, Marek Wawrzyczek wrote:
> [..]
>
>
>> When I try to use FileField it works the same. How can I slove this
>> problem ?
>>
>
> You need to add a bit extra to the HTML form when file uploads
Hi,
I've got the code like this:
class Photo(models.Model):
image = models.ImageField(upload_to='photos')
class PhotoForm(ModelForm):
class Meta:
model = Photo
View function fragment:
if request.method == 'POST':
post = request.POST.copy()
print 'post: %s'
hould just stop responding to things :-)
>
> Anyway, since you're serializing a model, you *should* be using your
> originally posted method. Use the way Marek said for anything other
> than models (of course, the object has to be serializable.)
>
> If that doesn
Thomas Guettler wrote:
>
> Jeff FW schrieb:
>
>> The serializers are for serializing querysets/models. I'm surprised
>> you're not getting an error message there--are you catching all
>> exceptions?
>>
>> What you want is in django.utils.simplejson:
>>
>> from django.utils.simplejson import en
Hello,
I've got the code like this:
from django.core import serializers
...
ret = { }
ret['a'] = 'b'
json_serializer = serializers.get_serializer("json")()
serialized = json_serializer.serialize(ret, ensure_ascii=False)
print serialized
and this doesn't print serial
Sorry, I wanted to begin a new topic, and I've forgotten to change the
subject.
Best wishes,
Marek
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to djang
Hi
At:
http://docs.djangoproject.com/en/dev/topics/db/queries/#spanning-multi-valued-relationships
there is written:
"That may sound a bit confusing, so hopefully an example will clarify.
To select all blogs that contains entries with "Lennon" in the headline
and were published in 2008, we
Hi_
_
At:
http://docs.djangoproject.com/en/dev/topics/db/queries/#spanning-multi-valued-relationships
there is written: /
"That may sound a bit confusing, so hopefully an example will clarify.
To select all blogs that contains entries with "Lennon" in the headline
and were published in 2008
You're very observant. Thanks :))
2008/12/6 Karen Tracey <[EMAIL PROTECTED]>
> On Sat, Dec 6, 2008 at 11:53 AM, Marek Wawrzyczek <[EMAIL PROTECTED]>wrote:
>
>> In the tutorial (http://docs.djangoproject.com/en/dev/intro/tutorial01/)
>> I do everything what is
/utils/translation/trans_real.py",
line 198, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File
"/usr/lib/python2.5/site-packages/django/utils/translation/trans_real.py",
line 181, in _fetch
app = getattr(__import__(appname[:p], {}, {}, [appname[p+1:]]),
On the page http://www.juiceanalytics.com/openjuice/django_settings_module/I've
found a script and after I run the script then it worked.
Regards
2008/12/6 Marek Wawrzyczek <[EMAIL PROTECTED]>
> I've created a django application, and after that I get the same error.
> Bef
> >
> >
> >
> > Traceback (most recent call last):
> > File "", line 1, in
> > File "d:\P25\Lib\site-packages\django\db\__init__.py", line 9, in
> >
> > if not settings.DATABASE_ENGINE:
> >
>
> python can't find your conf
19 matches
Mail list logo