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 [login to view URL]
# Type A users add program to this table
class Program([login to view URL]):
user = [login to view URL](User, on_delete=[login to view URL], null=True)
name = [login to view URL](max_length=128, unique=True, null=True, blank=True, default=None)
program_id = [login to view URL](primary_key=True)
status = [login to view URL](null=True, blank=True, default=1003)
slug = [login to view URL](blank=True, unique=True)
# Type B users add their website's info to this table
class Website([login to view URL]):
user = [login to view URL](User, on_delete=[login to view URL], null=True)
name = [login to view URL](max_length=128, unique=True, null=True, blank=True, default=None)
website_id = [login to view URL](primary_key=True)
url = [login to view URL](max_length=200, null=True, blank=True, default=None)
slug = [login to view URL](blank=True, unique=True)
# When a Type B user join a program, it will write to this table
class Subscription([login to view URL]):
program = [login to view URL](Program, on_delete=[login to view URL], null=True, blank=True)
website = [login to view URL](Website, on_delete=[login to view URL], null=True, blank=True)
status = [login to view URL](null=True, blank=True, default=1003)
created = [login to view URL](auto_now=True)
---------------------------------------------------------------------------------------------------------------------------------------
[login to view URL]
def program_list(request):
# show their first website related program in the default page.
web_id = [login to view URL]().filter(user_id=[login to view URL]).first()
# get a list of subscription table for the web_id
sub = [login to view URL]().filter(website=web_id, status=1001)
# get all the active program
program = [login to view URL](status=1001)
return render(request, 'dashboard/[login to view URL]', {'program': program, 'subp': sub})
---------------------------------------------------------------------------------------------------------------------------------------
template - [login to view URL]
{% for prog in program %}
<tr>
<td>{{[login to view URL]}}</td>
<td>{{prog.program_id}}</td>
{% if [login to view URL] == 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 [login to view URL] == 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 ===
=== 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, social app integration.
You can see some of my works in the portfolio.
Also you can find some live works at
[login to view URL]
[login to view URL]
[login to view URL]
Ping me for discussions.
$220 HKD in 1 giorno
4,9 (58 valutazioni)
6,2
6,2
10 freelance hanno fatto un'offerta media di $213 HKD
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
* Database Programming (MySQL, Sqlite, MongoDb, PostgreSQL) [with SqlAlchemy]
* Web Scrapping, Selenium, Data Science
* XML & JSON Parsing, Regular expressions
* Network programming(protocols - HTTP, FTP, SSH,TCP etc.)
* Payment gateway integration like PayPal(BrainTree) and Stripe
* Platforms - Linux/Windows
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 more than 5 years
of experience in integrated solutions we suggest and advice customerand delever an best sample and many choices for it
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 seeking.
I look forward to meeting with you this week and discussing the details of this position.
I will be able to start your project as soon as possible according to you. Thank you for your consideration
Best Regards
Ethan Ivanov
=== 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. Thank you.
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 to fulfill your needs, because the power is in YOU!