I might be wrong here, but this is what I understand:
Let's say you have something like this:
class Recipe(models.Model):
name = models.CharField(max_length=255)
description = models.TextField()
class Step(models.Model):
step_number = models.IntegerField()
description =
In addition, I am not sure you have to use Django here; a simpler Python
web-framework like Flask might be more suited (there you don't have to have
models; just views).
You could write a view that loads the text file and converts it (via a
jinja template) into an HTML table, for example.
I would separate out the two kinds of testing; one test to check the form
functionality (and you do not have to use Selenium for this, btw); and one
test to simulate how the Excel file is processed once it is loaded. For
testing Excel, we use pre-created sheets with known, fixed data and test
On 29/02/2016 2:09 PM, James Schneider wrote:
Again, I'm making some assumptions about your models. If the above code
snippets don't work (aside from typos), please post up your models.py
file(s) so that we can adjust accordingly.
I think James is right. Maybe the answer to the above question
You use "bookForm" as the form id, but refer to "#taskForm" in the JS code.
Perhaps that's the problem?
On Sat, Feb 27, 2016 at 2:16 PM, xristos sarantis
wrote:
> i want to create html form with dynamic input javascript on django
> but the javascript script not connect
Igor,
Yes, the server was started. Here are the contents of the command window
including after trying to go to the website.
C:\Data\Django_Code\FirstApp\mysite>python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
You have unapplied
Yes, the server was started. Here are the contents of the command window,
including after trying to go to the website.
C:\Data\Django_Code\FirstApp\mysite>python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
You have unapplied migrations;
On Sun, Feb 28, 2016 at 12:23 PM, Simon Gunacker
wrote:
> Thank you Rahul,
>
> I actually tried that an this is possible for the relationship between a
> recipe and its steps. But when it comes to the ingredients for a single
> step, I cannot do this any more since the
On Sun, Feb 28, 2016 at 11:47 AM, Rahul Gandhi
wrote:
> You could do something like this:
>
> def detail(request, pk):
> recipe = Recipe.objects.get(id=pk)
> steps = Steps.objects.filter(recipe_id=pk)
> template =
On Sun, Feb 28, 2016 at 11:14 AM, Simon Gunacker
wrote:
> Dear Django Community,
>
> as a first django project I tried to write a site to manage cooking
> recipes. My model is quite simple:
>
> * 1 recipe has n steps
> * 1 step has a description and n ingredients, each
Usually image_file.url (assuming image_file is the name of your ImageField)
should give you the full path to the local file. Not sure what you're using
for your Ajax function/call though and how you have your web app set up on
the REST part.
On Sun, Feb 28, 2016 at 2:46 PM,
update my project now
my view.py code
def calc(request):
a = []
NList = []
y=0
member=0
member = request.POST.get ('member', False)
for i in range(int(member)):
input = request.POST.get ('input', False)
I need get path to local file in for ImageField.
Next, transfer path to my view thought Ajax request, update in database and
almost all.
I need will make it manually, for my goals.
May be, anyone known how it make?
I am tried already django-ajaximage, Ajaxfileupload and many other, but it
Mike, do you have the server restarted?
As for me, the shell window says:
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
воскресенье, 28 февраля 2016 г., 18:15:24 UTC+3 пользователь Mike Kipling
написал:
>
> Here are the two urls.py files:
>
>
Thank you Rahul,
I actually tried that an this is possible for the relationship between a
recipe and its steps. But when it comes to the ingredients for a single
step, I cannot do this any more since the ingredients depend on steps
again. After reading your suggestion I thought about it once
You could do something like this:
def detail(request, pk):
recipe = Recipe.objects.get(id=pk)
steps = Steps.objects.filter(recipe_id=pk)
template = loader.get_template('recipe/recipe_detail.html')
context = {
'recipe': recipe,
'steps': steps
}
return
You could do something like this:
Instead of
recipe['steps'] = Steps.objects.filter(recipe_id=pk)
Do this:
steps = Steps.objects.filter(recipe_id=pk)
context = {
'recipe': recipe,
}
On Monday, February 29, 2016 at 1:00:25 AM UTC+5:30, Simon Gunacker wrote:
>
> Dear Django
Dear Django Community,
as a first django project I tried to write a site to manage cooking
recipes. My model is quite simple:
* 1 recipe has n steps
* 1 step has a description and n ingredients, each of a certain amount
defined by a certain unit
all in all, I have 5 tables (Recipe, Step,
I haven't had a look at the github link, but if all you want to do is to
display plots (I'm assuming these are images) and text files, then all you
need to do is to serve these files from the views to the templates.
You can store these plots/text files in a directory which is accessible to
Here are the two urls.py files:
polls/urls.py
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
]
mysite/urls.py
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^polls/',
On Saturday, February 27, 2016 at 2:06:42 PM UTC-6, James Schneider wrote:
>
>
> On Feb 27, 2016 11:49 AM, "Mike Kipling"
> wrote:
> >
> > I am working through the Django tutorial Writing your first Django app,
> part 1.
> > I am using Windows 10, python 3.5.1 and Django
On Feb 28, 2016 7:50 AM, "Alain Muls" wrote:
>
> Hi All,
>
> I made a program that creates 4 plots and text files about the location
of GNSS (Global Navigation Satellite Systems) based on TLEs downloaded from
NORAD.
> You can find it at
Hi All,
I made a program that creates 4 plots and text files about the location of
GNSS (Global Navigation Satellite Systems) based on TLEs downloaded from
NORAD.
You can find it at https://github.com/alainmuls/GNSSTracking
I would like to use this program in django (I started with
23 matches
Mail list logo