How to undisplay the field with empty value in django admin?

2018-03-23 Thread shawnmhy
I am currently working on django. I created 4 classes in models.py, one of them is ReactionMeta class. This class has 62 columns, which defined as below: class Reactionsmeta(models.Model): id = models.ForeignKey('Reactions', db_column='id', primary_key=True, max_length=255, on_delete=models.

Re: How to undisplay the field with empty value in django admin?

2018-03-24 Thread shawnmhy
Dear Cictani: Thank you for your great kindness! However, if I create the additional model which maybe called stoichiometry metabolite, then I should I arrange the database t accommodate this class? To make my question better understood, I posted my database of Reactionmeta as below:

Re: How to undisplay the field with empty value in django admin?

2018-03-25 Thread shawnmhy
Dear Cictani: Thank you for your suggestion. But how I write the script? I mean do I need to write another py file in my project? And still, how do I deal with the database of stoichiometrymeta class? Since there is no table corresponding to this class in my database, so I think I can't run the

Re: How to undisplay the field with empty value in django admin?

2018-03-27 Thread shawnmhy
Dear Cictani: Thank you for your detailed information. Just to be clarified, I need to mention that in one reaction, one stoichiometry belongs to only one metabolites. But one metabolite might involves in multiple reactions. For example: a + 2b +c -> c + 3d(the number before each letter is call

A problem about database structure and displacement on django admin

2018-03-27 Thread shawnmhy
Hi everyone, I am currently working on django and get confused about how to design the model. Right now, I have a table named 'Reactionmeta' which structure like below: 1 2 3 4 5 6

how to hide filed use empty_value_display

2018-03-28 Thread shawnmhy
Hi Everyone! Is there any method to do not display the blank field use 'empty_value_display'? I mean, only appear those fields with values but not show those fields without values. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscri

Having trouble writing loop in Django template

2018-04-02 Thread shawnmhy
Hello guys I am currently working on django views and templates and met some problems. I have a model named 'metabolites', which contains: id, name, compartment, charge and formula 5 components. I have another model named 'Reactionsmeta', which contains: id(reactions), name, metabolie1, metab

How to use Graphviz/Networkx in django?

2018-04-05 Thread shawnmhy
Hi everyone, If I have three models and I successfully displayed the data using templates and views, how can I use graphviz or networkx to draw graph using the data that I displayed? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscri

Re: How to use Graphviz/Networkx in django?

2018-04-06 Thread shawnmhy
Hi, thank you for your help. But I think this link cannot really solve my problem. My question is actually how to visualize the data of my model, rather than visualize the model.

Re: How to use Graphviz/Networkx in django?

2018-04-06 Thread shawnmhy
Thanks a lot for your help! But since the data that needed to be visualized is already shown in the page, generate input file is actually not necessary. In that case, what should I do to make django aware that the data shown in the page is the 'input' how can I call the tool to process the visua

How to achieve wildcard search using haystack in django

2018-04-10 Thread shawnmhy
I am currently working on haystack search in django. I met 2 problems, first, when I use 'Whoosh' engine, the search can only return the result that match exactly the same with my search key, for example if I type 'ABC', it cannot match 'ABCD' Secondly, how can I achieve wildcard search using

Access form data of POST method in table in Django

2018-04-16 Thread shawnmhy
currently I am working with Django In template, I combined table and form and thus the code looks like this: {% csrf_token %} ID NAME LOWER_BOUND

Use self-increasing arguments in numeric for-loop in Django

2018-04-19 Thread shawnmhy
I am currently working on django. I have a list of values which stored in 'graphobject', and 'metarange' is defined as range(0,59). In that case, how could I use numbers as argument to display the value stored in graphobject? I tried using following codes but it doesn't work {% for i in met

Re: Use self-increasing arguments in numeric for-loop in Django

2018-04-19 Thread shawnmhy
As I said, the data is already stored in variable: graphobject, I can simply achieve my goal by coding like this: {{% graphobject.1%}}, {{% graphobject.2 %}} .. But I want a loop to do that 在 2018年4月19日星期四 UTC+2下午6:29:18,Jani Tiainen写道: > > Hi. Django templating language isn't programming la

Django--Making query use part of the matching name

2018-04-25 Thread shawnmhy
Hello everyone! Currently I am working on Django. I defined a 'Search' function in views.py: def search(request): q = request.GET.get("q") if q: ReactResul = Reactionsmeta.objects.filter(id__contains=q) MetaResul = Metabolites.objects.filter(id__contains=q) GeneRe

Re: Django--Making query use part of the matching name

2018-04-26 Thread shawnmhy
Thank you for your help! And yes, I think I should use regex. But could you please show me how to use it in my example, since I am new to django.. 在 2018年4月26日星期四 UTC+1上午2:14:10,James Farris写道: > > I believe you want to use icontains rather than contains. It’s case > insensitive. > > I’m not su

Re: Django--Making query use part of the matching name

2018-04-26 Thread shawnmhy
But how about my query string? I am using 'q' as the search term 在 2018年4月26日星期四 UTC下午3:19:15,James Farris写道: > > Try using filter(id__regex=r'\w’) > > I’m not sure if this will give you the exact results your looking for, but > worth a shot. > > > Sent from my mobile device > > On Apr 26, 2018,