unable to render initial data in ModelForm called through CreateView

2018-03-05 Thread Gabriel Wicki
hello list i ran into some weird stuff and neither i nor 2 gentle folks down at the irc-chat could find any obvious problems. task should have been easy: calculate some special initial data and present it as initials in a form. the form is showed correctly, and the right values are printed in cons

Re: Clarification on Foreign Keys requested

2018-03-05 Thread Malik Rumi
I tried the to_field argument, that was a mistake, and I put it back. I was just inserting the pk of the foreign object. However, as things are moving through the pipeline, I used uuid.uuid4() to create additional pks as needed at it went along. Example: def process_item(self, item, spiders)

Reverse for 'detail' with arguments '('',)' not found. 1 pattern(s) tried: ['(?P[0-9]+)/$']

2018-03-05 Thread anyi.lloyd
Am new to Django, please i need help here. Am trying to add a subject into a particular id using generic CreatView, i keeping getting errors Reverse for 'detail' with arguments '('',)' not found. 1 pattern(s) tried: ['(?P[0-9]+)/$'] models.py from django.db import models from datetime import da

Re: Clarification on Foreign Keys requested

2018-03-05 Thread Bill Freeman
Are you specifying the to_field argument, or are you letting it default? And is the pk of the other model made by Django by default, or are you explicitly specifying a foreign key constraint on some field of your own. Things might be better in 2.0, but I've had my troubles with pk that isn't an A

Clarification on Foreign Keys requested

2018-03-05 Thread Malik Rumi
Hello all, Up to now, (admittedly not long - I'm not a total newbie but I still have a LOT to learn) when making a foreign key I would just put the pk of that instance in the fk field, as the docs suggest: By default ForeignKey will target the pk of the remote model but this behavior can be ch

Re: Django server and client communications

2018-03-05 Thread Richard Maceček
Thank you, great, I'll look. I mainly solve the authorization of the client (devices) with the input of 8 numeric code (letters - abc and numeric). This service alike track.tv has it solved. Dne neděle 4. března 2018 21:37:54 UTC+1 Avraham Serour napsal(a): > > I suggest using DRF, It can aut

Re: Djangonauts: say no to selenium drug

2018-03-05 Thread Adler Neves
As you already saw the benefits from doing TDD, try looking at BDD ( django-behave ). It basically allows you to ensure that all usage scenarios from a feature you described works - it doesn't fully replace TDD. Em domingo, 4 de março de 2018 12:29:16 UTC

Django don't start full

2018-03-05 Thread egon.frer...@gmx.de
Django 1.11 project which I start with (spd_auftritt) egon@Epsil173 ~/Entw/spd_auftritt/spd_auftritt $ python manage. runserver --settings=spd.settings.dev and nothing happens. I cancel with CTRL-C. I added some test instructions (prints) in django/core/management/__init__.py: > def execute(

RE: Making an object unsaveable ...

2018-03-05 Thread Matthew Pava
You can always override the save method on the model. If you need to make all your models override the save method, use inheritance. class DoNotSaveModel(models.Model): def save(*args, **kwargs): pass From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Be

Re: Trying to create a CBV that allows user to copy a record

2018-03-05 Thread Alexander Joseph
I'm trying to figure out how get_initial will work in this instance. I know I will have to pass the asset_tag.pk through the url to the FixedAssetCopyView but not sure what to set for my initial data. Assuming I just want to set the "manufacturer" = to the manufacturer of the fixed_asset.pk tha

Re: Making an object unsaveable ...

2018-03-05 Thread bill.torcaso
On Sunday, March 4, 2018 at 4:43:06 AM UTC-5, Bernd Wechner wrote: > > An interesting question I've not been able to solve reading docs or > Googling. As every posting here only after some serious research efforts > including class inspections ;-). But am stumped and wonder if anyone else > ha

Re: Django 1,11 upgrade, render template with context in template.Node

2018-03-05 Thread Christian Ledermann
cool thanks I try that :-) Django 1.11 vs 2.x => we are still on python 2.7 so the first step is Django 1.11 with python 2.7, that 1.11 upgrade to python 3.x and afterwards (well you get the timeline) Our codebase is 11 years old so there are some stumble blocks upgrading. On 5 March 2018 at 05:5