Ολοκληρωμένο

Fix a table column for a Django page.

I'm building a subscription function using Django. Type A users create a lot of "program", Type B users can join this program. (Actually, Type B user need to provide their own website information to us first and they can have multiple website. So, it should be a user's website join a "program")

I want to create a program list that show all the existing program for Type B users and it has a "join button" / "joined label" after each program name. However, the join/joined label function is not work...

---------------------------------------------------------------------------------------------------------------------------------------

Here is the related [url removed, login to view]

# Type A users add program to this table

class Program([url removed, login to view]):

user = [url removed, login to view](User, on_delete=[url removed, login to view], null=True)

name = [url removed, login to view](max_length=128, unique=True, null=True, blank=True, default=None)

program_id = [url removed, login to view](primary_key=True)

status = [url removed, login to view](null=True, blank=True, default=1003)

slug = [url removed, login to view](blank=True, unique=True)

# Type B users add their website's info to this table

class Website([url removed, login to view]):

user = [url removed, login to view](User, on_delete=[url removed, login to view], null=True)

name = [url removed, login to view](max_length=128, unique=True, null=True, blank=True, default=None)

website_id = [url removed, login to view](primary_key=True)

url = [url removed, login to view](max_length=200, null=True, blank=True, default=None)

slug = [url removed, login to view](blank=True, unique=True)

# When a Type B user join a program, it will write to this table

class Subscription([url removed, login to view]):

program = [url removed, login to view](Program, on_delete=[url removed, login to view], null=True, blank=True)

website = [url removed, login to view](Website, on_delete=[url removed, login to view], null=True, blank=True)

status = [url removed, login to view](null=True, blank=True, default=1003)

created = [url removed, login to view](auto_now=True)

---------------------------------------------------------------------------------------------------------------------------------------

[url removed, login to view]

def program_list(request):

# show their first website related program in the default page.

web_id = [url removed, login to view]().filter(user_id=[url removed, login to view]).first()

# get a list of subscription table for the web_id

sub = [url removed, login to view]().filter(website=web_id, status=1001)

# get all the active program

program = [url removed, login to view](status=1001)

return render(request, 'dashboard/[url removed, login to view]', {'program': program, 'subp': sub})

---------------------------------------------------------------------------------------------------------------------------------------

template - [url removed, login to view]

{% for prog in program %}

<tr>

<td>{{[url removed, login to view]}}</td>

<td>{{prog.program_id}}</td>

{% if [url removed, login to view] == 1001 %}

<td><span class="label label-default">Joined</span></td>

{% else %}

<td><button type = "button"class="btn btn-info" onclick="change_status({{prog.program_id}})">Join</button> </td>

{% endif %}

</tr>

{% endfor %}

I want to check if program_id and website_id are in subscription table, then, it show a joined label with status label (1001-approved, 1002-pending, 1003-reject)

otherwise, show a join button.

However, this "if" is not work... {% if [url removed, login to view] == 1001 %}

How to finish this project?

- provide necessary code to me, and I will test if it is work or not.

(If the above information is enough, you can provide the code to me and I can test it.)

(If you need any detail information, I can provide to you.)

I will choose a freelancer after ~ 24 hrs.

Please reply with this random string, to show you have read my question.

=== MuLvyzpznfSzP2Lcus1W ===

Ικανότητες: Django, HTML, Javascript, Python

Περισσότερα: fix rss feed web page, fix div top right page, table css web page, php general script display table data web page, hide table row web page, javascript hide table rows based page, fix article joomla front page, mysql restore fix table, javascript table column drag, javascript table column freeze, ajax display table mysql web page, dual column content page drupal, need clean column css page, editable table simple web page, table based html page, php loop table column, extract table data web page, fix table dreamweaver, freeze html table column, oscommerce adding model column cart page

Σχετικά με τον Εργοδότη:
( 2 αξιολογήσεις ) Hong Kong, Hong Kong

Ταυτότητα Εργασίας: #16651826

Ανατέθηκε στον:

sonus21

=== MuLvyzpznfSzP2Lcus1W === Hi there, I'm a professional Django web developer, having expertise in Django, DRF, PostgreSQL, Bootstrap, HTML and other Django technologies like Memcache, ElasticSearch integration, Περισσότερα

$220 HKD σε 1 μέρα
(56 Αξιολογήσεις)
6.1

11 freelancers κάνουν προσφορές κατά μέσο όρο $204 για αυτή τη δουλειά

pkbsdmp

I am a python developer having 6 + experience in IT industry. I am expert in: * Python, Web Development (Django, Flask) * CSS, HTML5, Javascript, AJAX, JQuery, Bootstrap * REST API application development Περισσότερα

$260 HKD σε 1 μέρα
(64 Αξιολογήσεις)
5.6
kripanidhi

I can start right now to build you high quality application !! After going through the project description i'm ready to build your exact application that you want with all the features and functionalities as a Περισσότερα

$265 HKD σε 1 μέρα
(22 Αξιολογήσεις)
4.9
WebStar426

Hi, thank you for looking at my cover letter. I am django Expert. I’ve carefully gone through your job posting. I can work with you anytime you want. I believe I possess the necessary skills and experience you are s Περισσότερα

$190 HKD σε 1 μέρα
(7 Αξιολογήσεις)
3.2
an1566706

we applies most recent technologies-to provide best services through its high qualified development team which makes Our Solutions able to provide best services to its clients with the best price . Now, and since m Περισσότερα

$90 HKD σε 1 μέρα
(6 Αξιολογήσεις)
3.2
piyushccet

=== MuLvyzpznfSzP2Lcus1W === Experienced developer working currently in Python with Django framework. Also having good experience working with Jinja Templates for Django. Let's discuss about it more when you're online. Περισσότερα

$500 HKD σε 1 μέρα
(7 Αξιολογήσεις)
3.2
dpappu131

MuLvyzpznfSzP2Lcus1W ..... Hi ............... Please message me for more details......... Waiting for your response .... REgards

$200 HKD σε 1 μέρα
(7 Αξιολογήσεις)
3.1
BeyoutiF00L

We at BEYOUTIFOOL welcome you to our family! With over 7 years of experience, we have been successful in creating content, web apps, graphics andanimation for our clients. We aim to provide specially curated services t Περισσότερα

$80 HKD σε 2 μέρες
(3 Αξιολογήσεις)
1.6
milenastoeva

A proposal has not yet been provided

$120 HKD σε 5 μέρες
(0 Αξιολογήσεις)
0.0
Anushka102

My experience of working with Django and python makes me suitable for the project. Assurity to finish it by the given deadline.

$200 HKD σε 1 μέρα
(0 Αξιολογήσεις)
0.0
$120 HKD σε 2 μέρες
(0 Αξιολογήσεις)
0.0